Casadi for M1 Macs (Apple silicon)

1,281 views
Skip to first unread message

Håkon Haugann

unread,
Oct 5, 2021, 8:30:48 AM10/5/21
to CasADi
Hi,

I'm having trouble installing Casadi for Python on my new Mac running macOS 11.4 on an Apple M1 chip. I suppose this new chip architecture is causing the issues.

Has anyone had success with the installation on a similar setup? 

Håkon Haugann

unread,
Oct 11, 2021, 8:09:27 AM10/11/21
to CasADi
I got it working eventually by building from source.

cd casadi
git checkout 3.5.5
mkdir build 
cd build 
cmake -DWITH_PYTHON=ON -DWITH_PYTHON3=ON .. 
make 
sudo make install

I had to make sure it built using a locally installed Python version and not one from a Conda environment. 
Message has been deleted
Message has been deleted

Jatin Kumar

unread,
Oct 12, 2021, 3:24:47 AM10/12/21
to CasADi
Hi!
Thanks for the guide. I work exclusively in a conda environment. Do you think there's a way to install it there?

Jatin Kumar

unread,
Oct 12, 2021, 4:15:39 AM10/12/21
to CasADi
Also, I tried doing what is written above with a lot of errors I don't understand with CMake. Seems like unchartered territory for me.

Joel Andersson

unread,
Oct 19, 2021, 8:16:58 PM10/19/21
to CasADi
Installing from sources, especially if you don't have to build the MATLAB/Octave front-ends and many of the interfaces is usually pretty straightforward.
I usually build CasADi on Mac (11.6) using Clang from Xcode command line tools and Homebrew. 

These instructions are a bit outdated, unfortunately, but Homebrew still works fine: https://github.com/casadi/casadi/wiki/InstallationMac

Joel
Reply all
Reply to author
Forward
Message has been deleted
0 new messages