-
Notifications
You must be signed in to change notification settings - Fork 108
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
Problem Building pyOptSparse from Source on macOS (Apple Silicon) #335
Comments
@mcmehrtens If you are OK using conda, you should be able to install pyoptsparse from conda-forge directly. conda install -c conda-forge pyoptsparse conda-forge has pre-built packages for both osx64 and osx-arm64 platforms. Combining that with your own SNOPT module will take a little more doing, however. I just opened this #337 and #338 to help with that, but it's only half of the puzzle - you'll still need to build your own binding module. In case you're not aware, it's possible to use x64 conda installation on Mac ARM via Rosetta. If you do that, any |
Hi, thank you for your comments. I am having similar problems. |
Hello Nicolò, have you checked this section of the documentation for more details? I am not familiar with local SNOPT compilation, but you should have obtained a binding file that can be linked to pyOptSparse with the instructions in the link. |
Hi @pollinico - assuming you already have # run this in a directory which contains `libsnopt7.dylib`
# fetch pyoptsparse source so we have the f2py and .f files
git clone https://github.com/mdolab/pyoptsparse.git
# compile f2py module
# you must have python available with numpy installed and a fortran compiler available on path
SRC=pyoptsparse/pyoptsparse/pySNOPT
python -m numpy.f2py -m snopt -c ${SRC}/f2py/snopt.pyf ${SRC}/*.f -L${PREFIX}/lib -lsnopt7 This should produce Then you can follow the instructions in the docs, setting the environment variable:
|
Please forgive me, I'm new to pyOptSparse and optimization in general. I'm trying to configure a virtual python env (venv) capable of running a script that uses OpenMDAO and SNOPT. I am referring to these instructions.
I am working on a 2021 M1 Pro MacBook Pro (Apple Silicon; ARM64). I have confirmed I have
gcc
,gfortran
, andnumpy
installed (see below).Installation Verification
I have cloned the pyOptSparse repo onto my computer, navigated into the root folder of the repo, and executed
pip install -e .
. This is what it outputted:Build Output
I am concerned about this line from the installation instructions:
Is this my dead-end? I attempted to use Conda to perform the installation, but I ran into different build errors. I would appreciate any and all support on this issue :)
Edit:
Here is is the output from when I attempt to perform the build using the Conda source build instructions:
Conda Source Build
When reproducing my problem, I accidentally had both my Conda virtual environment and my normal venv activated at the same time, but regardless, it produced the same build error.
The text was updated successfully, but these errors were encountered: