-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
native Apple Silicon version #24
Comments
Sorry, I do not have an ARM, however on sept. I will ask a friend to give me an ARM to try a compilation and see where the problems are. |
I'm happy to give it a try on my new M2 MacBook Pro if you are able to help walk me through it. |
Any update on this? I'm very eager to get this working. Let me know if I can help test or anything. |
I got it working!
|
Did I do something wrong? I get the following error: Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to Error in ipopt (line 264) Error in examplehs038 (line 57) |
Here is what I get when I build the Mex file after installing the patch you provided: mex -largeArrayDims -Isrc ./src/ipopt.cc ./src/IpoptInterfaceCommon.cc -Isrc_ipopt_osx/coin-or -DOS_MAC -output bin/osx/ipopt_osx -L/opt/homebrew/lib -lipopt /opt/homebrew/lib/gcc/current/libquadmath.dylibLDFLAGS='$LDFLAGS -Wl,-rpath,. -framework Accelerate -ldl' CXXFLAGS='$CXXFLAGS -Wall -O2 -g' ld: warning: -undefined error is deprecated MEX completed successfully. |
Did you complete your build with clang and clang++ or with gcc and g++? |
Can you send me your Mex file? |
I think the issue here is that you have ebertolazzi's |
Not actually sure what it uses. I just built it with that patched M-file and it worked for me. |
I do not have the ipopt.m file used by ebertolazzi in my path. I have only the Mex file in my MATLAB path. I am not sure if I need to reinstall homebrew from scratch. |
If you type |
It returns the location of the Mex file that I compiled using your instructions.
——
Anil V. Rao, PhD
E-mail: ***@***.***
Tel: 352-672-1529
Web: http://anilvrao.com
…On Nov 16, 2023 at 9:03 PM -0500, Ray Zimmerman ***@***.***>, wrote:
If you type which ipopt what does it return?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Ah ... it looks like the |
I tried both examplehs038 and examplehs071. Neither one works and they give the error I posted in my earlier comment.
——
Anil V. Rao, PhD
E-mail: ***@***.***
Tel: 352-672-1529
Web: http://anilvrao.com
…On Nov 16, 2023 at 9:32 PM -0500, Ray Zimmerman ***@***.***>, wrote:
Ah ... it looks like the examplehs038.m file temporarily adds the ipopt.m to the path. Try one of the other examples.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Comment out the |
I read the various discussions. Read README-OSX.md to setup an up-and-running IPOPT on OSX (Linux and windows for the moment I have not changed). For MA57 there is no way to use MATLAB internal lib. To use libhsl.dylib it is necessary the lilbrary is in the same directory as the running script or in a directory MATLAB is searching for dynamic library. For example |
Thanks @ebertolazzi. I gave it a try on my M2 Mac with the native Apple Silicon version of MATLAB and I'm afraid it didn't work. It compiled fine, but I get the following runtime error ...
FWIW, the
And that file does exist. Also, In case it's relevant, as you can see, I do have my MATLAB installed in a subdirectory of |
I commented out the addpath command in the examples and the Mex file works! I also tried it on several of the examples in our optimal control software GPOPS-II and it works great! Actually, I have never seen performance this fast with IPOPT. The improvement must be a combination of the Silicon version of MATLAB together with the Silicon processor itself! Quite remarkable how much faster GPOPS-II runs with this new Mex file! Thank you for your help! |
Using your same instructions above, I was not able to compile the Mex file for Apple Silicon on my M1 laptop. I am getting the following error when I run "CompileIpoptMexLib": Error using mex Error in CompileIpoptMexLib (line 128) I have so many C and C++ compilers installed on my computer, and they are the same ones that are installed on my Apple Studio. I am not sure why MATLAB does not find a supported compiler. I tried "mex -setup" and "mex -setup -v". When I run the latter I obtain the following output. Not sure what is going on. Output of "mex -setup -v": Verbose mode is on. |
I got that error too even though I had accepted the Xcode license, so I just commented out the lines in |
I followed the above instructions for compilation of the IPOPT Mex file on a new Apple Silicon M3 Max computer. I receive the following errors upon running CompileIpoptMexLib. Apparently the version of IPOPT is for Intel (X86_64) and not for Apple Silicon, but I ran "brew install ipopt" to install IPOPT. Any help is appreciated. Thanks! Error using mex Error in CompileIpoptMexLib (line 128) |
Is it possible you are pointing it to an old Homebrew install under |
I am now able to compile to get a Mex file, but I get the following error when I try to execute the Mex file. Looks like something is still looking for an Intel version. Thanks again for any help. Operands to the logical AND (&&) and OR (||) operators must be convertible to Error in ipopt (line 264) Error in examplehs038 (line 57) |
This looks like the same issue you had back in Nov. See my previous reply. |
Ok. I got everything working. Thanks for your help. I have another question. Which linear solver is better, MUMPS or MA57? I know from a few colleagues that the group in France has made some amazing improvements to MUMPS over the past few years. From what I understand, MUMPS now outperforms MA57, but I am not sure if my understanding is correct. Also, is the MUMPS library that is included with the mexIPOPT toolbox up to date, or should an updated version of this library be used when compiling the Mex file? In addition, is the MUMPS library dynamically loaded, or is it statically compiled for use with the Mex file? Finally, I know that Mathworks has included a dynamic MA57 library for years. I see, however, that for the Apple Silicon version of MATLAB, the library libmwma57.dylib is found in the directory /Applications/MATLAB_R2023a.app/bin/maci64 for MATLAB 2023a and in the directory /Applications/MATLAB_R2023b.app/bin/maca64 for MATLAB 2023b. Given the different locations of this library in the two different Apple Silicon versions of MATLAB, is this library compatible with the Apple Silicon processor, or is it an "Intel" version that was copied from the Intel version of MATLAB? I have tried linking to this MA57 library when compiling the Mex file but it does not work as I receive an error stating that the library cannot be loaded. Wondering if Mathworks forgot to update the MA57 library when creating the Apple Silicon version of MATLAB. Sorry for so many questions. Just trying to see what configuration will provide the best performance. |
Does anyone have any knowledge as to which linear solver is better when choosing between MUMPS and MA57? I have been told that MUMPS has been improved immensely over the past several years and now outperforms MA57, but I would like to know if anyone has any direct experience comparing the performance of these linear solvers. Another question. Does a publicly available (and freely distributable) version of MA57 exist? I ask because nobody seems to have been able to link IPOPT to the MATLAB MA57 dynamic library when compiling the IPOPT mex file. Thanks! |
I once managed to do that on Windows. I got inspired by a zip-package within the OPTI toolbox here: https://github.com/jonathancurrie/OPTI/blob/c9636bb2da69dc225d5791eac04fb36c7c0e71c8/Solvers/Source/opti/libmwma57.zip |
Hello @rdzman thanks for the steps above. I'm still having issues with the patch provided Any suggestions? The mac I'm working on is M1. I do have an M2 available to me as well. When I run the examples I comment out the addpath commands.
Error in ipopt (line 264) Error in examplehs038 (line 57) |
Sorry, @jadechantrell, just seeing this now. I'm pretty sure this error is because you have the |
I'd like to compile a version with a native Apple Silicon version of MATLAB.
I have successfully built Ipopt (using coinbrew) and an Octave MEX interface, but I am afraid I don't know how to get mexIPOPT to recognize the version of Ipopt I built from source when building for MATLAB.
Can you give me some pointers here? Or do you have a precompiled version for a native Apple Silicon version of MATLAB?
Thanks.
The text was updated successfully, but these errors were encountered: