ovni/nix/rt.nix

101 lines
3.1 KiB
Nix
Raw Normal View History

let
pkgs = import (builtins.fetchTarball
2023-03-20 20:52:49 +01:00
"https://pm.bsc.es/gitlab/rarias/bscpkgs/-/archive/master/bscpkgs-master.tar.gz");
rWrapper = pkgs.rWrapper.override {
packages = with pkgs.rPackages; [ tidyverse rjson jsonlite egg viridis ];
};
# Recursively set MPI
bsc = pkgs.bsc.extend (last: prev: {
2023-03-22 19:05:48 +01:00
include-what-you-use = let
gcc = pkgs.gcc;
targetConfig = pkgs.stdenv.targetPlatform.config;
in pkgs.wrapCCWith rec {
cc = pkgs.include-what-you-use;
extraBuildCommands = ''
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
echo "-isystem${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}/include" >> $out/nix-support/cc-cflags
wrap include-what-you-use $wrapper $ccPath/include-what-you-use
substituteInPlace "$out/bin/include-what-you-use" --replace 'dontLink=0' 'dontLink=1'
'';
};
2022-12-19 11:24:18 +01:00
# Build ovni with old gcc versions
genOldOvni = stdenv: (last.ovni.override {
stdenv = stdenv;
}).overrideAttrs (old: {
pname = old.name + "@" + stdenv.cc.cc.version;
2022-12-19 13:06:00 +01:00
cmakeFlags = old.cmakeFlags ++ [
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF"
];
2022-12-19 11:24:18 +01:00
});
oldCompilers = [
#pkgs.gcc49Stdenv # broken
2022-12-19 11:24:18 +01:00
pkgs.gcc6Stdenv
pkgs.gcc7Stdenv
pkgs.gcc8Stdenv
pkgs.gcc9Stdenv
pkgs.gcc10Stdenv
pkgs.gcc11Stdenv
pkgs.gcc12Stdenv
];
oldOvnis = map last.genOldOvni last.oldCompilers;
genOldOvniNoLTO = stdenv: (last.genOldOvni stdenv).overrideAttrs (old: {
cmakeFlags = old.cmakeFlags ++ [
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF"
];
});
oldOvnisNoLTO = map last.genOldOvniNoLTO last.oldCompilers;
genOldOvniRelease = stdenv: (last.genOldOvni stdenv).overrideAttrs (old: {
cmakeBuildType = "Release";
});
oldOvnisRelease = map last.genOldOvniRelease last.oldCompilers;
# Now we rebuild ovni with the Nanos6 and nOS-V versions, which were
# linked to the previous ovni. We need to be able to exit the chroot
# to run Nanos6 tests, as they require access to /sys for hwloc
ovni-rt = (last.ovni.override {
stdenv = last.stdenvClangOmpss2;
}).overrideAttrs (old: {
__noChroot = true;
buildInputs = old.buildInputs ++ [
2023-03-22 19:05:48 +01:00
last.include-what-you-use
pkgs.gdb
last.nosv
last.nanos6
2022-10-04 19:52:43 +02:00
last.nodes
pkgs.strace
];
#preConfigure = ''
# export NODES_HOME="${last.nodes}"
# export NANOS6_HOME="${last.nanos6}"
#'';
});
ovni-nompi = last.ovni.overrideAttrs (old: {
buildInputs = pkgs.lib.filter (x: x != last.mpi ) old.buildInputs;
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
});
ovni-asan = last.ovni-rt.overrideAttrs (old: {
cmakeFlags = old.cmakeFlags ++ [ "-DCMAKE_BUILD_TYPE=Asan" ];
# Ignore leaks in tests for now, only check memory errors
preCheck = old.preCheck + ''
export ASAN_OPTIONS=detect_leaks=0
'';
});
});
in
2022-12-19 11:24:18 +01:00
pkgs // { bsc = bsc; }