Skip to content
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

M1 Apple Silicon support #199

Open
bibbygoodwin opened this issue Sep 19, 2022 · 5 comments
Open

M1 Apple Silicon support #199

bibbygoodwin opened this issue Sep 19, 2022 · 5 comments

Comments

@bibbygoodwin
Copy link

Are there plans to support Apple Silicon with pygalmesh? Currently, it appears to be unsupported by the pip/conda builds.

Thanks!

@nschloe
Copy link
Collaborator

nschloe commented Sep 19, 2022

Nope, not planned.

@gnikit
Copy link

gnikit commented Dec 3, 2022

@nschloe for pip cross-compiling is a pain^1, but for conda-forge it shouldn't be a problem. I couldn't spot any host or run time dependencies that are not already available and cross-platform in conda-forge. Any idea why conda-forge is not building for the rest of the architectures?


^1: FYI if you use GitHub Actions (or another CI) for your PyPi releases you then leverage scikit-build and CMake to build wheels cross-platform

@totomobile43
Copy link

totomobile43 commented Aug 28, 2023

I was able to compile this on an M1 mac. Haven't tested everything but re-meshing seems to work fine. Just pip install pygalmesh as usual and it will trigger the compile.

The 2 main steps to get this working were:

  • There are some missing includes, and cgal is trying to find them in /usr/include. If you use brew, it puts them in /opt/homebrew/include. I just copied the relevant folders from this brew location to /usr/include, which are: boost, CGAL and Eigen. Keep in mind not to copy eigen3 as the folder, but the inner folders containing the header files.
  • There was a library linking problem with lgmp, for this I added the following to my .zshsrc file: export LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/lib". If you use bash, then adjust accordingly.

I tried symlinking and adding to the INCLUDE_PATH in my zshsrc file to solve the first point, but it didn't work out. Maybe someone else can figure this part out. Hopefully this helps someone else out.

@WPCJATH
Copy link

WPCJATH commented Sep 25, 2023

I was able to compile this on an M1 mac. Haven't tested everything but re-meshing seems to work fine. Just pip install pygalmesh as usual and it will trigger the compile.

The 2 main steps to get this working were:

  • There are some missing includes, and cgal is trying to find them in /usr/include. If you use brew, it puts them in /opt/homebrew/include. I just copied the relevant folders from this brew location to /usr/include, which are: boost, CGAL and Eigen. Keep in mind not to copy eigen3 as the folder, but the inner folders containing the header files.
  • There was a library linking problem with lgmp, for this I added the following to my .zshsrc file: export LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/lib". If you use bash, then adjust accordingly.

I tried symlinking and adding to the INCLUDE_PATH in my zshsrc file to solve the first point, but it didn't work out. Maybe someone else can figure this part out. Hopefully this helps someone else out.

Thanks for the solution, these steps are really useful.

And since now is 2023, there are version problems, i.e., pygalmesh doesn't install with the newest version of CGAL. It reports things like: src/generate.cpp:170:13: error: call to 'odt' is ambiguous

The solution is that install a previous version of CGAL via brew which you can refer to https://nelson.cloud/how-to-install-older-versions-of-homebrew-packages/

I installed CGAL 5.3.1 and then successfully installed pygalmesh.

@sporring
Copy link

I had the same problem. To follow up on totomobile43, clang uses CPLUS_INCLUDE_PATH,

export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/homebrew/include:/opt/homebrew/include/eigen3"

with CGAL-5.5.2, pygalmesh compiles for me and seems to be working. Thanks all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants