# Issue with SYCL compiler not supporting OpenMP

**URL:** <https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929>\
**Category:** User discussions\
**Created:** [August 20, 2024, 11:34am UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929 "2024-08-20T11:34:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newsky](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@Newsky](https://gromacs.bioexcel.eu/u/Newsky)\
**Post date:** [August 20, 2024, 11:34am UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929/1 "2024-08-20T11:34:11Z")

</div>

GROMACS version: Latest  
GROMACS modification: Yes/No

([Installation guide for exotic configurations - GROMACS 2024.1 documentation](https://manual.gromacs.org/2024.1/install-guide/exotic.html))  
Regarding the SYCL oneApi build having OpenMP issue, there is following suggestion:

For oneAPI 2024.x: `-DCMAKE_C_FLAGS="-isystem /opt/intel/oneapi/compiler/latest/opt/compiler/include" -DCMAKE_CXX_FLAGS="-isystem /opt/intel/oneapi/compiler/latest/opt/compiler/include"`

However, I’m using open source dpc++ which does not have the suggested paths. Any ideas what I should use instead?

Thanks

---

<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:** [August 20, 2024, 1:33pm UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929/2 "2024-08-20T13:33:53Z")

</div>

Hi! If you’re building DPC++ itself, just build it with OpenMP:

`python3 ../buildbot/configure.py --llvm-external-projects=openmp [whatever other options]`

After building and installing it, GROMACS should detect OpenMP support without any extra flags (you might want to purge GROMACS’s CMake cache in the build directory).

Note: Open-source DPC++ and Unified Runtime are moving fast, so beware of bugs or API changes when using the tip of `sycl` branch (or any of the nightly snapshots for that matter).

---

<div class="post-metadata">

**Author:** ![Newsky](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@Newsky](https://gromacs.bioexcel.eu/u/Newsky)\
**Post date:** [August 21, 2024, 2:26pm UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929/3 "2024-08-21T14:26:20Z")

</div>

Hey,

After trying that, I’m still having the same issue. (Tried to make a fresh build)

```auto
CMake Error at cmake/gmxManageOpenMP.cmake:50 (message):
The compiler you are using does not support OpenMP parallelism. This might
hurt your performance a lot, in particular with GPUs. Try using a more
recent version, or a different compiler. If you don't want to use OpenMP,
disable it explicitly with -DGMX_OPENMP=OFF
Call Stack (most recent call first):
CMakeLists.txt:432 (include)

```

There seems to be something off with the dpc++ build as I cannot find libomp.so anywhere.

---

<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:** [August 21, 2024, 3:20pm UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929/4 "2024-08-21T15:20:16Z")

</div>

That’s weird.

I just made a clean build of the open-source Intel LLVM compiler (07bf3c11ebeafbbb408708dd79f578ec7c974423) using

`python3 ../buildbot/configure.py --cuda --hip -t release --llvm-external-projects=openmp`

After building, I have `./projects/openmp/runtime/src/omp.h` and `./lib/libomp.so` in the build directory. Installing puts them to `{install_prefix}/lib/clang/19/include/omp.h` and `{install_prefix}/lib/x86_64-unknown-linux-gnu/libomp.so`.

---

<div class="post-metadata">

**Author:** ![Newsky](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@Newsky](https://gromacs.bioexcel.eu/u/Newsky)\
**Post date:** [August 22, 2024, 8:30am UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929/5 "2024-08-22T08:30:44Z")

</div>

Hmm, I’m really bad at setting up LLVM, but here is what I got  
(with ad59feb6210ae8dab5e73f61e05631261039498b):

```auto
$ python3 configure.py -o ../build_default --llvm-external-projects=openmp -t Release
$ python3 compile.py -o ../build_default -j 70

```

I have omp.h at `/build_default/projects/openmp/runtime/src`

No libomp.so at `/build_default/lib`

No omp.h at `/build_default/install/lib/clang/19/include`

No libomp.so (and not any directories) at `/build_default/install/lib`

By looking at ccmake, I have `CLANG_DEFAULT_OPENMP_RUNTIME libomp`, `LLVM_ENABLE_PROJECTS clang;sycl;llvm-spirv;opencl;xpti;xptifw;libdevice;sycl-jit;openmp`

Could openmp library be somehow statically linked? Anyway, gromacs still complains about the lacking support.

---

<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:** [August 22, 2024, 11:02am UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929/6 "2024-08-22T11:02:17Z")

</div>

> Could openmp library be somehow statically linked?

The OpenMP library could perhaps be statically linked to the application (GROMACS), but building Clang should still produce a library file (`libomp.so` or `libomp.a`) for that linking to happen. We’re not linking OpenMP to Clang; we build OpenMP library that should later be linked to GROMACS.

> Hmm, I’m really bad at setting up LLVM, but here is what I got

IMO, that is a question better answered at [intel/llvm · Discussions · GitHub](https://github.com/intel/llvm/discussions). The problem is that LLVM does not build OpenMP, that’s not related to GROMACS.

That said, compared to your example, I usually directly call

`cmake --build . && cmake --build . --target sycl-toolchain sycl-sanitize sycl-trace install deploy-sycl-toolchain`

in the build directory instead of using `compile.py`.

---

<div class="post-metadata">

**Author:** ![Newsky](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@Newsky](https://gromacs.bioexcel.eu/u/Newsky)\
**Post date:** [August 22, 2024, 11:45am UTC](https://gromacs.bioexcel.eu/t/issue-with-sycl-compiler-not-supporting-openmp/9929/7 "2024-08-22T11:45:33Z")

</div>

Yeah, I agree. Thanks!
