octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building for Microsoft Windows using MSYS


From: Tatsuro MATSUOKA
Subject: Re: Building for Microsoft Windows using MSYS
Date: Wed, 17 Feb 2010 18:25:41 +0900 (JST)

Hello

> > sed -i -e "address@hidden address@hidden @g" 
> > /path/to/gcc/include/c++/exception
> > sed -i -e "address@hidden address@hidden @g" /path/to/gcc/include/c++/new
> > sed -i -e "address@hidden address@hidden @g" 
> > /path/to/gcc/include/c++/typeinfo

Great!! With the modification suggested by you, my long term annoying issue are 
solved!!

I am successfully build octave-3.2.4 using dependencies bundled with 
octave-3.2.3/mingw32 package.

I will make a short note to do this.
(At the moment, documentation and octave-forge are ignored)

1.install octave-3.2.3/mingw32
http://sourceforge.net/projects/octave/files/Octave_Windows%20-%20MinGW/Octave%203.2.3%20for%20Windows%20MinGW32%20Installer/Octave-3.2.3-2_i686-pc-mingw32_gcc-4.4.0_setup.exe/download

Here we assume default install directory (folder). c:\Octave\3.2.3_gcc4.4.0.
(Please modify according to your environments.)

2. modify c++ header file, gcc-4.4.0 to avoid a bug for shared libstdc++ 
building[1] .
In C:\Octave\3.2.3_gcc4.4.0B\mingw32\lib\gcc\mingw32\4.4.0\include\c++
You can find C++ header files.
Please modify the files, 'exception', 'new' and '/typeinfo'.
( I recommend to backup these files before modification.)
Replace all 'class _GLIBCXX_IMPORT' by 'class' by a suitable text editor.
Notepad++ is bundled with octave-3.2.3/mingw32 in 
C:\Octave\3.2.3_gcc4.4.0B\tools\notepad++.

3. download and extract  autoconf, perl and llibcrypt for Msys and merge them to
C:\Octave\3.2.3_gcc4.4.0\MSYS
from  
http://sourceforge.net/projects/mingw/files/

autoconf (perl and libcrypt) are required to execute ./autogen.sh

Note that the latest version autoconf, perl and libcrypt compressed in lzma 
style. Please take care
that some browsers change the extension from 'lzma' to 'tar'. In the case, 
please rename the extension
to 'lzma'

Fortunately, the MSYS bundled with octave-3.2.3/mingw32 have lzma.exe.
You can extract, for example,

octave:1> system('sh')
sh-3.1$ tar -x --lzma -vf autoconf-2.63-1-msys-1.0.11-bin.tar.lzma   

By system('sh') at octave prompt you can execute the Msys sh shell with 
appropriate path setting.
If you want go back to octave, execute
sh-3.1$ exit


4. download octave source from http://www.gnu.org/software/octave/download.html
and extract it 

5. download patch from
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/admin/Windows/mingw32/octave/octave-3.2.3-4.patch?view=log
modify patch. version number 

4. apply patch with patch -p 1 < (patch file name) at the base directory of 
source trees

5. correct related source files manually if the some part of the patch is 
rejected.
# serious rejection ........./liboctave/Makefile.in
around
   -L../libcruft -L. $(RLD_FLAG) \

  -L../libcruft -L. $(RLD_FLAG) \
  $(LIBCRUFT) $(CHOLMOD_LIBS) $(UMFPACK_LIBS) $(AMD_LIBS) $(CAMD_LIBS) \
  $(COLAMD_LIBS) $(CCOLAMD_LIBS) $(CXSPARSE_LIBS) $(ARPACK_LIBS) \
  $(QRUPDATE_LIBS) $(BLAS_LIBS) $(FFTW_LIBS) $(LIBREADLINE) $(LIBGLOB) \
  $(REGEX_LIBS) $(LIBS) $(FLIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) 

Please add $(CXXLIBS) at the end of the above by a text editor like 
  $(REGEX_LIBS) $(LIBS) $(FLIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \
   $(CXXLIBS)


5. ./autogen.sh
At the base directory of source trees, you can find a script file 'autogen.sh'.
It should be carried out to the patches to be effective.

octave:1> cd (base directory of source trees)
octave:2> system('sh')
sh-3.1$   ./authogen.sh

6. configure 
#example
octave:1> cd (base directory of source trees)
octave:2> system('sh')

At the sh-3.1$, please execute like the below
#FLAG setting
export CC='mingw32-gcc-4.4.0-dw2 -shared-libgcc'
export CXX='mingw32-g++-4.4.0-dw2 -shared-libgcc' 
export F77='mingw32-gfortran-4.4.0-dw2 gfortran -shared-libgcc'
#if you have installed gcc-4.4.0 you can use  
# export CC='gcc -shared-libgcc'
# instead the above
export FFLAGS='-O3'
export CFLAGS='-O3'
export CXXFLAGS='-D_GLIBCXX_DLL -O3'
export LDFLAGS='-L/c/Octave/3.2.3_gcc4.4.0/lib -Wl,--allow-multiple-definition'
export CPPFLAGS='-I/c/Octave/3.2.3_gcc4.4.0/include '
export CXXLIBS='-lstdc++_s'

./configure --prefix=(octave install directory path)

7. make at sh-3.1$
make 
# add -i (ignore error ) option if necesary

9.make check  
confirm the results
PASS  506/509  FAIL 3
The three failures for data.cc are already known

10. Preparation for install foler 
copy the below to all components in C:\Octave\3.2.3_gcc4.4.0 to  (octave 
install directory path)
 and delete unnecessary 3.2.3 related directories and files

11.install octave 3.2.4 
make install-strip at sh-3.1$
   

#**********
Hope the above help to those who want to build the octave from source on 
Msys+MinGW 

Regards

Tatsuro

--------------------------------------
VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi]
http://pr.mail.yahoo.co.jp/olympic/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]