I am working on a project for which I need to make some modifications to the OpenMP library. I have installed the pre-built binaries for clang and llvm (release 15) from the GitHub repo.
I am unable to build OpenMP now using these binaries, incremental builds are necessary.
If anyone with experience in building standalone OpenMP could help out, It would be great.
-DLLVM_ENABLE_RUNTIMES=”openmp” will use the host compiler to build a fresh Clang and then use the fresh Clang to build OpenMP. You are using your standalone Clang, but only to build a fresh Clang.
Check your clang and clang++ are working fine, e.g., they can build executables and find things like the standard library. You can even use your system gcc instead if you follow the steps below.
run the cmake command with the options described in the OpenMP FAQ
run make
This is the content of my slide I always present on the topic:
Single command often suffices to configure:
cmake …/llvm-project/llvm -DLLVM_ENABLE_PROJECTS='clang' -DLLVM_ENABLE_RUNTIMES=’openmp’
make -j
Useful options include: CMAKE_BUILD_TYPE={Release,Asserts,…}
LLVM_ENABLE_ASSERTIONS={ON,OFF}
LLVM_CCACHE_BUILD={ON,OFF}
-G Ninja
May need debug build to debug certain compiler-based issues,
release + assert is often used as trade off.
Various resources available online! Start here:
http://llvm.org/docs/GettingStarted.html
https://openmp.llvm.org/SupportAndFAQ.html