Linking libraries while making mex file
Rishi Amrit
rishiamrit at gmail.com
Mon Jan 12 07:24:03 CST 2009
Hi,
I am trying compile the mex interface of ipopt (
https://projects.coin-or.org/Ipopt/wiki/MatlabInterface) to use it with
octave. Since the mex interface is written to work with Matlab, I had to
change the Makefile. After making some sensible changes in the Makefile of
the package, I was able to compile the mex file for octave, and it runs
almost perfect. After the file ipopt.mex is made, I call it from octave. It
gave me the following error:
error: libipopt.so.0: cannot open shared object file: No such file or
directory
error: failed to install .mex file function `ipopt'
Now libipopt.so.0 is present in the library path of the package (
'/opt/CoinIpopt/install/lib' in my case)
The command I used to make the mex file was:
mkoctfile --mex -L/opt/CoinIpopt/install/lib ipopt.o
My understanding was that the library path was already linked as I specified
the path in the mkoctfile command. I even tried using addpath to include the
location of the library file, but that makes no difference.
Finally the workaround that works is I set the environment variable
LD_LIBRARY_PATH to /opt/CoinIpopt/install/lib and then ipopt works perfect.
The mex file runs great.
Any ideas on what flags should I use in mkoctfile so that I dont have to set
the LD_LIBRARY_PATH variable (which I dont, when I compile the mex interface
with MATLAB).
Thanks,
Rishi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090112/cf4262e5/attachment.html
More information about the Help-octave
mailing list