DedalusProject / dedalus

A flexible framework for solving PDEs with modern spectral methods.
http://dedalus-project.org/
GNU General Public License v3.0
492 stars 115 forks source link

Update M1 Installation Instructions #223

Closed jayceslesar closed 2 years ago

jayceslesar commented 2 years ago

Hey all -- was not able to install with conda but was able to install in a venv super easily once I had done...

brew install fftw
# the below needed some sudo stuff...
brew install mpi4py
# no more sudo :)
brew install open-mpi
brew install hdf5-mpi
export FFTW_PATH=/opt/homebrew/Cellar/fftw/3.3.10_1
export MPI_PATH=/opt/homebrew/Cellar/mpi4py/3.1.3_1
export HDF5_DIR=/opt/homebrew/Cellar/hdf5-mpi/1.12.2_1/
export MPI_INCLUDE_PATH=/opt/homebrew/Cellar/open-mpi/4.1.4_1/include
git clone -b master https://github.com/DedalusProject/dedalus
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install --no-binary=h5py h5py
CC=mpicc pip3 install --no-cache dedalus/

Is currently failing a few tests locally but am able to install at least :)

kburns commented 2 years ago

Are the sparse eigenvalue problem solvers (e.g. the evp_1d_rayleigh_benard example) working with this build? That is the current blocking issue for supporting conda-based native installations on M1.

jayceslesar commented 2 years ago

Ill test that out later but seems to be failing on tests with an output of AttributeError: 'h5py.h5p.PropDXID' object has no attribute 'set_dxpl_mpio'

kburns commented 2 years ago

I think that indicates that HDF5 is not built against MPI. But in general, the conda installation routes seem to be working well for most users, so I think we would continue to recommend that route on macs. Do you recall what issue you came across in particular with the conda installation? We don't provide native-arm binaries on conda because of the issues with sparse eigenvalue problems, but the custom conda installation script has an option to override this.

jayceslesar commented 2 years ago

I was never able to solve the environment using conda even with the extra flags passed in

jayceslesar commented 2 years ago

Ok I just updated the instructions and everything actually builds for M1 with mpi correctly + hdf5 stuff...

jayceslesar commented 2 years ago

Looks like that worked fine?

output of python3 examples/evp_1d_rayleigh_benard/rayleigh_benard_evp.py

from inside of my venv

image
kburns commented 2 years ago

Ah great, it looks like with scipy 1.9.1, the sparse EVP errors on M1 are fixed, so I'll work on setting up native-arm conda builds.

But I think we will probably continue with just the conda builds and documentation, rather than adding and maintaining brew-based instructions. We've had a number of issues with brew-based installations over the years, and many people are now using the conda builds successfully on macs. The conda builds are also tested through CI nightly, and I'd be happy to help if you still have trouble with one of those installation routes.

I'll post back here when I have native-arm conda builds to test. Thanks!

jayceslesar commented 2 years ago

actually can close this, not sure what I did other than uninstall anaconda and then install miniconda, was able to solve the environment and it worked

and no big red F's or X's when running tests!