[Openmp-commits] [PATCH] D55725: [OpenMP] Add libs to clang-dedicated directories

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Mar 26 04:37:07 PDT 2021


JonChesterfield added a comment.

Arrived here from D99402 <https://reviews.llvm.org/D99402>. Complicated! Perhaps simpler today than in 2019 due to the monorepo, and if I understand the above, somewhat separable.

The use cases for the right openmp libs seem to be:

1. Applications find the openmp that was built and installed with clang/llvm
2. Applications use some other openmp as specified by the developer
3. Attempt to guess what libraries on the host system would work

I think those roughly map to:

1. Works out of the box
2. Can swap out different ones while debugging
3. Today's effort / backwards compat

The second axis is architectures, where putting the libraries in a path named by triple or similar allows clang to pick one that matches the host. Since we can build a clang that targets x64 and ppc, it would be very helpful to some users to have that clang find x64-native libraries on one system and ppc-native on another. I'd like to have a set of libraries for glibc and another for musl.

Last time I looked at this, clang's support for automatically picking the right set of libraries for a given architecture was very DIY. I think it worked for compiler-rt, but not for libc++ et al.

I suggest treating those as totally separate concerns.

- Teach clang to prioritise some directory relative to clang by default
- Teach clang to pick out a subdirectory matching the target triple

Where the first is simpler to implement and makes life easy for people who aren't cross compiling, and the latter will compose with it.

OpenMP doesn't seem significantly different to libc++ in this regard - there are headers, and a library, and we'd like to find both, and a libc++ built at the same time as clang is a strong choice for the default.

If clang/llvm has picked up solid out of the box cross compiling support for multiple libraries already, great, let's copy that. If not, that can be done in parallel to openmp libs search path.


Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55725/new/

https://reviews.llvm.org/D55725



More information about the Openmp-commits mailing list