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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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