danielepanozzo / gp

MIT License
64 stars 38 forks source link

How to install libigl on mac m1? #6

Open TongYiyi11 opened 2 years ago

TongYiyi11 commented 2 years ago

Hi Professor,

I have a problem installing the igl library on my mac m1. The conda install does not work and I tried to compile the bindings from scratch but there are still errors. I found similar issue in https://github.com/libigl/libigl/issues/1686 and someone metioned using header only mode but I am still confused about how to do it.

Is there any way to solve the problem in detail?

danielepanozzo commented 2 years ago

I need to look into this, I will get back to you in a few days.

danielepanozzo commented 2 years ago

This is the PR that will add support for the libigl conda package to M1 ARM, it will be merged as soon as it passes the builds: https://github.com/conda-forge/igl-feedstock/pull/27

danielepanozzo commented 2 years ago

As none of the python igl developers as direct access to an M1 mac, this is taking longer than expected to fix with a native build.

As a temporary workaround, could you try the following and let me know if it works: https://conda-forge.org/docs/user/tipsandtricks.html . The slowdown due to rosetta emulation will not be an issue for the assigments.

These are commands to set up an intel conda installation.

CONDA_SUBDIR=osx-64 conda create -n your_environment_name python # Create a new environment called your_environment_name with intel packages. conda activate your_environment_name conda env config vars set CONDA_SUBDIR=osx-64 # Make sure that conda commands in this environment use intel packages. conda deactivate conda activate your_environment_name

TongYiyi11 commented 2 years ago

Thank you professor. I successfully install the libgl package following the commands. And I am still wondering if it only affects the speed performance in this way.

danielepanozzo commented 2 years ago

Great to hear. Yes I think this should only affect performances, but I doubt it will be noticeable. I will post here as soon as the native M1 version will be available on conda.

Adora2401 commented 2 years ago

If anyone has the similar problem, pls first check your python version. I have done all of these then found igl only supports python version<=3.9, so have to do all the mess again.