Cmake OpenMP Error when downloading Gromacs 2025.1 on Mac Inquiry?

GROMACS version: 2025.1

Hi I have a MacBook Air Chip Apple 1 Ventura 13.7.4 and want to upgrade my current functioning downloaded Gromacs 2022.1 to the Gromacs 2025.1 version via the Quick and Dirty install, I firstly upgraded to:

Xcode 14.3.1
clang version 14.0.3
cmake version 4.0.0

and then executed the code from a generated build directory with Gromacs 2025.1 downloaded:

cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON

the below error generated:

CMake Error at cmake/gmxManageOpenMP.cmake:44 (message):
The compiler you are using does not support OpenMP parallelism, Apple has
unfortunately explicitly disabled OpenMP in their clang-derived compiler.
You can disable OpenMP in Gromacs with -DGMX_OPENMP=OFF, but instead we
recommend installing the unsupported library distributed by the R project
from OpenMP on macOS with Xcode tools - or switch to gcc.
Call Stack (most recent call first):
CMakeLists.txt:438 (include)

and i was then not able to execute the next command make via:

(base) Joels-MacBook-Air:build joelsubach$ make
make: *** No targets specified and no makefile found. Stop.
(base) Joels-MacBook-Air:build joelsubach$

Would it be suggested to use the website:
OpenMP on macOS with Xcode tools suggested in the above error message and then:

  • Download the libomp run-time corresponding to the Xcode version you use from the links:
  • add -Xclang -fopenmp to CPPFLAGS, add -lomp to LIBS

or disable OpenMP in Gromacs with -DGMX_OPENMP=OFF?

If it is ok to disable OpenMP in Gromacs with -DGMX_OPENMP=OFF?
how would this be executed with being able to then continue the Gromacs 2025.1 download via the execution of the below suggested commands within the build directory:

cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
make
make check
sudo make install
source /usr/local/gromacs/bin/GMXRC

My experience is limited.

Thanks if you know:),
Joel 🚀

Hi,

It is okay in a sense that GROMACS will work. However, performance will suffer a lot (which is why this is an error and not just a warning), so I’d recommend installing OpenMP.

If you have troubles building GROMACS yourself, consider using Homebew.

Hi al42and thank you for your kind update:).

From the suggested link above I had downloaded both of the tar.gz files (see screenshot) and unzipped each with the instructions from the link below:

  • Download the libomp run-time corresponding to the Xcode version you use from the links above
  • add -Xclang -fopenmp to CPPFLAGS, add -lomp to LIBS

I believe I did the download as previously mentioned but am unsure of what to do next due to inexperience i.e. * add -Xclang -fopenmp to CPPFLAGS, add -lomp to LIBS; what would I do for this step and where i.e. in my Iterm etc.? And then after this is done would I then just continue the download where I left off with the error i.e.:

cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
make
make check
sudo make install
source /usr/local/gromacs/bin/GMXRC

?
Thanks if you can guide me into the right direction:)

First, you should try clearing the build directory to make sure the cmake runs from a clean state. There’s a decent chance it will work if you now have /usr/local/lib/libomp.dylib and /usr/local/include/omp.h files.

If that does not work, you can try adding -DOpenMP_{C,CXX}_FLAGS="-Xclang -fopenmp" -DOpenMP_{C,CXX}_LIB_NAMES=omp to your cmake call; or something along those lines. If that does not work, I would again recommend Homebrew :) Debugging the build issues over forum is not easy.

…and I instead executed the below and it downloaded successfully thanks:)
(Your other suggestions from your last post I executed but did not generate successful results.)

brew install gromacs