2023-10-03 12:44:27 +02:00
|
|
|
{
|
|
|
|
inputs.nixpkgs.url = "nixpkgs";
|
|
|
|
inputs.bscpkgs.url = "git+https://git.sr.ht/~rodarima/bscpkgs";
|
|
|
|
inputs.bscpkgs.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
nixConfig.bash-prompt = "\[nix-develop\]$ ";
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, bscpkgs }:
|
|
|
|
let
|
2024-01-16 12:21:16 +01:00
|
|
|
# Set to true to replace all libovni in all runtimes with the current
|
|
|
|
# source. Causes large rebuilds on changes of ovni.
|
|
|
|
useLocalOvni = false;
|
|
|
|
|
2023-12-05 16:56:12 +01:00
|
|
|
ovniOverlay = final: prev: {
|
|
|
|
nosv = prev.nosv.override {
|
|
|
|
useGit = true;
|
|
|
|
gitBranch = "master";
|
2024-06-13 09:53:42 +02:00
|
|
|
gitCommit = "c668e3bbfae34cd9b8797811b29ae35361b267ca";
|
2023-12-05 16:56:12 +01:00
|
|
|
};
|
|
|
|
nanos6 = prev.nanos6.override {
|
|
|
|
useGit = true;
|
|
|
|
gitBranch = "master";
|
2023-12-18 17:15:25 +01:00
|
|
|
gitCommit = "21fccec383a4136daf5919093a6ffcdc8c139bfe";
|
2023-12-05 16:56:12 +01:00
|
|
|
};
|
|
|
|
nodes = prev.nodes.override {
|
|
|
|
useGit = true;
|
|
|
|
gitBranch = "master";
|
|
|
|
gitCommit = "70ce0ed0a20842d8eb3124aa5db5916fb6fc238f";
|
|
|
|
};
|
2024-01-16 12:21:16 +01:00
|
|
|
clangOmpss2Unwrapped = prev.clangOmpss2Unwrapped.override {
|
|
|
|
useGit = true;
|
|
|
|
gitBranch = "master";
|
2024-03-15 15:08:16 +01:00
|
|
|
gitCommit = "b813108e2810c235480688ed7d1b0f1faf76e804";
|
2024-01-16 12:21:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Use a fixed commit for libovni
|
|
|
|
ovniFixed = prev.ovni.override {
|
|
|
|
useGit = true;
|
|
|
|
gitBranch = "master";
|
2024-06-13 09:53:42 +02:00
|
|
|
# Includes ovni_attr_* API
|
|
|
|
gitCommit = "d1e8a62396ae92934c0b6e248d5f6ff921bef56f";
|
2024-01-16 12:21:16 +01:00
|
|
|
};
|
2023-12-05 16:56:12 +01:00
|
|
|
# Build with the current source
|
2024-01-16 12:21:16 +01:00
|
|
|
ovniLocal = prev.ovni.overrideAttrs (old: rec {
|
2023-12-05 16:56:12 +01:00
|
|
|
pname = "ovni-local";
|
|
|
|
version = if self ? shortRev then self.shortRev else "dirty";
|
|
|
|
src = self;
|
|
|
|
cmakeFlags = [ "-DOVNI_GIT_COMMIT=${version}" ];
|
|
|
|
});
|
2024-01-16 12:21:16 +01:00
|
|
|
# Select correct ovni for libovni
|
|
|
|
ovni = if (useLocalOvni) then final.ovniLocal else final.ovniFixed;
|
2023-12-05 16:56:12 +01:00
|
|
|
};
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
overlays = [
|
|
|
|
bscpkgs.bscOverlay
|
|
|
|
ovniOverlay
|
|
|
|
];
|
|
|
|
};
|
2023-10-03 12:44:27 +02:00
|
|
|
compilerList = with pkgs; [
|
|
|
|
#gcc49Stdenv # broken
|
|
|
|
gcc6Stdenv
|
|
|
|
gcc7Stdenv
|
|
|
|
gcc8Stdenv
|
|
|
|
gcc9Stdenv
|
|
|
|
gcc10Stdenv
|
|
|
|
gcc11Stdenv
|
|
|
|
gcc12Stdenv
|
|
|
|
gcc13Stdenv
|
|
|
|
];
|
|
|
|
lib = pkgs.lib;
|
|
|
|
in {
|
2024-01-16 12:21:16 +01:00
|
|
|
packages.x86_64-linux.ovniPackages = {
|
|
|
|
# Allow inspection of packages from the command line
|
|
|
|
inherit pkgs;
|
|
|
|
} // rec {
|
2023-10-03 12:44:27 +02:00
|
|
|
# Build with the current source
|
2024-01-16 12:21:16 +01:00
|
|
|
local = pkgs.ovniLocal;
|
2023-10-03 12:44:27 +02:00
|
|
|
|
|
|
|
# Build in Debug mode
|
|
|
|
debug = local.overrideAttrs (old: {
|
|
|
|
pname = "ovni-debug";
|
|
|
|
cmakeBuildType = "Debug";
|
|
|
|
});
|
|
|
|
|
|
|
|
# Without MPI
|
|
|
|
nompi = local.overrideAttrs (old: {
|
|
|
|
pname = "ovni-nompi";
|
|
|
|
buildInputs = lib.filter (x: x != pkgs.mpi ) old.buildInputs;
|
|
|
|
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
|
|
|
|
});
|
|
|
|
|
|
|
|
# Helper function to build with different compilers
|
|
|
|
genOvniCC = stdenv: (local.override {
|
|
|
|
stdenv = stdenv;
|
|
|
|
}).overrideAttrs (old: {
|
|
|
|
name = "ovni-gcc" + stdenv.cc.cc.version;
|
|
|
|
cmakeFlags = old.cmakeFlags ++ [
|
|
|
|
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF"
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
# Test several gcc versions
|
|
|
|
compilers = let
|
|
|
|
drvs = map genOvniCC compilerList;
|
|
|
|
in pkgs.runCommand "ovni-compilers" { } ''
|
|
|
|
printf "%s\n" ${builtins.toString drvs} > $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Enable RT tests
|
|
|
|
rt = (local.override {
|
|
|
|
# Provide the clang compiler as default
|
|
|
|
stdenv = pkgs.stdenvClangOmpss2;
|
|
|
|
}).overrideAttrs (old: {
|
|
|
|
pname = "ovni-rt";
|
|
|
|
# We need to be able to exit the chroot to run Nanos6 tests, as they
|
|
|
|
# require access to /sys for hwloc
|
|
|
|
__noChroot = true;
|
2024-01-16 12:21:16 +01:00
|
|
|
buildInputs = old.buildInputs ++ (with pkgs; [ pkg-config nosv nanos6 nodes openmpv ]);
|
2023-10-03 12:44:27 +02:00
|
|
|
cmakeFlags = old.cmakeFlags ++ [ "-DENABLE_ALL_TESTS=ON" ];
|
|
|
|
preConfigure = old.preConfigure or "" + ''
|
2023-12-05 16:56:12 +01:00
|
|
|
export NOSV_HOME="${pkgs.nosv}"
|
2023-10-03 12:44:27 +02:00
|
|
|
export NODES_HOME="${pkgs.nodes}"
|
|
|
|
export NANOS6_HOME="${pkgs.nanos6}"
|
2024-01-16 12:21:16 +01:00
|
|
|
export OPENMP_RUNTIME="libompv"
|
2023-10-03 12:44:27 +02:00
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
# Build with ASAN and pass RT tests
|
|
|
|
asan = rt.overrideAttrs (old: {
|
|
|
|
pname = "ovni-asan";
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
});
|
2024-06-21 11:30:29 +02:00
|
|
|
|
2024-07-29 13:09:41 +02:00
|
|
|
ubsan = rt.overrideAttrs (old: {
|
|
|
|
pname = "ovni-ubsan";
|
|
|
|
cmakeFlags = old.cmakeFlags ++ [ "-DCMAKE_BUILD_TYPE=Ubsan" ];
|
|
|
|
});
|
|
|
|
|
2024-06-21 11:30:29 +02:00
|
|
|
armv7 = (pkgs.pkgsCross.armv7l-hf-multiplatform.ovniLocal.overrideAttrs (old: {
|
|
|
|
pname = "ovni-armv7";
|
|
|
|
buildInputs = [];
|
|
|
|
nativeBuildInputs = [ pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.cmake ];
|
|
|
|
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
|
|
|
|
})).overrideDerivation (old: {
|
|
|
|
doCheck = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
aarch64 = (pkgs.pkgsCross.aarch64-multiplatform.ovniLocal.overrideAttrs (old: {
|
|
|
|
pname = "ovni-aarch64";
|
|
|
|
buildInputs = [];
|
|
|
|
nativeBuildInputs = [ pkgs.pkgsCross.aarch64-multiplatform.buildPackages.cmake ];
|
|
|
|
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
|
|
|
|
})).overrideDerivation (old: {
|
|
|
|
doCheck = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
riscv64 = (pkgs.pkgsCross.riscv64.ovniLocal.overrideAttrs (old: {
|
|
|
|
pname = "ovni-riscv64";
|
|
|
|
buildInputs = [];
|
|
|
|
nativeBuildInputs = [ pkgs.pkgsCross.riscv64.buildPackages.cmake ];
|
|
|
|
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
|
|
|
|
})).overrideDerivation (old: {
|
|
|
|
doCheck = true;
|
|
|
|
});
|
2023-10-03 12:44:27 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|