Has anyone had success running the legacy FEniCS 2019.1.0 on Apple Silicon? This discussion seems to be about FEniCSx, but I still use the legacy FEniCS for a project that has not been (and would be quite hard to) update to FEniCSx.
If anyone knows that FEniCS 2019 cannot run on Apple Silicon or has other advice, that would be welcome.
There shouldnât be a problem. A coworker has built the old dolfin docker images on his M1 Mac so itâs definitely possible. Perhaps you could try the same.
Very glad to hear that itâs been done successfully. I donât have an Apple Silicon machine on which to test yet, but as my current ones age out, I am going to make the transition. If I couldnât run legacy dolfin, that would perhaps change my purchase plans.
Thanks!
I just bought a Mac Studio with M1 Max. I searched for fenics using conda but did not find any fenics from conda-forge. It is good to know that fenics 2019 works on M1 and can get a docker image from the web link. However, is it possible for an author of the web link to produce a version of fenics for conda-forge? Doing so will be highly appreciated by many fenics users like me.
Yes. I did exactly. But, Paulmsâ way may cause new problems. For example, I got an error of an incompatible architecture (have âarm64â, need 'x86_64â) when using f2py since gfortran was run on Apple Silicon (Paulms, can you have a way to fix this issue? This issue is common since f2py is often used). Hence, it is still important for someone to generate a binary of fenics 2019 for Apple Silicon.
Iâm afraid that I donât use f2py myself. The method above will certainly fail if the package tries to interface with external executables (not installed by conda itself) due to mixed architectures.
Running the following commands will create a conda environment named fenics2019 thatâs set to be an x64 environment permanently, so anything installed should be installed for x64.
Confirming, Paulms solutions is functional for me. I was suffering from âcatastrophic performance degradationâ using the usual fenics2019 docker container. I couldnât quite piece together how to build my own for that, but thankfully your conda solution works great. I really appreciate it.
I would love to just migrate to fenicsx, since it seems to have better apple silicon support, but Iâm bound to hippylib which depends on the 2019 version. I need to put in some time to try and implement the features I need from it in dolfinx.
Hi Paulms, thank you for the solution. I am trying to install Fenics 2019 on my Mac Pro with M1 chip and it keeps showing the package is not available from current channels as shown in the screenshot. Any idea about this issue?
I installed that specific version since, at that time, the latest build gave me problems with the âmshrâ package. Maybe that build has been replaced with more recent ones in the conda repository. You can omit the version (==2019.1âŚ), and try the latest builds. Perhaps it works now, or you can check the available versions at this link: Files :: Anaconda.org
OP here, and I thought I should chime in with a different solution that has been working for me, to get legacy fenics on apple silicon.
On my Mac, I use an Ubuntu docker container, which works fine, but there is an extra flag you need to set to make sure you build for arm64 rather than (the much slower) amd64 with Rosetta. You do not want to use an old pre-built Docker image, because that will be for amd64 and run slowly, but itâs not hard to build a new one.
Regardless of what Dockerfile you use, the key is to build using something like
The Dockerfile that I use for installing Simudo is here. It does a bunch of things that you wouldnât need, so you could easily delete lines 7, 10, 13, 14, 15 and many of the packages on lines 21-29, as you like. Legacy dolfin is on line 25. It also included a cautious non-pip installation of Simudo on lines 36-44 that you donât need, which verifies hashes of the files. You could likely also build off of one of the Dockerfiles here, as @nate suggested above.