Building & running xgems on an arm mac #66
-
|
When xgems was released, i attemped to install it using Channels:
- defaults
- conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- xgemsI quickly realized that this happens because the package is not currently distributed for arm architecture (same for gems3k). While i found a workaround by installing it on a remote linux machine and accessing that through ssh, it was not ideal. I did try to make a x64 conda env, but that lead to python crashing when i ran anything involving xgems. However, i found out that there is actually an easy way to build the library yourself in arm architecture, and so far it works perfectly! Three steps are needed:
for the conda enviroment, heres the full list of dependencies (replace in dependencies:
- gxx_linux-64 # [linux]
- cmake>=3.13
- make
- git
- clcache # [win]
- ccache # [unix]
- pybind11
- pytest
- numpy
- python={{ python_version }}
- pytest
- eigen >=3.4.0
- spdlog >=1.10.0
# - gems3k =>4.3.5
- pip
- ninja
- nlohmann_json
- thermofun >=0.4.3the resulting dynamic library is compiled for arm64: /opt/miniconda3/envs/xgems-build/lib/libxGEMS.dylib: Mach-O 64-bit dynamically linked shared library arm64Im not sure how conda package distribution works, but since nothing about xgems or gems3k needed to change for this to work, would it be possible to distribute both packages for arm architecture aswell? I am happy to test it out! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
good idea, we will check this out, here from what I see it won't be difficult to add the arm option when distributing the conda packages. Until then I leave your workflow as answer on how to build for arm:
|
Beta Was this translation helpful? Give feedback.
-
|
@j-engelmann please test. xgems v2.0.2 should be working on arm64. |
Beta Was this translation helpful? Give feedback.
good idea, we will check this out, here from what I see it won't be difficult to add the arm option when distributing the conda packages. Until then I leave your workflow as answer on how to build for arm: