# Compiling GROMACS 2023 with Intel LLVM compilers

**URL:** <https://gromacs.bioexcel.eu/t/compiling-gromacs-2023-with-intel-llvm-compilers/6487>\
**Category:** User discussions\
**Tags:** installation-error\
**Created:** [May 24, 2023, 5:01pm UTC](https://gromacs.bioexcel.eu/t/compiling-gromacs-2023-with-intel-llvm-compilers/6487 "2023-05-24T17:01:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@Erik](https://gromacs.bioexcel.eu/u/Erik)\
**Post date:** [May 24, 2023, 5:01pm UTC](https://gromacs.bioexcel.eu/t/compiling-gromacs-2023-with-intel-llvm-compilers/6487/1 "2023-05-24T17:01:02Z")

</div>

GROMACS version: 2023.1  
GROMACS modification: No

I’m trying to compile GROMACS 2023 using Intel’s LLVM compilers and have run into a number of issues. The first is that they don’t seem to play nicely with nvcc because of a bug with the way nvcc sets C++ standard version (see [this post](https://github.com/intel/llvm/issues/8037#issuecomment-1450421497)). The post suggests that by setting the standard to c++17 in the nvcc flags, there shouldn’t be compatibility issues. I verified that I can compile the test code included with GROMACS with:

```auto
nvcc --compiler-bindir=mpiicpx --std=c++17 --allow-unsupported-compiler /u/epoppleton/software/gromacs-2023.1/cmake/TestCUDA.cu

```

However I cannot figure out how to append multiple compiler flags to the nvcc command so I ended up just hardcoding them in `gromacs/cmake/gmxManageNvccConfig.cmake`.

Anyway, if I do that, the `cmake` step completes successfully, but `make` fails with:

```auto
icx: error: cannot specify -o when generating multiple output files
CMake Error at libgromacs_generated_gpuhaloexchange_impl_gpu.cu.o.Release.cmake:220 (message):
  Error generating
  /u/epoppleton/software/gromacs-2023.1/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs_generated_gpuhaloexchange_impl_gpu.cu.o

```

This is my first time trying to compile something this complicated, so I’m probably doing something stupid, but I am very stuck on this one.

Here is my cmake command:

```auto
cmake -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=CUDA -DGMX_MPI=ON -DGMX_OPENMP=ON -DGMX_FFT_LIBRARY=mkl -DCMAKE_C_COMPILER=mpiicx -DCMAKE_CXX_COMPILER=mpiicpx -DCMAKE_CXX_STANDARD=17 ..

```

And relevant compilers/libraries:  
mpiicx/mpiicpx : 2023.1.0  
CUDA : 11.6  
MKL : October 2022  
GCC/G++ : 12.1.0  
openMPI : 4.1  
IMPI : 2021.9

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [May 26, 2023, 10:32am UTC](https://gromacs.bioexcel.eu/t/compiling-gromacs-2023-with-intel-llvm-compilers/6487/2 "2023-05-26T10:32:02Z")

</div>

Hi!

Is there any specific reason you’re trying to use `icpx` and not `gcc`/`g++`? As you have seen from the error message, CUDA is not officially supported with Intel compilers.

You can try running `VERBOSE=1 make` to get the exact compiler commands used, and try to figure out from there what goes wrong.

But you should have a much smoother experience if you use GCC, which is properly supported by NVCC. I see that you have GCC 12.1, which should work fine, but be aware that there are [known issues with GCC 11.2 and CUDA 11.6](https://manual.gromacs.org/current/user-guide/known-issues.html#unable-to-build-with-cuda-11-5-11-6-and-gcc-11-on-ubuntu-22-04).

---

<div class="post-metadata">

**Author:** ![Erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@Erik](https://gromacs.bioexcel.eu/u/Erik)\
**Post date:** [June 6, 2023, 11:52am UTC](https://gromacs.bioexcel.eu/t/compiling-gromacs-2023-with-intel-llvm-compilers/6487/3 "2023-06-06T11:52:52Z")

</div>

Thanks. I ended up just compiling with GCC 12.1 and CUDA 12.1 and that worked.
