Building Standalone OpenMP using pre-built binaries (original) (raw)

Hello,

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.

If you look at this page:
Support, Getting Involved, and FAQ — LLVM/OpenMP 17.0.0git documentation Section: How to build an OpenMP GPU offload capable compiler?

-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.

aj09 June 2, 2023, 5:35am 3

I have downloaded the pre-compiled binaries for clang and llvm from Release LLVM 15.0.6 · llvm/llvm-project · GitHub, and now I am trying to build openmp using this.

I downloaded OpenMP from same repo corresponding to release 15 and then tried to build it using:

cmake -DCMAKE_C_COMPILER=/llvm-15/bin/clang-16 -DCMAKE_CXX_COMPILER=/llvm-15/bin/clang++ -G “Unix Makefiles” …/

This gives me a error that compilers for c and c++ do not match along with llvm-lit not found error. Can you tell me what’s going wrong ?

Not from this description.

  1. 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.
  2. run the cmake command with the options described in the OpenMP FAQ
  3. 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