[Ipopt] Problem running Ipopt matlab interface

Paul van Hoven paul.van.hoven at googlemail.com
Fri Jul 27 09:34:54 EDT 2012


Okay I substituded the gfortan 4.6 by version 4.3 and tried to
recompile ipopt. This is what I did and the configure script fails:

paul at gauss:~/lib_src/CoinIpopt/build> ../configure
--prefix=/homes/numerik/paul/lib/Ipopt \
> CXX=/usr/site-local/bin/g++-4.2 \
> CC=/usr/site-local/bin/gcc-4.2 \
> F77=/usr/site-local/bin/gfortran-4.3 \
> ADD_CXXFLAGS="-fPIC -fexceptions -DFUNNY_LAPACK_FINT" \
> ADD_CFLAGS="-fPIC -fexceptions" \
> ADD_FFLAGS="-fPIC -fexceptions" \
> --with-matlab-home=/net/matlab/Matlab2011b \
> LDFLAGS="-L/usr/lib64 -lblas_pic"
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
checking whether we want to compile in debug mode... no
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/site-local/bin/gcc-4.2 accepts -g... yes
checking for /usr/site-local/bin/gcc-4.2 option to accept ANSI C... none needed
configure: C compiler options are: -O3 -pipe -DNDEBUG -pedantic-errors
-Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual
-Wall -Wno-unknown-pragmas -fPIC -fexceptions
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/site-local/bin/g++-4.2 accepts -g... yes
checking whether C++ compiler /usr/site-local/bin/g++-4.2 works... yes
configure: C++ compiler options are: -O3 -pipe -DNDEBUG
-pedantic-errors -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual
-Wall -Wpointer-arith -Wwrite-strings -Wconversion
-Wno-unknown-pragmas -fPIC -fexceptions -DFUNNY_LAPACK_FINT
configure: Trying to determine Fortran compiler name
checking for xlf_r... /usr/site-local/bin/gfortran-4.3
checking whether we are using the GNU Fortran 77 compiler... no
checking whether /usr/site-local/bin/gfortran-4.3 accepts -g... no
configure: WARNING: The flags FFLAGS="" do not work.  I will now just
try '-O', but you might want to set FFLAGS manually.
configure: WARNING: This value for FFLAGS does not work.  I will
continue with empty FFLAGS, but you might want to set FFLAGS manually.
configure: Fortran compiler options are:
checking for egrep... grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of /usr/site-local/bin/gcc-4.2... gcc3
checking dependency style of /usr/site-local/bin/g++-4.2... gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by /usr/site-local/bin/gcc-4.2... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... /usr/site-local/bin/gcc-4.2 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... /usr/site-local/bin/g++-4.2 -E
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from
/usr/site-local/bin/gcc-4.2 object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if /usr/site-local/bin/gcc-4.2 supports -fno-rtti -fno-exceptions... no
checking for /usr/site-local/bin/gcc-4.2 option to produce PIC... -fPIC
checking if /usr/site-local/bin/gcc-4.2 PIC flag -fPIC works... yes
checking if /usr/site-local/bin/gcc-4.2 static flag -static works... no
checking if /usr/site-local/bin/gcc-4.2 supports -c -o file.o... yes
checking whether the /usr/site-local/bin/gcc-4.2 linker (/usr/bin/ld
-m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by /usr/site-local/bin/g++-4.2... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the /usr/site-local/bin/g++-4.2 linker (/usr/bin/ld
-m elf_x86_64) supports shared libraries... yes
checking for /usr/site-local/bin/g++-4.2 option to produce PIC... -fPIC
checking if /usr/site-local/bin/g++-4.2 PIC flag -fPIC works... yes
checking if /usr/site-local/bin/g++-4.2 static flag -static works... no
checking if /usr/site-local/bin/g++-4.2 supports -c -o file.o... yes
checking whether the /usr/site-local/bin/g++-4.2 linker (/usr/bin/ld
-m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for /usr/site-local/bin/gfortran-4.3 option to produce PIC... -fPIC
checking if /usr/site-local/bin/gfortran-4.3 PIC flag -fPIC works... no
checking if /usr/site-local/bin/gfortran-4.3 static flag -static works... no
checking if /usr/site-local/bin/gfortran-4.3 supports -c -o file.o... no
checking whether the /usr/site-local/bin/gfortran-4.3 linker
(/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: Build is "x86_64-unknown-linux-gnu".
checking if library version is set... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether project ASL is available... ThirdParty/ASL
checking whether project ASL needs to be configured... yes
checking whether project Blas is available... ThirdParty/Blas
checking whether project Blas needs to be configured... yes
checking whether project Lapack is available... ThirdParty/Lapack
checking whether project Lapack needs to be configured... yes
checking whether project Metis is available... notGiven
checking whether project Metis needs to be configured... no
checking whether project HSL is available... ThirdParty/HSL
checking whether project HSL needs to be configured... yes
checking whether project Mumps is available... notGiven
checking whether project Mumps needs to be configured... no
checking whether project Ipopt is available... .
checking whether project Ipopt needs to be configured... yes
checking which command should be used to link input files... ln -s
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
configure: configuring in ThirdParty/ASL
configure: running /bin/sh '../../../ThirdParty/ASL/configure'
--prefix=/homes/numerik/paul/lib/Ipopt
'--prefix=/homes/numerik/paul/lib/Ipopt'
'CXX=/usr/site-local/bin/g++-4.2' 'CC=/usr/site-local/bin/gcc-4.2'
'F77=/usr/site-local/bin/gfortran-4.3' 'ADD_CXXFLAGS=-fPIC
-fexceptions -DFUNNY_LAPACK_FINT' 'ADD_CFLAGS=-fPIC -fexceptions'
'ADD_FFLAGS=-fPIC -fexceptions'
'--with-matlab-home=/net/matlab/Matlab2011b' 'LDFLAGS=-L/usr/lib64
-lblas_pic' --cache-file=/dev/null --srcdir=../../../ThirdParty/ASL
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
checking for svnversion... yes
../../../ThirdParty/ASL/configure: line 1740: test: !=: unary operator expected
checking whether we want to compile in debug mode... no
checking for egrep... grep -E
checking whether ln -s works... yes
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/site-local/bin/gcc-4.2 accepts -g... yes
checking for /usr/site-local/bin/gcc-4.2 option to accept ANSI C... none needed
configure: C compiler options are: -O3 -pipe -DNDEBUG  -fPIC -fexceptions
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of /usr/site-local/bin/gcc-4.2... gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
configure: Using libtool script in directory ../..
checking if library version is set... 2:3:1
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
configure: Configuring ASL to build libamplsolver.a.
checking for getrusage... yes
checking for long long... yes
configure: Command line flags for (n)make "-j 1 CFLAGS=" -O3 -pipe
-DNDEBUG -fPIC -fexceptions "".
checking which command should be used to link input files... ln -s
configure: creating ./config.status
config.status: creating Makefile
config.status: creating compile_MS_ASL
config.status: creating compile_Unix_ASL
config.status: creating coinasl.pc
config.status: creating coinasl-uninstalled.pc
config.status: executing depfiles commands
configure: Configuration of ThirdPartyASL successful
configure: configuring in ThirdParty/Blas
configure: running /bin/sh '../../../ThirdParty/Blas/configure'
--prefix=/homes/numerik/paul/lib/Ipopt
'--prefix=/homes/numerik/paul/lib/Ipopt'
'CXX=/usr/site-local/bin/g++-4.2' 'CC=/usr/site-local/bin/gcc-4.2'
'F77=/usr/site-local/bin/gfortran-4.3' 'ADD_CXXFLAGS=-fPIC
-fexceptions -DFUNNY_LAPACK_FINT' 'ADD_CFLAGS=-fPIC -fexceptions'
'ADD_FFLAGS=-fPIC -fexceptions'
'--with-matlab-home=/net/matlab/Matlab2011b' 'LDFLAGS=-L/usr/lib64
-lblas_pic' --cache-file=/dev/null --srcdir=../../../ThirdParty/Blas
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for svnversion... yes
../../../ThirdParty/Blas/configure: line 1689: test: !=: unary operator expected
checking build system type... x86_64-unknown-linux-gnu
checking whether we want to compile in debug mode... no
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/site-local/bin/gcc-4.2 accepts -g... yes
checking for /usr/site-local/bin/gcc-4.2 option to accept ANSI C... none needed
configure: C compiler options are: -O3 -pipe -DNDEBUG -pedantic-errors
-Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual
-Wall -Wno-unknown-pragmas -fPIC -fexceptions
configure: Trying to determine Fortran compiler name
checking for xlf_r... /usr/site-local/bin/gfortran-4.3
checking whether we are using the GNU Fortran 77 compiler... no
checking whether /usr/site-local/bin/gfortran-4.3 accepts -g... no
configure: WARNING: The flags FFLAGS="" do not work.  I will now just
try '-O', but you might want to set FFLAGS manually.
configure: WARNING: This value for FFLAGS does not work.  I will
continue with empty FFLAGS, but you might want to set FFLAGS manually.
configure: Fortran compiler options are:
checking how to get verbose linking output from
/usr/site-local/bin/gfortran-4.3... configure: WARNING: compilation
failed

checking for Fortran libraries of /usr/site-local/bin/gfortran-4.3...
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... configure: error: cannot
compile a simple Fortran program
See `config.log' for more details.
configure: error: /bin/sh '../../../ThirdParty/Blas/configure' failed
for ThirdParty/Blas


What does that mean?


2012/7/27 Stefan Vigerske <stefan at math.hu-berlin.de>:
> Hi,
>
> I don't know if other tricks may work.
> I never did it, but you could try setting the LD_PRELOAD variable to the
> right gfortran library. I guess you would need to set it in the same
> environment where you start matlab, so it would be inherited to the loading
> of the mex library.
> (I also have never used mex libraries in Matlab.)
>
> Stefan
>
>
>
> On 07/27/2012 03:13 PM, Paul van Hoven wrote:
>>
>> Yeah, I read that. And thank you for that advice. The problem is that
>> I do not have admin rights to do this and our it staff is pretty lousy
>> :(
>>
>> That will be a struggle arguing with them...
>>
>>
>>
>> 2012/7/27 Stefan Vigerske <stefan at math.hu-berlin.de>:
>>>
>>> Hi,
>>>
>>> no, there is no option in the configure script of Ipopt so far that links
>>> against the gfortran libraries statically.
>>>
>>> I think I send a workaround for this on 6th of July already:
>>>
>>>
>>> "Hi,
>>>
>>> the problem is that your Ipopt was build with a newer compiler than
>>> matlab.
>>> Ipopt requires GFORTRAN_1.4 in libgfortran.so.3, but when run under
>>> matlab,
>>> the fortran library from /net/matlab/Matlab2011b/sys/os/glnxa64 is used.
>>> This one does not have GFORTRAN_1.4 in it.
>>>
>>> When I have such a problem, I usually move away the older fortran
>>> library.
>>> I.e., try moving /net/matlab/Matlab2011b/sys/os/glnxa64/libgfortran.so.3
>>> to
>>> some place that the dynamic library loader does not find.
>>> Hopefully, matlab will also work fine with the newer libgfortran.so that
>>> is
>>> installed in your system.
>>>
>>> Stefan"
>>>
>>> Stefan
>>>
>>>
>>> On 07/27/2012 03:05 PM, Paul van Hoven wrote:
>>>>
>>>>
>>>> Okay, thanks for the tips. It finally compiled. But again I get the
>>>> same error message when I try to run a matlab script. So static
>>>> compilation does not solve this problem:
>>>>
>>>> ------------------------------------------
>>>> Invalid MEX-file
>>>> '/homes/numerik/paul/lib/Ipopt/lib64/coin/ipopt.mexa64':
>>>> /net/matlab/Matlab2011b/sys/os/glnxa64/libgfortran.so.3: version
>>>> `GFORTRAN_1.4' not found (required by
>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ipopt.mexa64)
>>>>
>>>> Error in IpoptDemo.runme (line 48)
>>>>               [x info] = ipopt(x0,funcs,options);
>>>>
>>>> Error in IpoptDemo.clusterRunme (line 9)
>>>>               IpoptDemo.runme;
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2012/7/27 Stefan Vigerske <stefan at math.hu-berlin.de>:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> same problem as before.
>>>>> Make LIBS explicit. I think it should be
>>>>>
>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6
>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64
>>>>> -L/lib/../lib64 -L/usr/lib/../lib64
>>>>>
>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/lib
>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../..
>>>>> -L/homes/numerik/paul/lib/Ipopt/lib/
>>>>> -lipopt -lcoinhsl -llapack -lblas -ldl -lblas_pic -lgfortran -lm
>>>>> -lgcc_s
>>>>> -lquadmath
>>>>>
>>>>> Stefan
>>>>>
>>>>>
>>>>> On 07/27/2012 02:19 PM, Paul van Hoven wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Yeah, that helped. But now I get another compilation error which is
>>>>>> also not clear to me
>>>>>>
>>>>>> -> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
>>>>>>       FILE = /net/matlab/Matlab2011b/bin/mexopts.sh
>>>>>> ----------------------------------------------------------------
>>>>>> ->    MATLAB                = /net/matlab/Matlab2011b
>>>>>> ->    CC                    = /usr/site-local/bin/g++-4.2
>>>>>> ->    CC flags:
>>>>>>             CFLAGS             = -ansi -D_GNU_SOURCE  -fexceptions
>>>>>> -fPIC
>>>>>> -fno-omit-frame-pointer -pthread
>>>>>>             CDEBUGFLAGS        = -g
>>>>>>             COPTIMFLAGS        = -O3 -pipe -DNDEBUG -pedantic-errors
>>>>>> -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall
>>>>>> -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
>>>>>> -fPIC -fexceptions -DFUNNY_LAPACK_FINT  -DMATLAB_MEXFILE
>>>>>>             CLIBS              =
>>>>>> -Wl,-rpath-link,/net/matlab/Matlab2011b/bin/glnxa64
>>>>>> -L/net/matlab/Matlab2011b/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
>>>>>>             arguments          =  -DMX_COMPAT_32
>>>>>> ->    CXX                   = /usr/site-local/bin/g++-4.2
>>>>>> ->    CXX flags:
>>>>>>             CXXFLAGS           = -ansi -D_GNU_SOURCE -fPIC
>>>>>> -fno-omit-frame-pointer -pthread
>>>>>>             CXXDEBUGFLAGS      = -g
>>>>>>             CXXOPTIMFLAGS      = -O3 -pipe -DNDEBUG -pedantic-errors
>>>>>> -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall
>>>>>> -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
>>>>>> -fPIC -fexceptions -DFUNNY_LAPACK_FINT  -DMATLAB_MEXFILE
>>>>>>             CXXLIBS            =
>>>>>> -Wl,-rpath-link,/net/matlab/Matlab2011b/bin/glnxa64
>>>>>> -L/net/matlab/Matlab2011b/bin/glnxa64 -lmx -lmex -lmat -lm
>>>>>>             arguments          =  -DMX_COMPAT_32
>>>>>> ->    FC                    = gfortran
>>>>>> ->    FC flags:
>>>>>>             FFLAGS             = -fexceptions -fbackslash -fPIC
>>>>>> -fno-omit-frame-pointer
>>>>>>             FDEBUGFLAGS        = -g
>>>>>>             FOPTIMFLAGS        = -O
>>>>>>             FLIBS              =
>>>>>> -Wl,-rpath-link,/net/matlab/Matlab2011b/bin/glnxa64
>>>>>> -L/net/matlab/Matlab2011b/bin/glnxa64 -lmx -lmex -lmat -lm
>>>>>>             arguments          =  -DMX_COMPAT_32
>>>>>> ->    LD                    = /usr/site-local/bin/g++-4.2
>>>>>> ->    Link flags:
>>>>>>             LDFLAGS            = -pthread -shared
>>>>>>
>>>>>>
>>>>>>
>>>>>> -Wl,--version-script,/net/matlab/Matlab2011b/extern/lib/glnxa64/mexFunction.map
>>>>>> -Wl,--no-undefined
>>>>>>             LDDEBUGFLAGS       = -g
>>>>>>             LDOPTIMFLAGS       = -O3 -pipe -DNDEBUG -pedantic-errors
>>>>>> -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall
>>>>>> -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
>>>>>> -fPIC -fexceptions -DFUNNY_LAPACK_FINT  -DMATLAB_MEXFILE
>>>>>>             LDEXTENSION        = .mexa64
>>>>>>             arguments          =
>>>>>>
>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL/libcoinhsl.la
>>>>>>
>>>>>>
>>>>>>
>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt/src/Interfaces/libipopt.la
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64
>>>>>> -L/lib/../lib64 -L/usr/lib/../lib64
>>>>>>
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/lib
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../.. -llapack -lblas -ldl
>>>>>> -lblas_pic -lgfortran -lm -lgcc_s -lquadmath
>>>>>> ->    LDCXX                 =
>>>>>> ->    Link flags:
>>>>>>             LDCXXFLAGS         =
>>>>>>             LDCXXDEBUGFLAGS    =
>>>>>>             LDCXXOPTIMFLAGS    =
>>>>>>             LDCXXEXTENSION     =
>>>>>>             arguments          =
>>>>>>
>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL/libcoinhsl.la
>>>>>>
>>>>>>
>>>>>>
>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt/src/Interfaces/libipopt.la
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64
>>>>>> -L/lib/../lib64 -L/usr/lib/../lib64
>>>>>>
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/lib
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../.. -llapack -lblas -ldl
>>>>>> -lblas_pic -lgfortran -lm -lgcc_s -lquadmath
>>>>>> ----------------------------------------------------------------
>>>>>>
>>>>>> -> /usr/site-local/bin/g++-4.2 -O3 -pipe -DNDEBUG -pedantic-errors
>>>>>> -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall
>>>>>> -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
>>>>>> -fPIC -fexceptions -DFUNNY_LAPACK_FINT  -DMATLAB_MEXFILE   -pthread
>>>>>> -shared
>>>>>>
>>>>>>
>>>>>> -Wl,--version-script,/net/matlab/Matlab2011b/extern/lib/glnxa64/mexFunction.map
>>>>>> -Wl,--no-undefined -o  "ipopt.mexa64"   "matlabexception.o"
>>>>>> "matlabfunctionhandle.o"  "matlabjournal.o"  "iterate.o"
>>>>>> "ipoptoptions.o"  "options.o"  "sparsematrix.o"  "callbackfunctions.o"
>>>>>>     "matlabinfo.o"  "matlabprogram.o"  "ipopt.o"
>>>>>>
>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL/libcoinhsl.la
>>>>>>
>>>>>>
>>>>>>
>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt/src/Interfaces/libipopt.la
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64
>>>>>> -L/lib/../lib64 -L/usr/lib/../lib64
>>>>>>
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/lib
>>>>>> -L/usr/lib64/gcc/x86_64-suse-linux/4.6/../../.. -llapack -lblas -ldl
>>>>>> -lblas_pic -lgfortran -lm -lgcc_s -lquadmath
>>>>>> -Wl,-rpath-link,/net/matlab/Matlab2011b/bin/glnxa64
>>>>>> -L/net/matlab/Matlab2011b/bin/glnxa64 -lmx -lmex -lmat -lm
>>>>>>
>>>>>>
>>>>>>
>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL/libcoinhsl.la:
>>>>>> file not recognized: File format not recognized
>>>>>> collect2: ld returned 1 exit status
>>>>>>
>>>>>>        mex: link of ' "ipopt.mexa64"' failed.
>>>>>>
>>>>>> make: *** [ipopt.mexa64] Fehler 1
>>>>>>
>>>>>> The file libcoinhsl.la definetly exists.
>>>>>>
>>>>>> 2012/7/27 Stefan Vigerske <stefan at math.hu-berlin.de>:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> it seems to pick up the wrong IpoptConfig.h file.
>>>>>>> It should take
>>>>>>> /homes/numerik/paul/lib/Ipopt/include/coin/IpoptConfig.h, but it took
>>>>>>> the
>>>>>>> one from /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/.
>>>>>>>
>>>>>>> Can you confirm that /homes/numerik/paul/lib/Ipopt/lib/pkgconfig
>>>>>>> contains
>>>>>>> an
>>>>>>> ipopt.pc file where the Cflags are such that they have
>>>>>>> -I/homes/numerik/paul/lib/Ipopt/include/coin in the beginning.
>>>>>>> Or the problem are all the paths in your pkg-config path that do not
>>>>>>> belong
>>>>>>> there.
>>>>>>>
>>>>>>> A workaround could be to change the matlab interface makefile to say
>>>>>>> only
>>>>>>> INCL = -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>
>>>>>>> Stefan
>>>>>>>
>>>>>>>
>>>>>>> On 07/27/2012 11:59 AM, Paul van Hoven wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks for your quick reply. I noticed that I accidently used the
>>>>>>>> wrong Makefile. Instead I now use the correct on that was create by
>>>>>>>> the configure script. Unfortunately I still get an error that seems
>>>>>>>> to
>>>>>>>> be related to the fortran libraries but I'm not shure about that.
>>>>>>>>
>>>>>>>> This is what the Makefile looks like
>>>>>>>>
>>>>>>>>
>>>>>>>> paul at gauss:~/lib_src/CoinIpopt/build/Ipopt/contrib/MatlabInterface/src>
>>>>>>>> cat Makefile
>>>>>>>> # Copyright (C) 2007, 2009 Peter Carbonetto. All Rights Reserved.
>>>>>>>> # This code is published under the Eclipse Public License.
>>>>>>>> #
>>>>>>>> # Author: Peter Carbonetto
>>>>>>>> #         Dept. of Computer Science
>>>>>>>> #         University of British Columbia
>>>>>>>> #         May 19, 2007
>>>>>>>>
>>>>>>>> # INSTRUCTIONS: Please modify the following few variables. See the
>>>>>>>> # readme.html file for more information.
>>>>>>>>
>>>>>>>> # This variable corresponds to the base directory of your MATLAB
>>>>>>>> # installation. This is the directory so that in its 'bin/'
>>>>>>>> # subdirectory you see all the matlab executables (such as 'matlab',
>>>>>>>> # 'mex', etc.)
>>>>>>>> MATLAB_HOME = /net/matlab/Matlab2011b
>>>>>>>>
>>>>>>>> # Set the suffix for matlab mex files. The contents of the
>>>>>>>> # $(MATLAB_HOME)/extern/examples/mex directory might be able to help
>>>>>>>> # you in your choice.
>>>>>>>> MEXSUFFIX   = mexa64
>>>>>>>>
>>>>>>>> # This is the command used to call the mex program. Usually, it is
>>>>>>>> # just "mex". But it also may be something like
>>>>>>>> # /user/local/R2006b/bin/mex if "mex" doesn't work.
>>>>>>>> MEX = $(MATLAB_HOME)/bin/mex
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> #############################################################################
>>>>>>>> # Do not modify anything below unless you know what you're doing.
>>>>>>>> exec_prefix = ${prefix}
>>>>>>>> prefix      = /homes/numerik/paul/lib/Ipopt
>>>>>>>> libdir      = ${exec_prefix}/lib64/coin
>>>>>>>>
>>>>>>>> CXX         = /usr/site-local/bin/g++-4.2
>>>>>>>> CXXFLAGS    = -O3 -pipe -DNDEBUG -pedantic-errors -Wimplicit
>>>>>>>> -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith
>>>>>>>> -Wwrite-strings -Wconversion -Wno-unknown-pragmas -fPIC -fexceptions
>>>>>>>> -DFUNNY_LAPACK_FINT  -DMATLAB_MEXFILE # -DMWINDEXISINT
>>>>>>>> LDFLAGS     = $(CXXFLAGS)
>>>>>>>>
>>>>>>>> COIN_HAS_PKGCONFIG = TRUE
>>>>>>>> COIN_CXX_IS_CL = #TRUE
>>>>>>>>
>>>>>>>> # Include directories (we use the CYGPATH_W variables to allow
>>>>>>>> compilation with Windows compilers)
>>>>>>>> ifeq ($(COIN_HAS_PKGCONFIG), TRUE)
>>>>>>>>       INCL =
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> `PKG_CONFIG_PATH=/homes/numerik/paul/lib/Ipopt/lib/pkgconfig::/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/ASL:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Blas:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Lapack:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL:/homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/ASL:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Blas:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Lapack:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL:/homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt
>>>>>>>> /usr/bin/pkg-config --cflags ipopt`
>>>>>>>> else
>>>>>>>>       INCL = -I`$(CYGPATH_W)
>>>>>>>> /homes/numerik/paul/lib/Ipopt/include/coin`
>>>>>>>> endif
>>>>>>>>
>>>>>>>> # Linker flags
>>>>>>>> ifeq ($(COIN_HAS_PKGCONFIG), TRUE)
>>>>>>>>       LIBS =
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> `PKG_CONFIG_PATH=/homes/numerik/paul/lib/Ipopt/lib/pkgconfig::/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/ASL:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Blas:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Lapack:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL:/homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/ASL:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Blas:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Lapack:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL:/homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt
>>>>>>>> /usr/bin/pkg-config --libs ipopt`
>>>>>>>> else
>>>>>>>>       ifeq ($(COIN_CXX_IS_CL), TRUE)
>>>>>>>>         LIBS = /link /libpath:`$(CYGPATH_W)
>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib/coin` libipopt.lib -llapack -lblas
>>>>>>>> -lm  -ldl
>>>>>>>>       else
>>>>>>>>         LIBS = -L/homes/numerik/paul/lib/Ipopt/lib/coin -lipopt
>>>>>>>> -llapack
>>>>>>>> -lblas -lm  -ldl
>>>>>>>>       endif
>>>>>>>> endif
>>>>>>>>
>>>>>>>> # The following is necessary under cygwin, if native compilers are
>>>>>>>> used
>>>>>>>> CYGPATH_W = echo
>>>>>>>>
>>>>>>>> MEXFLAGS    = -v -cxx -O CC="$(CXX)" CXX="$(CXX)" LD="$(CXX)"
>>>>>>>> \
>>>>>>>>                   COPTIMFLAGS="$(CXXFLAGS)"
>>>>>>>> CXXOPTIMFLAGS="$(CXXFLAGS)"
>>>>>>>> \
>>>>>>>>                   LDOPTIMFLAGS="$(LDFLAGS)"
>>>>>>>>
>>>>>>>> TARGET = ipopt.$(MEXSUFFIX)
>>>>>>>> OBJS   = matlabexception.o      \
>>>>>>>>              matlabfunctionhandle.o \
>>>>>>>>              matlabjournal.o        \
>>>>>>>>              iterate.o              \
>>>>>>>>              ipoptoptions.o         \
>>>>>>>>              options.o              \
>>>>>>>>              sparsematrix.o         \
>>>>>>>>              callbackfunctions.o    \
>>>>>>>>              matlabinfo.o           \
>>>>>>>>              matlabprogram.o        \
>>>>>>>>              ipopt.o
>>>>>>>>
>>>>>>>> SRCDIR = ../../../../../Ipopt/contrib/MatlabInterface/src
>>>>>>>> VPATH = $(SRCDIR)
>>>>>>>>
>>>>>>>> all: $(TARGET)
>>>>>>>>
>>>>>>>> install: $(TARGET)
>>>>>>>>            if test -d $(libdir); then : ; else mkdir $(libdir); fi
>>>>>>>>            cp $(SRCDIR)/../ipopt.m $(TARGET) $(libdir)
>>>>>>>>
>>>>>>>> uninstall:
>>>>>>>>            rm -f $(libdir)/ipopt.m $(libdir)/ipopt.$(MEXSUFFIX)
>>>>>>>>
>>>>>>>> $(TARGET): $(OBJS)
>>>>>>>>            $(MEX) $(MEXFLAGS) $(LIBS) -output $@ $^
>>>>>>>>
>>>>>>>> %.o: %.cpp
>>>>>>>>            $(CXX) $(CXXFLAGS) $(INCL)
>>>>>>>> -I$(MATLAB_HOME)/extern/include \
>>>>>>>>             -o $@ -c $^
>>>>>>>>
>>>>>>>> clean:
>>>>>>>>            rm -f $(OBJS) $(TARGET)
>>>>>>>>
>>>>>>>> distclean: clean
>>>>>>>>
>>>>>>>>
>>>>>>>> And this is the output I get
>>>>>>>>
>>>>>>>>
>>>>>>>> paul at gauss:~/lib_src/CoinIpopt/build/Ipopt/contrib/MatlabInterface/src>
>>>>>>>> make
>>>>>>>> /usr/site-local/bin/g++-4.2 -O3 -pipe -DNDEBUG -pedantic-errors
>>>>>>>> -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall
>>>>>>>> -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
>>>>>>>> -fPIC -fexceptions -DFUNNY_LAPACK_FINT  -DMATLAB_MEXFILE
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> `PKG_CONFIG_PATH=/homes/numerik/paul/lib/Ipopt/lib/pkgconfig::/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/ASL:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Blas:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Lapack:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL:/homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/ASL:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Blas:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/Lapack:/homes/numerik/paul/lib_src/CoinIpopt/build/ThirdParty/HSL:/homes/numerik/paul/lib_src/CoinIpopt/build/Ipopt
>>>>>>>> /usr/bin/pkg-config --cflags ipopt`
>>>>>>>> -I/net/matlab/Matlab2011b/extern/include \
>>>>>>>>             -o matlabexception.o -c
>>>>>>>> ../../../../../Ipopt/contrib/MatlabInterface/src/matlabexception.cpp
>>>>>>>> In file included from
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpDebug.hpp:12,
>>>>>>>>                      from
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpUtils.hpp:14,
>>>>>>>>                      from
>>>>>>>>
>>>>>>>>
>>>>>>>> ../../../../../Ipopt/contrib/MatlabInterface/src/matlabexception.cpp:10:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpoptConfig.h:39:30:
>>>>>>>> error: configall_system.h: No such file or directory
>>>>>>>> In file included from
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpUtils.hpp:14,
>>>>>>>>                      from
>>>>>>>>
>>>>>>>>
>>>>>>>> ../../../../../Ipopt/contrib/MatlabInterface/src/matlabexception.cpp:10:
>>>>>>>>
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpDebug.hpp:21:4:
>>>>>>>> error: #error "don't have header file for assert"
>>>>>>>> In file included from
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpDebug.hpp:12,
>>>>>>>>                      from
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpUtils.hpp:14,
>>>>>>>>                      from
>>>>>>>>
>>>>>>>>
>>>>>>>> ../../../../../Ipopt/contrib/MatlabInterface/src/matlabexception.cpp:10:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/src/Common/IpoptConfig.h:102:
>>>>>>>> error: 'FORTRAN_INTEGER_TYPE' does not name a type
>>>>>>>> make: *** [matlabexception.o] Fehler 1
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2012/7/26 Tony Kelman <kelman at berkeley.edu>:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi again. From your original email, it looks like you modified the
>>>>>>>>> makefile
>>>>>>>>> for the Matlab interface a fair amount relative to what configure
>>>>>>>>> generated?
>>>>>>>>> The line that appears to be causing a problem is
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -L/usr/site-local/lib/gcc/x86_64-unknown-linux-gnu/4.2.4
>>>>>>>>>> -lgfortran
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> This is leading mex to link against the 4.2.4 version of
>>>>>>>>> libgfortran,
>>>>>>>>> rather
>>>>>>>>> than the 4.6 version that you compiled BLAS, LAPACK, and the HSL
>>>>>>>>> routines
>>>>>>>>> with. I'm guessing that if gfortran-4.6 is in /usr/bin, then the
>>>>>>>>> libgfortran
>>>>>>>>> that you want to link against is probably in
>>>>>>>>> /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.something (possibly with
>>>>>>>>> the
>>>>>>>>> 2nd-to-last folder named more specific depending on your distro),
>>>>>>>>> or
>>>>>>>>> maybe
>>>>>>>>> just in /usr/lib[64].
>>>>>>>>>
>>>>>>>>> Usually pkg-config figures this all out for you and automatically
>>>>>>>>> links
>>>>>>>>> to
>>>>>>>>> the right libraries. Was that method not working?
>>>>>>>>>
>>>>>>>>> -Tony
>>>>>>>>>
>>>>>>>>> -----Original Message----- From: Paul van Hoven
>>>>>>>>> Sent: Thursday, July 26, 2012 2:34 AM
>>>>>>>>> To: Tony Kelman
>>>>>>>>> Cc: ipopt at list.coin-or.org
>>>>>>>>> Subject: Re: [Ipopt] Problem running Ipopt matlab interface
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks for the answers. I built a static version of ipopt. But now
>>>>>>>>> I
>>>>>>>>> get an error when compiling the Matlabinterface:
>>>>>>>>>
>>>>>>>>> This was my configure call for compiling ipopt:
>>>>>>>>> ../configure --prefix=/homes/numerik/paul/lib/Ipopt \
>>>>>>>>> CXX=/usr/site-local/bin/g++-4.2 \
>>>>>>>>> CC=/usr/site-local/bin/gcc-4.2 \
>>>>>>>>> F77=/usr/bin/gfortran-4.6 \
>>>>>>>>> ADD_CXXFLAGS="-fPIC -fexceptions -DFUNNY_LAPACK_FINT" \
>>>>>>>>> ADD_CFLAGS="-fPIC -fexceptions" \
>>>>>>>>> ADD_FFLAGS="-fPIC -fexceptions" \
>>>>>>>>> --with-matlab-home=/net/matlab/Matlab2011b \
>>>>>>>>> LDFLAGS="-L/usr/lib64 -lblas_pic" \
>>>>>>>>> -disable-shared
>>>>>>>>>
>>>>>>>>> Ipopt compiled fine, but when I try to compile the matlab interface
>>>>>>>>> I
>>>>>>>>> get an error:
>>>>>>>>> paul at gauss:~/lib_src/CoinIpopt/Ipopt/contrib/MatlabInterface/src>
>>>>>>>>> make
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o matlabjournal.o -c
>>>>>>>>> matlabjournal.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o matlabexception.o -c
>>>>>>>>> matlabexception.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o matlabfunctionhandle.o
>>>>>>>>> -c
>>>>>>>>> matlabfunctionhandle.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o iterate.o -c
>>>>>>>>> iterate.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o ipoptoptions.o -c
>>>>>>>>> ipoptoptions.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o options.o -c
>>>>>>>>> options.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o sparsematrix.o -c
>>>>>>>>> sparsematrix.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o callbackfunctions.o -c
>>>>>>>>> callbackfunctions.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o matlabinfo.o -c
>>>>>>>>> matlabinfo.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o matlabprogram.o -c
>>>>>>>>> matlabprogram.cpp
>>>>>>>>> /usr/site-local/bin/g++-4.2 -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>> -DMWINDEXISINT -I/homes/numerik/paul/lib/Ipopt/include/coin
>>>>>>>>> -I/net/matlab/Matlab2011b/extern/include -o ipopt.o -c ipopt.cpp
>>>>>>>>> /net/matlab/Matlab2011b/bin/mex -cxx
>>>>>>>>> CC='/usr/site-local/bin/g++-4.2'
>>>>>>>>> CXX='/usr/site-local/bin/g++-4.2' LD='/usr/site-local/bin/g++-4.2'
>>>>>>>>> -lm
>>>>>>>>> -L/homes/numerik/paul/lib/Ipopt/lib64/coin -lipopt
>>>>>>>>> -L/homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty -lcoinlapack
>>>>>>>>> -lcoinblas -lcoinhsl -lamplsolver
>>>>>>>>> -L/usr/site-local/lib/gcc/x86_64-unknown-linux-gnu/4.2.4 -lgfortran
>>>>>>>>> -ldl -largeArrayDims -output ipopt.mexa64 matlabjournal.o
>>>>>>>>> matlabexception.o matlabfunctionhandle.o iterate.o ipoptoptions.o
>>>>>>>>> options.o sparsematrix.o callbackfunctions.o matlabinfo.o
>>>>>>>>> matlabprogram.o ipopt.o
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinlapack.a(dlamch.o):
>>>>>>>>> In function `dlamc2_':
>>>>>>>>> dlamch.f:(.text+0x762): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinblas.a(xerbla.o):
>>>>>>>>> In function `xerbla_':
>>>>>>>>> xerbla.f:(.text+0x77): undefined reference to
>>>>>>>>> `_gfortran_transfer_character_write'
>>>>>>>>> xerbla.f:(.text+0x87): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):
>>>>>>>>> In function `ma27od_':
>>>>>>>>> ma27ad.f:(.text+0x2f86): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x2fa0): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):
>>>>>>>>> In function `ma27nd_':
>>>>>>>>> ma27ad.f:(.text+0x3834): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x3854): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):ma27ad.f:(.text+0x3873):
>>>>>>>>> more undefined references to `_gfortran_transfer_integer_write'
>>>>>>>>> follow
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):
>>>>>>>>> In function `ma27ad_':
>>>>>>>>> ma27ad.f:(.text+0x722c): undefined reference to
>>>>>>>>> `_gfortran_transfer_real_write'
>>>>>>>>> ma27ad.f:(.text+0x723d): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x724e): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x725f): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x7270): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x7281): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):ma27ad.f:(.text+0x7292):
>>>>>>>>> more undefined references to `_gfortran_transfer_integer_write'
>>>>>>>>> follow
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):
>>>>>>>>> In function `ma27bd_':
>>>>>>>>> ma27ad.f:(.text+0x7d05): undefined reference to
>>>>>>>>> `_gfortran_transfer_real_write'
>>>>>>>>> ma27ad.f:(.text+0x7dd5): undefined reference to
>>>>>>>>> `_gfortran_transfer_real_write'
>>>>>>>>> ma27ad.f:(.text+0x7dea): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x7dff): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x7efe): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x7ff6): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x80d6): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):ma27ad.f:(.text+0x81bb):
>>>>>>>>> more undefined references to `_gfortran_transfer_integer_write'
>>>>>>>>> follow
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):
>>>>>>>>> In function `ma27bd_':
>>>>>>>>> ma27ad.f:(.text+0x8686): undefined reference to
>>>>>>>>> `_gfortran_transfer_real_write'
>>>>>>>>> ma27ad.f:(.text+0x8766): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x87e5): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x8a9e): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x8b21): undefined reference to
>>>>>>>>> `_gfortran_transfer_character_write'
>>>>>>>>> ma27ad.f:(.text+0x8bad): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x8c2e): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x8cbf): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x8d43): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> ma27ad.f:(.text+0x8dba): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):ma27ad.f:(.text+0x8e9b):
>>>>>>>>> more undefined references to `_gfortran_transfer_integer_write'
>>>>>>>>> follow
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(ma27ad.o):
>>>>>>>>> In function `ma27cd_':
>>>>>>>>> ma27ad.f:(.text+0x931e): undefined reference to
>>>>>>>>> `_gfortran_transfer_real_write'
>>>>>>>>> ma27ad.f:(.text+0x940d): undefined reference to
>>>>>>>>> `_gfortran_transfer_real_write'
>>>>>>>>> ma27ad.f:(.text+0x9626): undefined reference to
>>>>>>>>> `_gfortran_transfer_real_write'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinhsl.a(mc19ad.o):
>>>>>>>>> In function `mc19ad_':
>>>>>>>>> mc19ad.f:(.text+0x2c0): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> mc19ad.f:(.text+0x2da): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> mc19ad.f:(.text+0x2f4): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> mc19ad.f:(.text+0xf87): undefined reference to
>>>>>>>>> `_gfortran_transfer_integer_write'
>>>>>>>>> collect2: ld returned 1 exit status
>>>>>>>>>
>>>>>>>>>        mex: link of ' "ipopt.mexa64"' failed.
>>>>>>>>>
>>>>>>>>> make: *** [ipopt.mexa64] Fehler 1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2012/7/7 Tony Kelman <kelman at berkeley.edu>:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Paul,
>>>>>>>>>>
>>>>>>>>>> It looks like the Mathworks recommended compiler for R2011b is
>>>>>>>>>> GCC/gfortran
>>>>>>>>>> 4.3, see
>>>>>>>>>> http://www.mathworks.com/support/compilers/R2011b/glnxa64.html.
>>>>>>>>>> Successful compilation of the mex file and a working Matlab
>>>>>>>>>> interface
>>>>>>>>>> are
>>>>>>>>>> a
>>>>>>>>>> bit different, unfortunately.
>>>>>>>>>>
>>>>>>>>>> I've noticed this issue with Matlab, it loads its own set of .so
>>>>>>>>>> libraries
>>>>>>>>>> which are not always compatible with what you compiled Ipopt
>>>>>>>>>> against.
>>>>>>>>>> Particularly since you used F77=/usr/bin/gfortran-4.6 to compile
>>>>>>>>>> Ipopt
>>>>>>>>>> (and
>>>>>>>>>> the ThirdParty sources like Lapack). Before you go to the trouble
>>>>>>>>>> of
>>>>>>>>>> switching to GCC/gfortran 4.3 though, will you be needing a shared
>>>>>>>>>> Ipopt
>>>>>>>>>> library file, or do you just want to use the Matlab interface? If
>>>>>>>>>> the
>>>>>>>>>> latter, I recommend you compile Ipopt with static libraries by
>>>>>>>>>> adding
>>>>>>>>>> --disable-shared to the configure command.
>>>>>>>>>>
>>>>>>>>>> Since you are using the coinlapack and coinblas reference
>>>>>>>>>> implementations,
>>>>>>>>>> static libraries should also work around the namespace collisions
>>>>>>>>>> (http://list.coin-or.org/pipermail/ipopt/2011-March/002376.html)
>>>>>>>>>> and
>>>>>>>>>> incompatible 32/64 bit integer API problem that will affect every
>>>>>>>>>> linear
>>>>>>>>>> solver that uses BLAS (all but MA27). If you need to use a
>>>>>>>>>> shared-library
>>>>>>>>>> BLAS, it is possible to force Matlab to use your BLAS library
>>>>>>>>>> instead
>>>>>>>>>> of
>>>>>>>>>> its
>>>>>>>>>> own by using the BLAS_VERSION environment variable, as formerly
>>>>>>>>>> documented
>>>>>>>>>> here:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> http://web.archive.org/web/20090615072921/http://www.mathworks.com/support/solutions/en/data/1-18QUC/
>>>>>>>>>>
>>>>>>>>>> Matlab also has its own MA57 library with an incompatible API to
>>>>>>>>>> the
>>>>>>>>>> version
>>>>>>>>>> Ipopt uses, but the problem can be avoided by compiling libcoinhsl
>>>>>>>>>> as
>>>>>>>>>> a
>>>>>>>>>> static library. If you require libcoinhsl to be a shared library
>>>>>>>>>> you
>>>>>>>>>> can
>>>>>>>>>> force Matlab to load libcoinhsl.so before loading its own
>>>>>>>>>> libmwma57.so
>>>>>>>>>> by
>>>>>>>>>> using the LD_PRELOAD environment variable, but then the Matlab
>>>>>>>>>> command
>>>>>>>>>> ldl
>>>>>>>>>> will not function properly on sparse matrices.
>>>>>>>>>>
>>>>>>>>>> -Tony
>>>>>>>>>>
>>>>>>>>>> -----Original Message----- Date: Fri, 6 Jul 2012 13:19:13 +0200
>>>>>>>>>> From: Paul van Hoven <paul.van.hoven at googlemail.com>
>>>>>>>>>> To: ipopt mailing list <ipopt at list.coin-or.org>
>>>>>>>>>> Subject: [Ipopt] Problem running Ipopt matlab interface
>>>>>>>>>> Message-ID:
>>>>>>>>>>
>>>>>>>>>> <CANqzD4P00-EO9_aQ=8v9-QjGJDzU2cW+VooNc9ikoKTvEa8vLg at mail.gmail.com>
>>>>>>>>>> Content-Type: text/plain; charset=ISO-8859-1
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Hi, I just successfully compiled and installed ipopt on a linux
>>>>>>>>>> machine. Now I'd like to use the matlab interface. Actually
>>>>>>>>>> everything
>>>>>>>>>> works fine, the interface compiles fine without any errors or
>>>>>>>>>> warnings, the compiler version GCC 4.2 works also fine with matlab
>>>>>>>>>> so
>>>>>>>>>> there is no warning as well, and the interface is correctly
>>>>>>>>>> installed.
>>>>>>>>>> But when I try to run a simple matlab demo app I get the following
>>>>>>>>>> error:
>>>>>>>>>>
>>>>>>>>>>>> IpoptDemo.clusterRunme
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------
>>>>>>>>>> Invalid MEX-file
>>>>>>>>>> '/homes/numerik/paul/lib/Ipopt/MatlabInterface/ipopt.mexa64':
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> /net/matlab/Matlab2011b/bin/glnxa64/../../sys/os/glnxa64/libgfortran.so.3:
>>>>>>>>>> version `GFORTRAN_1.4' not
>>>>>>>>>> found (required by
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> /homes/numerik/paul/lib/Ipopt/lib64/coin/ThirdParty/libcoinlapack.so.1)
>>>>>>>>>>
>>>>>>>>>> Error in IpoptDemo.runme (line 45)
>>>>>>>>>>                [x info] = ipopt(x0,funcs,options);
>>>>>>>>>>
>>>>>>>>>> Error in IpoptDemo.clusterRunme (line 9)
>>>>>>>>>>                IpoptDemo.runme;
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I'm not shure if it helps but these are the first lines of the
>>>>>>>>>> makefile for the matlab interface:
>>>>>>>>>>
>>>>>>>>>> MATLAB_HOME =/net/matlab/Matlab2011b
>>>>>>>>>> MEXSUFFIX   =mexa64
>>>>>>>>>> PATH_TO_IPOPT_COMPILATION= /homes/numerik/paul/lib/Ipopt
>>>>>>>>>> SRCDIR =
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> /homes/numerik/paul/lib_src/CoinIpopt/Ipopt/contrib/MatlabInterface/src
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ###############################################################################################
>>>>>>>>>> DESTINATION_DIR = $(PATH_TO_IPOPT_COMPILATION)/MatlabInterface
>>>>>>>>>> MEX = $(MATLAB_HOME)/bin/mex
>>>>>>>>>> #Pay attention to add a by your matlab version supported g++
>>>>>>>>>> CXX         = /usr/site-local/bin/g++-4.2
>>>>>>>>>> CXXFLAGS    = -fPIC -DMX_COMPAT_32 -DMATLAB_MEX_FILE
>>>>>>>>>> -DMWINDEXISINT
>>>>>>>>>>
>>>>>>>>>> INCLUDES        = -I$(PATH_TO_IPOPT_COMPILATION)/include/coin
>>>>>>>>>> -I$(MATLAB_HOME)/extern/include
>>>>>>>>>>
>>>>>>>>>> MEXFLAGS    = -cxx CC='$(CXX)' CXX='$(CXX)' LD='$(CXX)' -lm
>>>>>>>>>> -L$(PATH_TO_IPOPT_COMPILATION)/lib64/coin -lipopt \
>>>>>>>>>>
>>>>>>>>>> -L$(PATH_TO_IPOPT_COMPILATION)/lib64/coin/ThirdParty -lcoinlapack
>>>>>>>>>> -lcoinblas -lcoinhsl -lamplsolver \
>>>>>>>>>>
>>>>>>>>>> -L/usr/site-local/lib/gcc/x86_64-unknown-linux-gnu/4.2.4
>>>>>>>>>> -lgfortran
>>>>>>>>>> -ldl -largeArrayDims
>>>>>>>>>> #Dynamic linking
>>>>>>>>>> #MEXFLAGS    = -cxx CC='$(CXX)' CXX='$(CXX)' LD='$(CXX)' -lm
>>>>>>>>>> -L$(PATH_TO_IPOPT_COMPILATION)/lib64/coin -lipopt -largeArrayDims
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> And this was the configure call for configuring ipopt:
>>>>>>>>>> ../configure --prefix=/homes/numerik/paul/lib/Ipopt \
>>>>>>>>>> CXX=/usr/site-local/bin/g++-4.2 \
>>>>>>>>>> CC=/usr/site-local/bin/gcc-4.2 \
>>>>>>>>>> F77=/usr/bin/gfortran-4.6 \
>>>>>>>>>> ADD_CXXFLAGS="-fPIC -fexceptions -DFUNNY_LAPACK_FINT" \
>>>>>>>>>> ADD_CFLAGS="-fPIC -fexceptions" \
>>>>>>>>>> ADD_FFLAGS="-fPIC -fexceptions" \
>>>>>>>>>> --with-matlab-home=/net/matlab/Matlab2011b
>>>>>>>>>>
>>>>>>>>>> This is what I did so far:
>>>>>>>>>> 1. I checked that a file called "libgfortran.so.3" is in the
>>>>>>>>>> directory
>>>>>>>>>> "/net/matlab/Matlab2011b/bin/glnxa64/../../sys/os/glnxa64"
>>>>>>>>>> 2. I added the path to the LD_LIBRARY_PATH which had no effect
>>>>>>>>>> 3. I added an environment path in matlab itself by
>>>>>>>>>>
>>>>>>>>>> addpath('/net/matlab/Matlab2011b/bin/glnxa64/../../sys/os/glnxa64')
>>>>>>>>>> which also had no effect.
>>>>>>>>>> 4. A simple ipopt demo app written in c++ works fine. So I checked
>>>>>>>>>> that the installed ipopt version works.
>>>>>>>>>>
>>>>>>>>>> Any suggestions how I could repair this problem?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Ipopt mailing list
>>>>>>>>>> Ipopt at list.coin-or.org
>>>>>>>>>> http://list.coin-or.org/mailman/listinfo/ipopt
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> End of Ipopt Digest, Vol 91, Issue 4
>>>>>>>>>> ************************************
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Ipopt mailing list
>>>>>>>> Ipopt at list.coin-or.org
>>>>>>>> http://list.coin-or.org/mailman/listinfo/ipopt
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>



More information about the Ipopt mailing list