Issue installing from source on M2 mac

Hello any interested reader.

I am having problems installing the newest version of OpenMC (had version 0.13.3 and 0.14 previously) on my M2 mac, the issues arise when the command cmake … from the installation procedure is run.

The error output is as follows:

CMake Error at /opt/homebrew/Cellar/cmake/3.30.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.30.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/opt/homebrew/Cellar/cmake/3.30.0/share/cmake/Modules/FindOpenMP.cmake:600 (find_package_handle_standard_args)
CMakeLists.txt:84 (find_package)

Has anyone encountered any similar problems?

Looks like you don’t have the OpenMP libs installed for C/C++ language.

Try this:

brew install libomp

If this don’t work, try read this:

He has the same problem of you.

Hey! Sorry for the late reply!

Manually setting the CC and CXX variables in the terminal to the ones provided by llvm prior to running the cmake … command did the trick!

Thanks for the input! Very appreciated!

1 Like

Hi, I have the same problem,

What commands did you use for setting CC and CXX variables in terminal?

Thank toy

Hey! Sorry for the late reply i ran

export CXX=/opt/homebrew/opt/llvm/bin/clang++

and

export CC=/opt/homebrew/opt/llvm/bin/clang

not sure if the last one is strictly necessary, but it worked for me!

Good luck!