Installing GROMACS with OpenMP support using Intel compiler

GROMACS version: 2021.5
GROMACS modification: No
OS: Mac OS 12.2
Hardware: Macbook Pro 2019 with Intel CPU + AMD GPU

Hi, I initially installed GROMACS using the ‘quick and dirty’ guide along with -DGMX_GPU=OpenCL to be able to use my GPU (compiler: AppleClang). Everything appeared to work smoothly and I have been able to start running some MD using GROMACS. However, while attempting to enable multithreaded operations, I realised that GROMACS was compiled without OpenMP support; I get the following error when attempting to add more -ntomp:

Fatal error:
More than 1 OpenMP thread requested, but GROMACS was compiled without OpenMP
support

So, I went back to the installation guide and found out that the intel compiler should have OpenMP support. I installed Intel’s OneAPI base toolkit which should contain the relevant compiler. However, from here, I have no idea how to get the GROMACS installation to use this Intel compiler. I have tried to set the -DCMAKE_C_COMPILER=xxx to ‘icc’ but cmake does not seem able to find the correct compiler this way. I have also sourced the intel environment variables with: source /opt/intel/oneapi/setvars.sh, but this did not appear to cause any changes.

Does anyone know how to compile GROMACS using Intel OneAPI’s kit? Thanks for your help!

Hello, I also encountered the same problem as you when using the sycl version of gromacs. Have you solved this problem?

No unfortunately. I have instead transitioned to using GROMACS on a Linux server instead. Still interested to see how this could be solved!

Hi!

@mattaq: switching to Linux is a good choice, as it is a much more tested platform. For macOS, installing libomp using Homebrew tends to work with AppleClang.

@rzy: are you also building on macOS? At the moment, GROMACS does not support SYCL on macOS. If you want GPU acceleration on macOS, please use OpenCL. FYI, in the recently-released GROMACS 2023, the OpenCL on macOS has been significantly improved compared to GROMACS 2022.