[build][trunk] Add triple lib to config, lib symlink workaround
- Upstream has introduced a triple lib subdir for target libraries
(requires another search path in the cfg)
- Building with -DBUILD_SHARED_LIBS=ON causes compiler so's to appear
as dependencies in libomptarget.so which are no longer found
- add triple lib to cfg
- symlink triple lib subdir objects back to lib to allow for libs to be found
(workaround until -frtlib-add-rpath solution can be made)
Turning BUILD_SHARED_LIBS=OFF will unfortunately increase the size of the installation significantly:
-DBUILD_SHARED_LIBS=OFF [r5 /work1/omp-nightly/build/rocm/trunk_19.0-0]$ du -sh . 6.4G .
-DBUILD_SHARED_LIBS=ON [r5 ~]$ du -sh /COD/LATEST/trunk/ 854M /COD/LATEST/trunk/
Seems to be a recent change in the libomptarget build causing the LLVM so's to get listed as dependencies:
[r5 ~]$ ldd /COD/LATEST/trunk/lib/x86_64-unknown-linux-gnu/libomptarget.so linux-vdso.so.1 (0x00007ffdd52ca000) libomp.so => /COD/LATEST/trunk/lib/x86_64-unknown-linux-gnu/libomp.so (0x00007f60d1d84000) libLLVMObject.so.19.0git => not found libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f60d1d49000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f60d1d3f000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f60d1bf0000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f60d1bea000) libLLVMSupport.so.19.0git => not found libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f60d1a06000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f60d19eb000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f60d17f9000) /lib64/ld-linux-x86-64.so.2 (0x00007f60d1e9b000)
Turns out that the dependences are not new. JIT support in libomptarget. Recent change is causing the libraries to no longer be found. Workaround is to use -DBUILD_SHARED_LIBS=OFF.
Applied Michael's suggestion to add symlinks from x86_64-unknown-linux-gnu to lib which allows us to build shared again. All dependent LLVM libs in libomptarget.so currently need to be found in the same directory as the lib.
Michael tracked problem down to this patch: https://github.com/llvm/llvm-project/pull/83624
and heard from Joseph "The intended solution is to require users to set up LD_LIBRARY_PATH according and have ASO make -frtlib-add-rpath true by default."
With this patch to trunk/build_project.sh all smoke-fort tests are once again passing with trunk-atd and build size is back down to ~850MB (vs. 6.4GB):
[r5 /COD/2024-03-13a]$ du -sh trunk-atd_19.0-0 853M trunk-atd_19.0-0