[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gnu Octave build error under MinGW/MSYS
From: |
Philip Nienhuis |
Subject: |
Re: Gnu Octave build error under MinGW/MSYS |
Date: |
Mon, 27 Aug 2012 07:42:48 -0700 (PDT) |
Madushan Nishantha wrote
>
> I'm trying to build Gnu Octave for Windows from source relese 3.6.2
>
Why would you do that? There are pre-built MinGW binaries available on
sourceforge (octev.sf.net), including an enormous amount of pre-built add-on
packages as well.
Pre-built dependencies and other valuable stuff is here:
http://www.tatsuromatsuoka.com/octave/Eng/Win/
Anyway what gcc version do you use? Have you documented your steps? We would
be grateful if you did and could share with us how you did it.
> .I built all the main dependencies without having much problem.And
> configuring process went well.But when I tried to run make(After few
> source modifications to get over some errors),It triggers tons of errors
> like
>
>
> ./.libs/liboctinterp.a(liboctinterp_la-octave.o): In function
> `safe_source_file':
> C:\MinGW\sources\octave-3.6.2\src/octave.cc:312: undefined reference to
> `___cxa_begin_catch'
>
>
> At the line
>
>
> libtool: link: gcc -g -O2 -pthread -DHAVE_CONFIG_H -mieee-fp -Wall -W
> -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes
> -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread -pthread -g -O2
> -pthread -o .libs/octave.exe main.o ./.libs/liboctinterp.a
> /mingw/sources/octave-3.6.2~~/liboctave/.libs/liboctave.a
> -L=c:/mingw/bin/../lib/gcc/mingw32/4.7.0 -L=c:/mingw/bin/../lib/gcc
> -L=c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/lib
> -L=c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../.. -lfltk_gl -lfltk -lole32
> -luuid -lcomctl32 -LC:/MinGW/lib /mingw/lib/libfontconfig.dll.a
> -L=C:/MinGW/lib /mingw/lib/libfreetype.dll.a -lz -lbz2
> /mingw/lib/libexpat.dll.a -lopengl32 -lglu32
> ../liboctave/.libs/liboctave.a
> /mingw/sources/octave-3.6.2~~/libcruft/.libs/libcruft.a
> /mingw/lib/libarpack.a /mingw/lib/libfftw3.a -lreadline -ltermcap
> /mingw/lib/libpcre.dll.a ../libcruft/.libs/libcruft.a -llapack -lblas
> -lgfortran -lquadmath -liberty
> -lgdi32 -lws2_32 -luser32 -lkernel32 -pthread -L/mingw/lib
>
>
> I dumped the make log to a file and the file is about 39MB!! Just full of
> errors like above. I'm very much thankful if someone can help me to get
> over this.
>
I cannot add attachments from Nabble, so I'll add a few instructions below.
These were posted almost verbatim IIRC about a year ago in the
octave-maintainers list by me.
They were valid for Octave 3.5.0+ but I used them for building 3.6.2 and now
even 3.7.0+ as well (but for the current dev sources many other fixes are
needed, not yet documented).
Good luck,
Philip
=====================================================================
Building commands used for build
# =========================== General =========================
##************* gcc-4.5.2 octave 3.5.0+ with new build dependencies by
Tatsuro Matsuoka
#
#
#Source modification requireded to avoid errors from gnulib faults(?) on
MinGW.
#
# #include <unistd.h>
# |
# V
# #include <unistd.h>
# #include <unistd.h>
#
# The above modification required for liboctave/oct-env.cc and
src/oct-hist.cc.
# Possibly this has already been done in liboctave/oct-env.cc
#==========Fixed==========================================================
# src/sys-dep.cc: error: 'TH32CS_SNAPMODULE32' was not declared in this
scope'
#See:
#http://hg.savannah.gnu.org/hgweb/octave/rev/2f42a7b0cf94
#==========Fixed==========================================================
# src/file-io.cc:129:7: error: 'unlink' is not a member of 'gnulib'
#I faced the same problem.
#
#But I replaced gnulib::unlink with unlink.
#You need to do this two places.
#
#Then you'll get error-message that isatty is not a part of gnulib, or
something like this.
#Workaround: add include <io.h>.
#
#Also in lex.cc: include <io.h>
#=========================================================================
#Other tools required for develpment source.
# If you want build developmet source, the below tools are reuired.
# * git (PRN) download msysgit, make (using autoinstaller), copy all
newly created
# files (7 files IIRC) into msys/bin
# * (PRN) gnulib. download a snapshot from , untar/unzip
# * Mercurial (PRN) download tortoisehg
#
# I am using the Cygwin to use those tools.
##<PRN>
## Set up mingw, msys, GNUwin32, OctaveLibs, gplibs directories somewhere.
## Add all ./bin directories (mingw/bin, msys/bin, ...) to the Windows PATH
## If you have ghostscript installed, be sure to add \full\path\to\gs\bin in
your Windows PATH,
## and -just to be sure- make a copy of the command line version
(gswin32c.exe) as gs.exe
## Adapt path settings in ..../gplibs/lib/pkgconfig/*.*
.../OctaveLibs/lib/pkgconfig/*.*
## .../OctaveLibs/lib/*.la ..../gplibs/lib/*.la
.../OctaveLibs/bin/fltk-config
## .../OctaveLibs/lib/libhdf5.settings
## Download octave development sources. I use TortoisHG for that.
##</PRN>
# ==========================GNULIB===========================
## Get gnulib snapshot (easiest): browse to
http://git.savannah.gnu.org/gitweb/?p=gnulib.git
## right-click one of the "snapshot" words in the shortlog, and download the
.tgz snapshot.
## Next, in MSYS, do
tar xvzf gnulib-<version>.tgz
## Then, aftger downloading Octave, in the Octave src dir do
./autogen.sh --force --gnulib-srcdir=/dir/where/you/untarred/gnulib-tgz-file
# ===== Cut and paste below into MSYS command terminal. Adapt paths where
needed ===========
export
PATH=/x/Programs/gplibs/bin:/x/Programs/OctaveLibs/bin:$PATH:'/x/Programs/GnuWin32/bin'
export
PKG_CONFIG_PATH='X:/Programs/gplibs/lib/pkgconfig;X:/Programs/OctaveLibs/lib/pkgconfig'
echo 'set term win ;plot sin(x) ; pause 1' | gnuplot # Why is this
needed?
cd /msys/home/<yourname>/octave # or wherever you
untar/zipped Octave sources
export CC='gcc -shared-libgcc'
export CXX='g++ -shared-libgcc'
export F77='gfortran -shared-libgcc'
$CC -v; $CXX -v ;$F77 -v
export LDFLAGS='-L/x/Programs/gplibs/lib -L/x/Programs/OctaveLibs/lib
-L/x/programs/GnuWin32/lib -Wl,--allow-multiple-definition
-Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc-v2'
export CPPFLAGS='-I/x/Programs/gplibs/include
-I/x/Programs/OctaveLibs/include -I/x/programs/GnuWin32/include'
export LIBS='-lgfortran -llapack' # I cannot find the reason why these
options are required.
export LC_ALL=C
export LANG=us
./configure --enable-float-truncate --prefix=/x/octave/octave-3.5.x
## This may yield an conftest disk error. Nasty, you need a disk check
afterwards
# =================== Cut and paste above into MSYS command terminal
=====================
# Check configure output, fix errors and dependencies if needed
# =================== Cut and paste below into MSYS command terminal
=====================
export LC_ALL=C
export LANG=us
make
# =================== Cut and paste above into MSYS command terminal
=====================
#
make -i # make fails TeX error(?) so that reexecute make ignoring errors.
make check -i
make install-strip -i
##******************************************************************************
Add in .octaverc:
setenv ("MAGICK_CONFIGURE_PATH", "/full/path/where/magic.mgk/lives")
(C:\Programs\Octave\3.4.2\share\GraphicsMagick-1.3.7\config, much like in
Benjamin's 3.2.4)
Good luck
2011-06-30
By Tatsuro Matsuoka
2011-07-08, 2011-08-06
Philip Nienhuis
--
View this message in context:
http://octave.1599824.n4.nabble.com/Gnu-Octave-build-error-under-MinGW-MSYS-tp4643374p4643387.html
Sent from the Octave - General mailing list archive at Nabble.com.