First time here? Checkout the FAQ!
x
0 votes
ago by (3.5k points)
retagged ago by

On macOS, CMake cannot find OpenMP, although I've installed OpenMP via Homebrew with
 

brew install libomp

More precisely, when trying to build openCARP, the CMake configuration command

cmake -S. -B_build

gives the following error:

[...]

CMake Error at /opt/homebrew/Cellar/cmake/3.31.2/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.31.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)

  /opt/homebrew/Cellar/cmake/3.31.2/share/cmake/Modules/FindOpenMP.cmake:616 (find_package_handle_standard_args)

  CMakeLists.txt:222 (find_package)

1 Answer

0 votes
ago by (3.5k points)
 
Best answer

If libomp has been installed via homebrew, this can be solved by exporting the following environment variable:

export OpenMP_ROOT=$(brew --prefix)/opt/libomp
Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...