-
I'm trying to collect performance data of openEMS on various CPUs, including Apple M1. Unfortunately, building openEMS on macOS is much harder than I expected, unlike what's suggested by the current documentation, and I hit several roadblocks. The official documentation says to run,
However, this has several problems:
I consider myself an experienced Linux/Unix sysadmin but I'm not familiar with macOS's development environment. If you have experience on using openEMS on macOS, please take a look at this (Update: after a few days of experimentation, including fixing several bugs, I've now gained a little bit of experience). |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
CC @aWZHY0yQH81uOYvH |
Beta Was this translation helpful? Give feedback.
-
I have to inject openEMS inside Python (Django) and run this using docker. It's much more easier and flexible to run openEMS in the docker. So for now you could try that |
Beta Was this translation helpful? Give feedback.
-
I was finally able to run openEMS on macOS in a fully portable manner, including Python and GCC. My solution was Gentoo Prefix. Gentoo Prefix works by installing the entire Gentoo userland into an unprivileged directory, similar to how a user can install software under /home. This way, one can use pre-existing Gentoo packages and toolchains on a foreign Unix system without changing the base system. I only managed to do this after fixing multiple portability bugs in the toolchains and system libraries, since Apple Silicon was a previously untested target for Gentoo... As a 10-year Gentoo user, when you have a hammer, everything looks like a nail... But now it works. I should be able to publish some performance data about openEMS on Apple Silicon soon. |
Beta Was this translation helpful? Give feedback.
-
Upon further inspection, this is in fact Bug thliebig/openEMS#113. I've submitted a patch (thliebig/openEMS#114) for solving this problem. |
Beta Was this translation helpful? Give feedback.
-
I just diagnosed this problem. Right now, fparser's CMake script doesn't set its "install name" as a full install path on macOS, unlike other libraries in openEMS (which all did this correctly):
This is why only libfparser cannot be found, but other shared libraries can. After CSXCAD and openEMS are built, this incomplete install name will propagate upwards, so all binaries will have a wrong search path. The solution is adding two lines of code in
After this change, the "install name" of fparser is now corrected:
I'm now working on a Pull Request. Update: problem reported and pull request submitted. |
Beta Was this translation helpful? Give feedback.
-
In case anyone's wondering, the updated macOS installation instructions have already been included in the online documentation.
The only thing that hasn't been covered is building openEMS with GCC instead of clang on macOS. But if you're doing this, you probably don't need further guidance (due to potential LLVM/GCC conflict, I recommend using nixOS or Gentoo Prefix to start with an all-GNU toolchain). If I recall correctly, GCC and clang builds for ARM64 macOS have similar performance, so there's no need to build openEMS with GCC. |
Beta Was this translation helpful? Give feedback.
In case anyone's wondering, the updated macOS installation instructions have already been included in the online documentation.
Homebrew installation (with Python)
https://docs.openems.de/install/package.html#macos
Source installation
https://docs.openems.de/install/requirements.html#macos
https://docs.openems.de/install/manual.html
The only thing that hasn't been covered is building openEMS with GCC instead of clang on macOS. But if you're doing this, you probably don't need further guidance (due to potential LLVM/GCC conflict, I recommend using nixOS or Gentoo Prefix to start with an all-GNU toolchain). If I recall correctly, GCC and clang builds for ARM64 macOS have similar perfo…