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

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/, 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!