From f2f024b82de04b63b5c351dd0c25c7b8841d1223 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 28 Jun 2023 11:18:35 +0200 Subject: [PATCH] Add zlib to the rpath Instead of using LD_LIBRARY_PATH we provide the rpath from cmake, as otherwise the clang compiler is also missing the dependency. --- bsc/llvm-ompss2/clang.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bsc/llvm-ompss2/clang.nix b/bsc/llvm-ompss2/clang.nix index 897beb3..a1b05a6 100644 --- a/bsc/llvm-ompss2/clang.nix +++ b/bsc/llvm-ompss2/clang.nix @@ -77,15 +77,15 @@ stdenv.mkDerivation rec { "-DCMAKE_INSTALL_BINDIR=bin" "-DLLVM_ENABLE_ZLIB=FORCE_ON" "-DLLVM_ENABLE_LIBXML2=OFF" + # Set the rpath to include external libraries (zlib) both on build and + # install + "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" + "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON" + "-DCMAKE_INSTALL_RPATH=${zlib}/lib" ) ''; - # Workaround the problem with llvm-tblgen and missing zlib.so.1 - preBuild = '' - export LD_LIBRARY_PATH=${zlib}/lib - ''; - # Remove support for GNU and Intel Openmp postInstall = '' rm $out/lib/libgomp*