[Ipopt] Problem running Ipopt matlab interface

Stefan Vigerske stefan at math.hu-berlin.de
Fri Jul 6 12:49:09 EDT 2012


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

On 07/06/2012 01:19 PM, Paul van Hoven wrote:
> 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
>




More information about the Ipopt mailing list