[Ipopt] How to install Ipopt-3.9.1 interface with my Matlab R2010b on a Linux machine?

hongkai dai daih at csail.mit.edu
Thu Dec 9 22:13:02 EST 2010


I met problems in installing IPOPT-3.9.1 Matlab interface on my 64bit 
Linux machine. Here are the steps I used:

   1. The Matlab R2010b uses gcc-4.3, so I downloaded gcc-4.3, g++-4.3
      and gfortran-4.3.
   2. I revised the mexopts.sh file in my matlab bin subfolder, I set
      CC='gcc-4.3' CXX='g++-4.3' FC='gfortran-4.3' for the glnxa64
      section. I tried "Hello world" program and it works well.
   3. I configured IPOPT with following command:
      ../configure CXX=g++-4.3 CC=gcc-4.3 FC=gfortran-4.3
      ADDCXXFLAGS="-ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer
      -pthread" ADD_CFLAGS="-ansi -D_GNU_SOURCE  -fexceptions -fPIC
      -fno-omit-frame-pointer -pthread" ADD_FFLAGS="-fexceptions -fPIC
   4. In step 2 and 3, I also tried to configure it with g++, gcc-4.3
      and gfortran and the same flags.
   5. Then I typed "make", "make test" and "make install", they all work
   6. Finally I go to the subfolder
      /build/Ipopt/contrib/MatlabInterface/src, modified the Makefile by
      setting the matlab home and set MEXSUFFIX=mexa64

Then it reports error as following:
/usr/bin/ld: matlabexception.o: relocation R_X86_64_32 against 
`.rodata.str1.1' can not be used when making a shared object; recompile 
with -fPIC
matlabexception.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

     mex: link of ' "ipopt.mexa64"' failed.

make: *** [ipopt.mexa64] Error 1

Could you help me figure out what I did wrong in the installation process?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/ipopt/attachments/20101209/f9a7a972/attachment.html 

More information about the Ipopt mailing list