bscpkgs/bsc/llvm-ompss2/clang.nix

78 lines
1.6 KiB
Nix
Raw Normal View History

2020-06-17 19:00:49 +08:00
{
stdenv
, fetchgit
, cmake
, lld
, bash
, python3
, perl
, clang
, which
, libelf
, libffi
, pkg-config
, enableDebug ? true
}:
stdenv.mkDerivation rec {
version = "11.0.0";
pname = "clang-ompss2";
enableParallelBuilding = true;
2020-07-21 22:31:31 +08:00
isClang = true;
2020-06-17 19:00:49 +08:00
#isGNU = true;
isClangWithOmpss = true;
buildInputs = [
which
clang
bash
python3
perl
cmake
lld
libelf
libffi
pkg-config
];
hardeningDisable = [ "fortify" ];
2020-06-17 19:00:49 +08:00
cmakeBuildType = if enableDebug then "Debug" else "Release";
dontUseCmakeBuildDir = true;
2020-07-06 17:15:55 +08:00
enableAssertions = if enableDebug then "ON" else "OFF";
2020-06-17 19:00:49 +08:00
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;compiler-rt"
2020-07-04 00:34:57 +08:00
"-DLLVM_ENABLE_ASSERTIONS=${enableAssertions}"
2020-06-17 19:00:49 +08:00
"-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
)
'';
2020-07-06 21:58:09 +08:00
# Remove support for GNU and Intel Openmp
postInstall = ''
rm $out/lib/libgomp*
rm $out/lib/libiomp*
'';
2020-06-17 19:00:49 +08:00
# About "-DCLANG_DEFAULT_NANOS6_HOME=${nanos6}", we could specify a default
# nanos6 installation, but this is would require a recompilation of clang each
# time nanos6 is changed. Better to use the environment variable NANOS6_HOME,
# and specify nanos6 at run time.
src = builtins.fetchGit {
2020-06-26 02:05:12 +08:00
url = "ssh://git@bscpm02.bsc.es/llvm-ompss/llvm-mono.git";
rev = "e1c73c3691d2685a99d99e14c6110d2c880662c6";
2020-06-17 19:00:49 +08:00
ref = "master";
};
}