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)
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).