Building a static library of OpenMP

Hi,
Is building a static library of OpenMP still designed to be
difficult to accomplish in the trunk?

Hi Itaru, yes, it is not easy work to do. We discussed it again a few days ago and it still requires some additional work.

Best regards,
Alexey Bataev

Is it again disclosed to the public testers in the Clang 10 timeframe?

Alexey, all,
My platform requires apps be built statically, so creating libomp.a is a critical mission for me.
If there is documentation in the work out there, would you share it with us please?

Hi Itaru,

Building libomp.a is pretty easy, you can read some details in readme file (e.g. here https://github.com/llvm/llvm-project/tree/master/openmp).

But it won’t build static offload library. So, if you need offload that may be a problem, as Alexey mentioned. If you don’t need offload, than it should be easy.

Regards,

Andrey

Andrey,
I’d like the offload included in the toolchain.

Hi Itaru,

What version of Clang are you using?

I have a version which supports static linking at this page:

https://github.com/clang-ykt

Clone the llvm, clang and openmp repos and use the patched-upstream branch on all three.

Then build as you normally do.

This is a version that is quite recent, updated to newest development trunk yesterday.

Let me know if this works.

Thanks,

–Doru

Doru et al.,

My build was initiated on AArch64 like below:

cmake -G “Ninja” -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/opt/clang-ykt -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_TARGETS_TO_BUILD=AArch64 ~/projects/clang-ykt/

Clang is provided from upstream as of yesterday-ish. The build process went ok, but I ended up obtaining a libomp.so.
(I made sure that BUILD_SHARED_LIBS was set to OFF, clang was located under the tools directory and openmp under projects)

Itaru.

noname.jpg

Spoke too soon. Setting LIBOMP_ENABLE_SHARED to FALSE gives me libomp.a on AArch64.

noname.jpg

Doru,

If you could turn the clang-ykt repository to a single one (llvm-project ish), that’d be easier for us
to catch your progress on a daily basis.

Thanks,
Itaru.

noname.jpg

Doru,

On PowerPC (a POWER8 Minsky node), Ninja build is stuck on this phase:

$ ninja install
[0/3] Building CXX object tools/clang/…gDynamicASTMatchers.dir/Registry.cpp.o

… and no progress, it seems. Have you successfully finished building the patched-upstream branches
on PowerPC?

Thanks,
Itaru.

noname.jpg

Hi Itaru,

I don’t have any issues on building on PowerPC.

Can you do a ninja clean and then rebuild?

Thanks,

–Doru

Doru,
Thanks. I obtained libomp.a successfully from the build, however, I am not getting offload libraries with
the configuration below:

cmake -G “Ninja” -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PROJECT/pcp0151/opt/clang-ykt -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_TARGETS_TO_BUILD=PowerPC -DLIBOMP_ENABLE_SHARED=FALSE -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_60 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=TRUE -DLIBOMP_ENABLE_SHARED=FALSE /tmp/projects/clang-ykt

Itaru.

noname.jpg

noname.jpg

Doru,
I have updated the repositories (clang and openmp) placed under clang-ykt to today’s HEAD
and built it without an issue on PowerPC. I confirmed libomp.a in the destination lib directory.

Thanks,
Itaru.

noname.jpg

noname.jpg