3dem / relion

Image-processing software for cryo-electron microscopy
https://relion.readthedocs.io/en/latest/
GNU General Public License v2.0
444 stars 197 forks source link

Installing Relion on Apple M2 Ultra #1120

Open mararango opened 4 months ago

mararango commented 4 months ago

Environment:

Hello, I am having issues installing RELION 5.0 on my Mac Apple M2 Ultra. I have installed Homebrew and have tried to install CUDA but on the NVDIA website it says that the NVDIA CUDA Toolkit 12.4 no longer supports development or running applications on macOs.

From a thread on Github I tried to install RELION using the following command

brew install brewsci/bio/relion

And I get the following error message

`Last 15 lines from /Users/starbirdlab/Library/Logs/Homebrew/relion/01.cmake: -- Setting accelerated code precision to single CUDA_TOOLKIT_ROOT_DIR not found or specified -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) -- Using non-cuda compilation.... -- Could NOT find MPI_C (missing: MPI_C_WORKS) -- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) CMake Error at /opt/homebrew/Cellar/cmake/3.29.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND) Call Stack (most recent call first): /opt/homebrew/Cellar/cmake/3.29.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/Cellar/cmake/3.29.2/share/cmake/Modules/FindMPI.cmake:1837 (find_package_handle_standard_args) CMakeLists.txt:213 (find_package)

-- Configuring incomplete, errors occurred!

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core): https://github.com/brewsci/homebrew-bio/issues

Error: A newer Command Line Tools release is available. Update them from Software Update in System Settings.

If that doesn't show you any updates, run: sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install

Alternatively, manually download them from: https://developer.apple.com/download/all/. You should download the Command Line Tools for Xcode 15.1.

` Now I tried another way to install RELION inlcuding the following code

brew install cmake brew install gcc brew install openmpi brew install fltk brew install fftw

export CXX=g++-11 export CC=gcc-11 export OMPI_CXX=g++-11 export OMPI_CC=gcc-11 export PATH="/usr/local/opt/openmpi/bin:${PATH}" export CXXFLAGS="-I/usr/local/opt/openmpi/include" export LDFLAGS="-L/usr/local/opt/openmpi/lib"

git clone https://github.com/3dem/relion.git cd relion git checkout ver5.0 mkdir -p build cd build cmake ..

After cmake command line I get the following error

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- BUILD TYPE set to the default type: 'Release' -- Setting fallback CUDA_ARCH=50 -- CUDA enabled - Building CUDA-accelerated version of RELION -- Setting cpu precision to double -- Setting accelerated code precision to single CMake Warning (dev) at CMakeLists.txt:192 (FIND_PACKAGE): Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake --help-policy CMP0146" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

CUDA_TOOLKIT_ROOT_DIR not found or specified -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) CMake Error at CMakeLists.txt:208 (message): CUDA enabled but unlable to locate packages...

-- Configuring incomplete, errors occurred!

Any guidance on how to resolve this issue will be greatly appreciated !!!!

biochem-fan commented 4 months ago

We do not officially support Mac OS. This should be eventually dealt with by brew package maintainers.

Try adding -DCUDA=OFF to cmake because you cannot use CUDA.

mararango commented 4 months ago

I was able to turn off CUDA but I run into the following problems with MPI

(base) starbirdlab@d6pf6n01 build % cmake .. \

-DMPI_C_COMPILER=/opt/homebrew/bin/mpicc \ -DMPI_CXX_COMPILER=/opt/homebrew/bin/mpicxx \ -DMPI_INCLUDE_PATH=/opt/homebrew/include/mpi.h \ -DMPI_LIBRARIES=/opt/homebrew/Cellar/open-mpi/5.0.3/lib/libmpi.dylib -- BUILD TYPE set to the default type: 'Release' -- Setting fallback CUDA_ARCH=50 -- Acceleration not enabled - Building CPU-only version of RELION -- Setting cpu precision to double -- Setting accelerated code precision to single -- Could NOT find MPI_C (missing: MPI_C_WORKS) -- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) CMake Error at /opt/homebrew/Cellar/cmake/3.29.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND) Call Stack (most recent call first): /opt/homebrew/Cellar/cmake/3.29.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/Cellar/cmake/3.29.3/share/cmake/Modules/FindMPI.cmake:1837 (find_package_handle_standard_args) CMakeLists.txt:338 (find_package)

-- Configuring incomplete, errors occurred!

Is there a way I could fix this error ?