BlackHolePerturbationToolkit / FastEMRIWaveforms

Blazingly fast EMRI waveforms
GNU General Public License v3.0
38 stars 26 forks source link

M1 installation not working #95

Open lorenzsp opened 2 months ago

lorenzsp commented 2 months ago

I am running into problems when installing on an M1. The old installation method described below works only when running the final command python setup.py install --ccbin /usr/bin/ two times. The first time I run the command, I get a cython error. If I run the command again, it works.

Old installation:

0) Install Anaconda if you do not have it. 1) Create a virtual environment. Note: There is no available conda compiler for Windows. If you want to install for Windows, you will probably need to add libraries and include paths to the setup.py file. If on linux:

conda create -n few_env -c conda-forge gcc_linux-64 gxx_linux-64 wget gsl lapack=3.6.1 hdf5 numpy Cython scipy tqdm jupyter ipython h5py requests matplotlib python=3.7
conda activate few_env

If on MACOSX, substitute gcc_linux-64 and gxx_linus-64 with clang_osx-64 and clangxx_osx-64 as follows:

conda create -n few_env -c conda-forge clangxx_osx-64 clang_osx-64 wget gsl lapack=3.6.1 hdf5 numpy Cython scipy tqdm jupyter ipython h5py requests matplotlib python=3.7
conda activate few_env

If on M1 chip use the following command:

conda create -n few_env -c conda-forge wget gsl hdf5 numpy Cython scipy tqdm jupyter ipython h5py requests matplotlib python=3.9 openblas lapack liblapacke
conda activate few_env

2) Clone the repository.

git clone https://github.com/BlackHolePerturbationToolkit/FastEMRIWaveforms.git
cd FastEMRIWaveforms

3) If on MACOSX or linux run install:

python setup.py install

If on M1 chip use the following command:

python setup.py install --ccbin /usr/bin/
Philip-Lynch commented 2 months ago

I am currently facing the same problem (M1 chip trying to install FEW 1.5.5 master branch). However, now when I try installing following this path (or any of the others), I get the following error:

src/inspiralwrap.cpp:5181:20: error: no member named 'dealloc' in 'ODECarrier' __pyx_v_self->g->dealloc();

Running the command twice doesn't fix it.

lorenzsp commented 1 month ago

I found a temporary solution to install FEW on M1-2 chips.

git clone https://github.com/BlackHolePerturbationToolkit/FastEMRIWaveforms.git
cd FastEMRIWaveforms
git checkout e4038da
conda create -n few_env -c conda-forge wget gsl hdf5 numpy Cython scipy tqdm jupyter ipython h5py requests matplotlib python=3.9 openblas lapack liblapacke\nconda activate few_env
conda activate few_env   
python setup.py install --ccbin /usr/bin/
python -m unittest discover

This should solve the installation temporarily and solve issues #96 #93 . Let me know if it works!

SSL32081 commented 3 weeks ago

I found a temporary solution to install FEW on M1-2 chips.

git clone https://github.com/BlackHolePerturbationToolkit/FastEMRIWaveforms.git
cd FastEMRIWaveforms
git checkout e4038da
conda create -n few_env -c conda-forge wget gsl hdf5 numpy Cython scipy tqdm jupyter ipython h5py requests matplotlib python=3.9 openblas lapack liblapacke\nconda activate few_env
conda activate few_env   
python setup.py install --ccbin /usr/bin/
python -m unittest discover

This should solve the installation temporarily and solve issues #96 #93 . Let me know if it works!

For me, I changed python setup.py install --ccbin /usr/bin/ to python -m pip install . then it worked. otherwise, it has this error when testing:

ImportError: dlopen(/Path/to/conda/envs/emri_env/lib/python3.9/site-packages/few-1.5.4-py3.9-macosx-11.0-arm64.egg/pyUtility.cpython-39-darwin.so, 0x0002): tried: '/Path/to/conda/envs/emri_env/lib/python3.9/site-packages/few-1.5.4-py3.9-macosx-11.0-arm64.egg/pyUtility.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Path/to/conda/envs/emri_env/lib/python3.9/site-packages/few-1.5.4-py3.9-macosx-11.0-arm64.egg/pyUtility.cpython-39-darwin.so' (no such file), '/Path/to/conda/miniconda3/envs/emri_env/lib/python3.9/site-packages/few-1.5.4-py3.9-macosx-11.0-arm64.egg/pyUtility.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

(I am on an M1 Mac)