Compiling SNOPT 7.7 on macOS with M1 chip

155 views
Skip to first unread message

Jared Thomas

unread,
Sep 16, 2022, 4:44:13 PM9/16/22
to SNOPT
Hello, 

I have been unsuccessful compiling SNOPT on macOS 12.5.1 with an M1 chip. I have compiled many times on macOS with intel chips, so I am confident that I have the general steps correct. From what I can tell the compilation seems to work fine, but when I try to run the code I get the following error stating that I have incompatible architecture:

`could not load library "/opt/anaconda3/envs/julia/share/julia/dev/Snopt/src/../deps/src/libsnopt"
  dlopen(/opt/anaconda3/envs/julia/share/julia/dev/Snopt/src/../deps/src/libsnopt.dylib, 0x0001): tried: '/opt/anaconda3/envs/julia/share/julia/dev/Snopt/src/../deps/src/libsnopt.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/opt/anaconda3/envs/julia/share/julia/dev/Snopt/deps/src/libsnopt.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))`

I am running with Rosetta and had hoped that would be enough, but apparently not.

Is there any way to compile and run SNOPT on an apple M1 chip?

Thanks for your help!

Jared

Jared Thomas

unread,
Sep 22, 2022, 10:08:02 AM9/22/22
to SNOPT

Thank you for your responses. I tried compiling within pyoptsparse in python and everything worked just fine. I was compiling through Julia before. It turns out that Julia appears to be running on x86_64 via rosetta and I think that may have led the compiler to compile for the same architecture. I’d still like to get this working via Julia, but that is not an SNOPT problem.

 

Thank you again for your help, and for SNOPT. Every time I go try other algorithms, I come back to SNOPT.

Nicolò Pollini

unread,
Dec 26, 2023, 7:37:34 AM12/26/23
to SNOPT
Could you please share the steps you followed to compile SNOPT with pyoptsparse?
That would help me a lot.
Thank you very much!

Nicolò Pollini

unread,
Dec 26, 2023, 9:55:37 AM12/26/23
to SNOPT
A small update:
I managed to install it in ubuntu 22.04 with pyoptsparse :-)
Just followed the instructions on the pyoptsparse documentation (I had to reinstall it though, I had an issue with importing SLSQP. But this issue was also discussed in the documentations...).
It works like a charm now!

Jared Thomas

unread,
Dec 27, 2023, 12:25:01 PM12/27/23
to Nicolò Pollini, SNOPT
Glad you got it working. Sounds like you did the same thing I did. 

Jared

--
You received this message because you are subscribed to a topic in the Google Groups "SNOPT" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/snopt/lHpLnBQTkL8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to snopt+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/snopt/526de7db-36b1-4c77-8e19-c6d1d3e7f4d5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages