Replies: 1 comment
-
We went through this in #722 already. There is no Just because you link Ipopt to mwma57, it won't know that MA57 is available. When compiling the Ipopt source, it needs to be known that one will link against an HSL library. For this purpose, there are the However, there is always the problem that Ipopt assumes 32bit integers, while Matlab, including its HSL library, uses 64bit integers. For that reason, you can define |
Beta Was this translation helpful? Give feedback.
-
Dear All,
I continue to grapple with the ability to successfully compile an IPOPT Mex file for Mac (Intel or Apple Silicon) using the built-in MATLAB MA57 library. I have tried so many things and nothing seems to work. Let me see if I can explain from the top.
First, I used a script written by Josh Harris (thank you Josh) to compile IPOPT by downloading all of the necessary components and then completing the compilation. The script is attached to this message. Here is the configure line in that script (which I modified to include "--enable-matlab-ma57" and "--without-hsl":
Thus, while I believe that the MATLAB MA57 library is being enabled when compiling IPOPT, I am not sure if what I suggest is actually true.
Next, after compiling IPOPT, I have added the following compiler flags in the script CompileIpoptMexLib.m supplied by Enrico Bertolazzi (thank you, Enrico):
-L/usr/local/lib -L/Applications/MATLAB_R2024a.app/bin/maca64 -lmwma57
Thus, again, I am asking the compiler to include the MATLAB directory that contains the library libmwma57.dylib. Interestingly, I do to get an error when running CompileIpoptMexLib.m, which leads me to think that the MATLAB MA57 library is being found during the running of CompileIpoptMexlib.m.
Finally, after all is said and done the Mex file is compiled. When I attempt to run the Mex file, however, I receive the following error:
Exception of type: DYNAMIC_LIBRARY_FAILURE in file "/Users/anilvrao/Documents/MATLAB/harrisIpopt/Ipopt/src/Common/IpLibraryLoader.cpp" at line 86:
Exception message: dlopen(libhsl.dylib, 0x0002): tried: 'libhsl.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibhsl.dylib' (no such file), '/opt/homebrew/opt/libomp/lib/libhsl.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libomp/lib/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/./libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../sys/os/maca64/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../runtime/maca64/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../sys/java/jre/maca64/jre/lib/server/libhsl.dylib' (no such file), '/Applications/MATLAB_R2024a.app/bin/maca64/../../sys/java/jre/maca64/jre/lib/libhsl.dylib' (no such file), '/usr/lib/libhsl.dylib' (no such file, not in dyld cache), 'libhsl.dylib' (no such file)
Of course, I am wondering why the Mex file is looking for the library "libhsl.dylib" when I have specifically asked to enable the MATLAB MA57 library and have included all of the necessary paths during compilation.
I am not sure what is going on. Please see the shell script attached, and please rename it compile_ipopt.sh before trying to use it to perform the compilation.
Thanks!
-- Anil
compile_ipopt.txt
Beta Was this translation helpful? Give feedback.
All reactions