Simplify compiler name variables

This commit is contained in:
Rodrigo Arias 2020-12-03 18:06:51 +01:00
parent 53d8e535b5
commit f65e4d01c3
7 changed files with 25 additions and 24 deletions

View File

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
preBuild = '' preBuild = ''
cd BigSort cd BigSort
export I_MPI_CXX=${cc.cc.CXX} export I_MPI_CXX=${cc.CXX}
''; '';
buildInputs = [ buildInputs = [
@ -31,8 +31,8 @@ stdenv.mkDerivation rec {
++ optional (nanos6 != null) nanos6; ++ optional (nanos6 != null) nanos6;
makeFlags = [ makeFlags = [
"CC=${cc.cc.CC}" "CC=${cc.CC}"
"CXX=${cc.cc.CXX}" "CXX=${cc.CXX}"
"CPP_BIN=mpicxx" "CPP_BIN=mpicxx"
"CLUSTER=MareNostrum4" "CLUSTER=MareNostrum4"
"OPENMP=yes" "OPENMP=yes"

View File

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
]; ];
makeFlags = [ makeFlags = [
"I_MPI_CXX=${cc.cc.CXX}" "I_MPI_CXX=${cc.CXX}"
"CPP_BIN=mpicxx" "CPP_BIN=mpicxx"
]; ];

View File

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
]; ];
makeFlags = [ makeFlags = [
"I_MPI_CXX=${cc.cc.CXX}" "I_MPI_CXX=${cc.CXX}"
"CPP_BIN=mpicxx" "CPP_BIN=mpicxx"
]; ];

View File

@ -28,8 +28,8 @@ stdenv.mkDerivation rec {
++ optional (mpi != null) mpi; ++ optional (mpi != null) mpi;
makeFlags = [ makeFlags = [
"CC=${cc.cc.CC}" "CC=${cc.CC}"
"CXX=${cc.cc.CXX}" "CXX=${cc.CXX}"
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
'' else ""); '' else "");
makeFlags = [ makeFlags = [
"CC=${cc.cc.CC}" "CC=${cc.CC}"
"BS=${toString blocksize}" "BS=${toString blocksize}"
] ]
++ optional (tampi != null) "TAMPI_HOME=${tampi}"; ++ optional (tampi != null) "TAMPI_HOME=${tampi}";

View File

@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
''; '';
makeFlags = [ makeFlags = [
"-f" "Makefile.${cc.cc.CC}" "-f" "Makefile.${cc.CC}"
"apps" "apps"
"APP=Heat3D_vect" "APP=Heat3D_vect"
] ++ optional (nbx != null) "NB_X=${toString nbx}" ] ++ optional (nbx != null) "NB_X=${toString nbx}"

View File

@ -8,6 +8,10 @@ let
inherit (self.lib) callPackagesWith; inherit (self.lib) callPackagesWith;
callPackage = callPackageWith (self // self.bsc // self.garlic); callPackage = callPackageWith (self // self.bsc // self.garlic);
appendPasstru = drv: attrs: drv.overrideAttrs (old:{
passthru = old.passthru // attrs;
});
# --------------------------------------------------------- # # --------------------------------------------------------- #
# BSC Packages # BSC Packages
# --------------------------------------------------------- # # --------------------------------------------------------- #
@ -55,22 +59,14 @@ let
# A wrapper script that puts all the flags and environment vars properly and # A wrapper script that puts all the flags and environment vars properly and
# calls the intel compiler binary # calls the intel compiler binary
icc = callPackage ./bsc/intel-compiler/default.nix { icc = appendPasstru (callPackage ./bsc/intel-compiler/default.nix {
iccUnwrapped = bsc.iccUnwrapped; iccUnwrapped = bsc.iccUnwrapped;
intelLicense = bsc.intelLicense; intelLicense = bsc.intelLicense;
}; }) { CC = "icc"; CXX = "icpc"; };
# We need to set the cc.cc.CC and cc.cc.CXX attributes, in order to # We need to set the cc.CC and cc.CXX attributes, in order to
# determine the name of the compiler # determine the name of the compiler
# FIXME: Use a proper and automatic way to compute the compiler name gcc = appendPasstru self.gcc { CC = "gcc"; CXX = "g++"; };
gcc = self.gcc.overrideAttrs (old1: {
cc = old1.cc.overrideAttrs (old2: {
passthru = old2.passthru // {
CC = "gcc";
CXX = "g++";
};
});
});
intelLicense = callPackage ./bsc/intel-compiler/license.nix { }; intelLicense = callPackage ./bsc/intel-compiler/license.nix { };
@ -151,7 +147,12 @@ let
#rdma-core = callPackage ./bsc/rdma-core/default.nix { }; #rdma-core = callPackage ./bsc/rdma-core/default.nix { };
# Last llvm release by default # Last llvm release by default
llvmPackages = self.llvmPackages_11; llvmPackages = self.llvmPackages_11 // {
clang = appendPasstru self.llvmPackages_11.clang {
CC = "clang"; CXX = "clang++";
};
};
lld = bsc.llvmPackages.lld; lld = bsc.llvmPackages.lld;
clangOmpss2Unwrapped = callPackage ./bsc/llvm-ompss2/clang.nix { clangOmpss2Unwrapped = callPackage ./bsc/llvm-ompss2/clang.nix {
@ -159,9 +160,9 @@ let
enableDebug = false; enableDebug = false;
}; };
clangOmpss2 = callPackage bsc/llvm-ompss2/default.nix { clangOmpss2 = appendPasstru (callPackage bsc/llvm-ompss2/default.nix {
clangOmpss2Unwrapped = bsc.clangOmpss2Unwrapped; clangOmpss2Unwrapped = bsc.clangOmpss2Unwrapped;
}; }) { CC = "clang"; CXX = "clang++"; };
stdenvOmpss2 = self.clangStdenv.override { stdenvOmpss2 = self.clangStdenv.override {
cc = bsc.clangOmpss2; cc = bsc.clangOmpss2;