From ceaf273219cfa62ebe54a8272e06df672431cf65 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Thu, 11 Jun 2020 11:33:29 +0200 Subject: [PATCH] Proper install phase for llvm-ompss2 --- bsc/llvm-ompss2/default.nix | 44 ++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/bsc/llvm-ompss2/default.nix b/bsc/llvm-ompss2/default.nix index e5653a4..70dae67 100644 --- a/bsc/llvm-ompss2/default.nix +++ b/bsc/llvm-ompss2/default.nix @@ -8,26 +8,44 @@ , perl , clang , which +, libelf +, libffi +, pkg-config +, enableDebug ? false }: stdenv.mkDerivation rec { version = "10.0.0"; name = "llvm-ompss2-${version}"; enableParallelBuilding = true; - buildInputs = [ which clang bash python3 perl cmake lld ]; - #preConfigure = '' - # ls - # cmakeFlagsArray=( - # "-DCMAKE_C_COMPILER=mpicc" - # "-DCMAKE_CXX_COMPILER=mpic++" - # ) - #''; - # FIXME: The setup script installs into /build/source/llvm-install - configurePhase = '' - mkdir llvm-build - cd llvm-build - env bash ../utils/OmpSs/setup-cmake.sh + buildInputs = [ + which + clang + bash + python3 + perl + cmake + lld + libelf + libffi + pkg-config + ]; + cmakeBuildType = if enableDebug then "Debug" else "Release"; + dontUseCmakeBuildDir = true; + preConfigure = '' + mkdir -p build + cd build + cmakeDir="../llvm" + cmakeFlagsArray=( + "-DLLVM_ENABLE_LLD=ON" + "-DCMAKE_CXX_FLAGS_DEBUG=-g -ggnu-pubnames" + "-DCMAKE_EXE_LINKER_FLAGS_DEBUG=-Wl,-gdb-index" + "-DLLVM_LIT_ARGS=-sv --xunit-xml-output=xunit.xml" + "-DLLVM_ENABLE_PROJECTS=clang;openmp" + "-DLLVM_INSTALL_UTILS=ON" + "-DLLVM_ENABLE_ASSERTIONS=ON" + ) ''; src = builtins.fetchGit {