The software of Scheres, Relion 3 (https://www3.mrc-lmb.cam.ac.uk/relion/index.php?title=Main_Page), we have it on our cluster and on the iMACs! For the iMacs, code can be found below, thanks to our scientific consultant and external collaborator, Koen M. Visscher:
First install the developer tools (http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/), xquartz (https://www.xquartz.org/) and brew (https://brew.sh/), and then you just copy/paste the following commands on the terminal, where you will be installing Relion 3:
###How we install Relion in the
###Kastritis Laboratory on our Macs
###Install the necessary dependencies
###for Relion 3.0 on your MacOS
brew install cmake
brew install gcc
brew install openmpi
brew install fltk
brew install fftw
###Set the correct compilers
export CXX=g++-9
export CC=gcc-9
export OMPI_CXX=g++-9
export OMPI_CC=gcc-9
export PATH="/usr/local/opt/openmpi/bin:${PATH}"
export CXXFLAGS="-I/usr/local/opt/openmpi/include"
export LDFLAGS="-L/usr/local/opt/openmpi/lib"
###Now download, compile and install relion
git clone https://github.com/3dem/relion.git
cd relion
git checkout 3.0.6
mkdir -p build
cd build
cmake ..
make -j 6
make install
Dear Dr. Kastritis
Everything works fine. But when I ran the “cmake ..” command, I encountered the following error, any idea?
##
CMake Error at /usr/local/Cellar/cmake/3.13.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.13.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.13.2/share/cmake/Modules/FindOpenMP.cmake:473 (find_package_handle_standard_args)
src/apps/CMakeLists.txt:219 (FIND_PACKAGE)
— Configuring incomplete, errors occurred!
##
Dear Yu Zhang,
This is a FLAG error, somehow the correct compilers are not been called. When you run this command:
pkastrit$ echo $CXX $CC $OMPI_CXX $OMPI_CC $CXXFLAGS $LDFLAGS
The output should be:
g++-9 gcc-9 g++-9 gcc-9 -I/usr/local/opt/openmpi/include -L/usr/local/opt/openmpi/lib
Do you get the same output?
Dear HangtianGuo,
See my comment above. When you do: echo $CXX $CC $OMPI_CXX $OMPI_CC $CXXFLAGS $LDFLAGS
What is the output?
cheers
Panos
Dear Ben, that’s perfect, if anyone encounters such errors please also make sure the make file has the correct paths
Cheers
Panos
Dear Prof Kastritis,
I’m new to CryoEM and trying to install Relion. Thank you for this helpful installation guide. I just encountered an error below. Any advice would be greatly appreciated.
CMake Error at /usr/local/Cellar/cmake/3.16.4/share/cmake/Modules/CMakeDetermineCCompiler.cmake:49 (message):
Could not find compiler set in environment variable CC:
ggc-9.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
— Configuring incomplete, errors occurred!
Best regards,
Yoshio
Dear Yoshio,
I cannot understand the error with so few errors, please try to install a different version of cmake. I use version 3.15.5.
Cheers
Panos
Hi Yoshio,
You might want to try this if you have updated your Mac to Big Sur.
brew install cmake
brew install gcc
brew install openmpi
brew install fltk
brew install fftw
###Set the correct compilers (put the following lines in your .bash-profile)
export CXX=g++-10
export CC=gcc-10
export OMPI_CXX=g++-10
export OMPI_CC=gcc-10
export PATH=”/usr/local/opt/openmpi/bin:${PATH}”
export CXXFLAGS=”-I/usr/local/opt/openmpi/include”
export LDFLAGS=”-L/usr/local/opt/openmpi/lib”
###Now download, compile and install relion
git clone https://github.com/3dem/relion.git
cd relion
git checkout master
mkdir -p build
cd build
cmake ..
make -j 6
make install
##If this does not work, type echo $PATH and send me the output, you may be calling multiple c compilers at the same time and causing switching between them during install.
Hi,
I have MacOc Big Sur, and have tried to install using the command lines above. Cmake does not work. I have this message.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 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.
— The C compiler identification is GNU 10.2.1
— The CXX compiler identification is GNU 10.2.1
— Checking whether C compiler has -isysroot
— Checking whether C compiler has -isysroot – yes
— Checking whether C compiler supports OSX deployment target flag
— Checking whether C compiler supports OSX deployment target flag – yes
— Detecting C compiler ABI info
— Detecting C compiler ABI info – failed
— Check for working C compiler: /opt/homebrew/bin/gcc-10
— Check for working C compiler: /opt/homebrew/bin/gcc-10 – broken
CMake Error at /opt/homebrew/Cellar/cmake/3.19.5/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
“/opt/homebrew/bin/gcc-10”
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/nadia/relion/build/relion/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_782ee/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_782ee.dir/build.make CMakeFiles/cmTC_782ee.dir/build
Building C object CMakeFiles/cmTC_782ee.dir/testCCompiler.c.o
/opt/homebrew/bin/gcc-10 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -o CMakeFiles/cmTC_782ee.dir/testCCompiler.c.o -c /Users/nadia/relion/build/relion/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_782ee
/opt/homebrew/Cellar/cmake/3.19.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_782ee.dir/link.txt –verbose=1
/opt/homebrew/bin/gcc-10 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names ”-L/usr/local/opt/openmpi/lib” CMakeFiles/cmTC_782ee.dir/testCCompiler.c.o -o cmTC_782ee
gcc-10: error: ”-L/usr/local/opt/openmpi/lib”: No such file or directory
make[1]: *** [cmTC_782ee] Error 1
make: *** [cmTC_782ee/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
— Configuring incomplete, errors occurred!
See also “/Users/nadia/relion/build/relion/build/CMakeFiles/CMakeOutput.log”.
See also “/Users/nadia/relion/build/relion/build/CMakeFiles/CMakeError.log”.
Can someone please enlighten me?
Many tanks for your help,
Nadia
Hello,
I sent you a message for help yesterday, just so you know, I solved everything by installing llvm-clang on my Mac, following the method mentionned here :http://clang.llvm.org/get_started.html
If this can help someone.
Thanks anyway!
Dear Julien, the idea is to install Relion without clang, that’s why we use and export the C compilers, but if you found a solution for your error, that’s great.
Cheers
Panos
Dear Andrew, it works fine in my Mac, both Relion3.0 and Relion3.1. Maybe you need to unistall and re-install xquartz? Is there any error reported while loading the micrographs?
Dear Gundeep, please follow again the instructions above. Then open a new terminal window and type relion, and check the errors.
Cheers
Panos
Hi
I am trying to install relion on macOS catalina 10.15.3, and got the following error message while performing the steps suggested.
Please suggest how to fix this
”
Pouring fftw-3.3.8_2.catalina.bottle.tar.gz
? /usr/local/Cellar/fftw/3.3.8_2: 73 files, 14.2MB
zsh: command not found: ###Set
zsh: command not found: ###Now
fatal: could not create work tree dir ‘relion’: Permission denied
cd: no such file or directory: relion
fatal: not a git repository (or any of the parent directories): .git
mkdir: build: Permission denied
cd: no such file or directory: build
CMake Error: The source directory “/” does not appear to contain CMakeLists.txt.
Specify –help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install’. Stop.
Hi there…Nice contribution to the community. Instructions are very simple and easy to follow.
I’m getting the following error. Any thoughts?
CMake Error at /usr/local/Cellar/cmake/3.18.2/share/cmake/Modules/CMakeDetermineCCompiler.cmake:49 (message):
Could not find compiler set in environment variable CC:
gcc-9.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
— Configuring incomplete, errors occurred!
HI Matt,
For some reason, cmake ignores exported CXX and CC environment variables. This could be because another software you installed or another version of cmake conflicts with the installation. Usual suspect is conda. See my reply to Yu Zhang for trouble-shooting the variable issue.
Cheers
Panos
Hi, I am getting a few errors for the install on catalina 10.15.6. Any help would be appreciated.
— BUILD TYPE set to the default type: ‘Release’
— Setting fallback CUDA_ARCH=35
— CUDA enabled – Building CUDA-accelerated version of RELION
— Setting cpu precision to double
— 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….
— MPI_INCLUDE_PATH : /usr/local/Cellar/open-mpi/4.0.5/include
— MPI_LIBRARIES : /usr/local/Cellar/open-mpi/4.0.5/lib/libmpi.dylib
— MPI_CXX_INCLUDE_PATH : /usr/local/Cellar/open-mpi/4.0.5/include
— MPI_CXX_LIBRARIES : /usr/local/Cellar/open-mpi/4.0.5/lib/libmpi.dylib
— CMAKE_C_COMPILER : /Library/Developer/CommandLineTools/usr/bin/cc
— CMAKE_CXX_COMPILER : /Library/Developer/CommandLineTools/usr/bin/c++
— MPI_C_COMPILER : /usr/local/bin/mpicc
— MPI_CXX_COMPILER : /usr/local/bin/mpicxx
— CMAKE_CXX_COMPILER_ID : Clang
— CMAKE_C_COMPILER : /usr/local/bin/mpicc
— CMAKE_CXX_COMPILER : /usr/local/bin/mpicxx
— MPI_C_COMPILER : /usr/local/bin/mpicc
— MPI_CXX_COMPILER : /usr/local/bin/mpicxx
— X11 and FLTK were found
— FLTK_LIBRARIES: -framework Carbon -framework Cocoa -framework ApplicationServices -lz;/usr/local/lib/libfltk_images.dylib;/usr/local/lib/libfltk_forms.dylib;/usr/local/lib/libfltk.dylib
— Found FFTW
— FFTW_PATH: /usr/local/include
— FFTW_INCLUDES: /usr/local/include
— FFTW_LIBRARIES: /usr/local/lib/libfftw3f.dylib;/usr/local/lib/libfftw3.dylib
— Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
BUILD_SHARED_LIBS = OFF
— Building static libs (larger build size and binaries)
Running apps/CMakeLists.txt…
— CMAKE_BINARY_DIR:/Users/jarrodmousa/relion/build
TIFF NOT FOUND
CMake Error at /usr/local/Cellar/cmake/3.18.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.18.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.18.2/share/cmake/Modules/FindOpenMP.cmake:529 (find_package_handle_standard_args)
src/apps/CMakeLists.txt:219 (FIND_PACKAGE)
— Configuring incomplete, errors occurred!
See also “/Users/jarrodmousa/relion/build/CMakeFiles/CMakeOutput.log”.
See also “/Users/jarrodmousa/relion/build/CMakeFiles/CMakeError.log”.
Hi
I am follow all steps but i am facing a problem.
CMake Error at /usr/local/Cellar/cmake/3.18.2/share/cmake/Modules/CMakeDetermineCCompiler.cmake:49 (message):
Could not find compiler set in environment variable CC:
gcc-9.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
— Configuring incomplete, errors occurred!
Dear Dr. Kastritis,
Thanks for the nice post, however, I kind of have the same error like many have reported:
CMake Error at /usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/FindOpenMP.cmake:529 (find_package_handle_standard_args)
src/apps/CMakeLists.txt:248 (FIND_PACKAGE)
As you suggested, I tried:
echo $CXX $CC $OMPI_CXX $OMPI_CC $CXXFLAGS $LDFLAGS
and then I did have:
g++-9 gcc-9 g++-9 gcc-9 -I/usr/local/opt/openmpi/include -L/usr/local/opt/openmpi/lib
Do you have any ideas how should I handle this?
Thank you very much for these nice instructions. I could solve the cmake error but now in the next two steps I get the following
build % make -j 6
make: *** No targets specified and no makefile found. Stop.
build % make install
make: *** No rule to make target `install’. Stop.
how do I fix this last part? I saw a similar problem above but no solution to it….
Hi,
I have MacOc Big Sur, and have tried to install using the command lines above. Cmake does not work. I have this message.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 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.
— The C compiler identification is GNU 10.2.1
— The CXX compiler identification is GNU 10.2.1
— Checking whether C compiler has -isysroot
— Checking whether C compiler has -isysroot – yes
— Checking whether C compiler supports OSX deployment target flag
— Checking whether C compiler supports OSX deployment target flag – yes
— Detecting C compiler ABI info
— Detecting C compiler ABI info – failed
— Check for working C compiler: /opt/homebrew/bin/gcc-10
— Check for working C compiler: /opt/homebrew/bin/gcc-10 – broken
CMake Error at /opt/homebrew/Cellar/cmake/3.19.5/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
“/opt/homebrew/bin/gcc-10”
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/nadia/relion/build/relion/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_782ee/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_782ee.dir/build.make CMakeFiles/cmTC_782ee.dir/build
Building C object CMakeFiles/cmTC_782ee.dir/testCCompiler.c.o
/opt/homebrew/bin/gcc-10 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -o CMakeFiles/cmTC_782ee.dir/testCCompiler.c.o -c /Users/nadia/relion/build/relion/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_782ee
/opt/homebrew/Cellar/cmake/3.19.5/bin/cmake -E cmake_link_script CMakeFiles/cmTC_782ee.dir/link.txt –verbose=1
/opt/homebrew/bin/gcc-10 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names ”-L/usr/local/opt/openmpi/lib” CMakeFiles/cmTC_782ee.dir/testCCompiler.c.o -o cmTC_782ee
gcc-10: error: ”-L/usr/local/opt/openmpi/lib”: No such file or directory
make[1]: *** [cmTC_782ee] Error 1
make: *** [cmTC_782ee/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
— Configuring incomplete, errors occurred!
See also “/Users/nadia/relion/build/relion/build/CMakeFiles/CMakeOutput.log”.
See also “/Users/nadia/relion/build/relion/build/CMakeFiles/CMakeError.log”.
Can someone please enlighten me?
Many tanks for your help,
Nadia
Hi,
Trying from Mojave, I get this error> Could you please help me?
Thanks
Best
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 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=35
— CUDA enabled – Building CUDA-accelerated version of RELION
— Setting cpu precision to double
— 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 /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Reason given by package: MPI component ‘Fortran’ was requested, but language Fortran is not enabled.
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
/Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindMPI.cmake:1722 (find_package_handle_standard_args)
CMakeLists.txt:204 (find_package)
— Configuring incomplete, errors occurred!
See also “/Users/Melkins/relion/build/CMakeFiles/CMakeOutput.log”.
See also “/Users/Melkins/relion/build/CMakeFiles/CMakeError.log”.
bash-3.2$ /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
bash: syntax error near unexpected token `_FPHSA_FAILURE_MESSAGE’
bash-3.2$ /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582
bash: /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582: No such file or directory
bash-3.2$ cd /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582
bash: cd: /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582: No such file or directory
Dear Dr. Kastritis
base on the above step, I have installed the relion 3.06 sucessfully. but how can I update the region to the 3.1 version on my mac.
Hello! No, we have done it in previous macos chips… We have not tried to compile it on M chips