Fix nativeBuildInputs and add cross compilation target #10
@ -17,7 +17,7 @@
|
||||
legacyPackages.${system} = pkgs;
|
||||
|
||||
hydraJobs = {
|
||||
inherit (self.legacyPackages.${system}.bsc-ci) test pkgs;
|
||||
inherit (self.legacyPackages.${system}.bsc-ci) tests pkgs cross;
|
||||
};
|
||||
|
||||
|
abonerib marked this conversation as resolved
Outdated
|
||||
# propagate nixpkgs lib, so we can do bscpkgs.lib
|
||||
|
||||
53
overlay.nix
@ -6,9 +6,6 @@ with final.lib;
|
||||
let
|
||||
callPackage = final.callPackage;
|
||||
|
||||
mkDeps = name: pkgs: final.runCommand name { }
|
||||
"printf '%s\n' ${toString (collect (x: x ? outPath) pkgs)} > $out";
|
||||
|
||||
bscPkgs = {
|
||||
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
||||
bigotes = callPackage ./pkgs/bigotes/default.nix { };
|
||||
@ -49,13 +46,7 @@ let
|
||||
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
||||
};
|
||||
|
||||
in bscPkgs // {
|
||||
# Prevent accidental usage of bsc attribute
|
||||
bsc = throw "the bsc attribute is deprecated, packages are now in the root";
|
||||
|
||||
# Internal for our CI tests
|
||||
bsc-ci = {
|
||||
test = rec {
|
||||
tests = rec {
|
||||
#hwloc = callPackage ./test/bugs/hwloc.nix { }; # Broken, no /sys
|
||||
#sigsegv = callPackage ./test/reproducers/sigsegv.nix { };
|
||||
hello-c = callPackage ./test/compilers/hello-c.nix { };
|
||||
@ -90,17 +81,39 @@ in bscPkgs // {
|
||||
|
||||
pkgs = filterAttrs (_: isDerivation) bscPkgs;
|
||||
|
||||
pkgsList = final.runCommand "ci-pkgs" { }
|
||||
"printf '%s\n' ${toString (collect isDerivation bscPkgs)} > $out";
|
||||
crossTargets = [ "riscv64" ];
|
||||
cross = prev.lib.genAttrs crossTargets (target:
|
||||
final.pkgsCross.${target}.bsc-ci.pkgs
|
||||
);
|
||||
|
||||
tests = final.runCommand "ci-tests" { }
|
||||
"printf '%s\n' ${toString (collect isDerivation final.bsc-ci.test)} > $out";
|
||||
|
||||
all = final.runCommand "ci-all" { }
|
||||
''
|
||||
deps="${toString [ final.bsc-ci.pkgsList final.bsc-ci.tests ]}"
|
||||
cat $deps
|
||||
printf '%s\n' $deps > $out
|
||||
buildList = name: paths:
|
||||
final.runCommandLocal name { } ''
|
||||
printf '%s\n' ${toString paths} | tee $out
|
||||
'';
|
||||
|
||||
buildList' = name: paths:
|
||||
final.runCommandLocal name { } ''
|
||||
deps="${toString paths}"
|
||||
cat $deps
|
||||
printf '%s\n' $deps >$out
|
||||
'';
|
||||
|
||||
crossList = builtins.mapAttrs (t: v: buildList t (builtins.attrValues v)) cross;
|
||||
|
||||
pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgs);
|
||||
testList = buildList "ci-tests" (collect isDerivation tests);
|
||||
|
||||
all = buildList' "ci-all" [ pkgsList testList ];
|
||||
|
||||
in bscPkgs // {
|
||||
# Prevent accidental usage of bsc attribute
|
||||
bsc = throw "the bsc attribute is deprecated, packages are now in the root";
|
||||
|
||||
# Internal for our CI tests
|
||||
bsc-ci = {
|
||||
inherit pkgs pkgsList;
|
||||
inherit tests testList;
|
||||
|
abonerib marked this conversation as resolved
Outdated
abonerib
commented
We could rename We could rename `test -> tests` and `tests -> testsList` for consistency.
|
||||
inherit cross crossList;
|
||||
inherit all;
|
||||
};
|
||||
}
|
||||
|
||||
@ -27,10 +27,13 @@ stdenv.mkDerivation rec {
|
||||
rev = gitCommit;
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
bigotes
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
clangOmpss2
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
bigotes
|
||||
openmp
|
||||
openmpv
|
||||
nanos6
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
, cmake
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation {
|
||||
pname = "bigotes";
|
||||
version = "9dce13";
|
||||
src = fetchFromGitHub {
|
||||
@ -13,5 +13,5 @@ stdenv.mkDerivation rec {
|
||||
rev = "9dce13446a8da30bea552d569d260d54e0188518";
|
||||
sha256 = "sha256-ktxM3pXiL8YXSK+/IKWYadijhYXqGoLY6adLk36iigE=";
|
||||
};
|
||||
buildInputs = [ cmake ];
|
||||
nativeBuildInputs = [ cmake ];
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ let
|
||||
uncompressDebs = debs: name: stdenv.mkDerivation {
|
||||
name = name;
|
||||
srcs = debs;
|
||||
buildInputs = [ dpkg ];
|
||||
nativeBuildInputs = [ dpkg ];
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
@ -108,14 +108,17 @@ let
|
||||
"intel-oneapi-mpi-${version}"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
rsync
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libfabric
|
||||
zlib
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
phases = [ "installPhase" "fixupPhase" ];
|
||||
dontStrip = true;
|
||||
installPhase = ''
|
||||
@ -154,7 +157,6 @@ let
|
||||
|
||||
buildInputs = [
|
||||
intel-mpi
|
||||
rsync
|
||||
libffi_3_3
|
||||
libelf
|
||||
libxml2
|
||||
@ -162,7 +164,10 @@ let
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
rsync
|
||||
];
|
||||
phases = [ "installPhase" "fixupPhase" ];
|
||||
dontStrip = true;
|
||||
|
||||
@ -192,7 +197,6 @@ let
|
||||
buildInputs = [
|
||||
intel-mpi
|
||||
intel-tbb
|
||||
rsync
|
||||
libffi_3_3
|
||||
libelf
|
||||
libxml2
|
||||
@ -201,7 +205,10 @@ let
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
rsync
|
||||
];
|
||||
phases = [ "installPhase" "fixupPhase" ];
|
||||
dontStrip = true;
|
||||
|
||||
@ -254,7 +261,6 @@ let
|
||||
buildInputs = [
|
||||
intel-mpi
|
||||
intel-compiler-shared
|
||||
rsync
|
||||
libffi_3_3
|
||||
libelf
|
||||
libxml2
|
||||
@ -262,7 +268,10 @@ let
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
rsync
|
||||
];
|
||||
|
||||
phases = [ "installPhase" "fixupPhase" ];
|
||||
|
||||
@ -337,7 +346,6 @@ let
|
||||
|
||||
buildInputs = [
|
||||
intel-compiler-shared
|
||||
rsync
|
||||
libffi_3_3
|
||||
libelf
|
||||
libxml2
|
||||
@ -345,7 +353,10 @@ let
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
rsync
|
||||
];
|
||||
autoPatchelfIgnoreMissingDeps = [ "libtbb.so.12" "libtbbmalloc.so.2" "libze_loader.so.1" ];
|
||||
|
||||
phases = [ "installPhase" "fixupPhase" ];
|
||||
|
||||
@ -43,32 +43,36 @@ let
|
||||
|
||||
source = if (useGit) then git else release;
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
in stdenv.mkDerivation {
|
||||
pname = "clang-ompss2";
|
||||
inherit (source) src version;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
isClang = true;
|
||||
|
||||
passthru = {
|
||||
CC = "clang";
|
||||
CXX = "clang++";
|
||||
};
|
||||
|
||||
isClang = true;
|
||||
isClangWithOmpss = true;
|
||||
|
||||
nativeBuildInputs = [ zlib ];
|
||||
inherit gcc zlib;
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
which
|
||||
nativeBuildInputs = [
|
||||
bash
|
||||
cmake
|
||||
elfutils
|
||||
llvmPackages_latest.lld
|
||||
pkg-config
|
||||
python3
|
||||
perl
|
||||
cmake
|
||||
llvmPackages_latest.lld
|
||||
elfutils
|
||||
which
|
||||
zlib
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libffi
|
||||
pkg-config
|
||||
zlib
|
||||
gcc.cc.lib # Required for libstdc++.so.6
|
||||
];
|
||||
|
||||
@ -32,19 +32,22 @@ stdenv.mkDerivation rec {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
nanos6
|
||||
gperf
|
||||
bison
|
||||
flex
|
||||
python3
|
||||
gfortran
|
||||
pkg-config
|
||||
sqlite.dev
|
||||
bison
|
||||
flex
|
||||
gperf
|
||||
gcc
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
nanos6
|
||||
sqlite.dev
|
||||
];
|
||||
|
||||
patches = [ ./intel.patch ];
|
||||
|
||||
preConfigure = ''
|
||||
|
||||
@ -88,11 +88,19 @@ in
|
||||
dontStrip = enableDebug;
|
||||
separateDebugInfo = true;
|
||||
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
autoconf
|
||||
automake
|
||||
libtool
|
||||
pkg-config
|
||||
|
||||
# TODO: papi_version is needed for configure:
|
||||
# ./configure: line 27378: papi_version: command not found
|
||||
# This probably breaks cross-compilation
|
||||
papi
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
|
rarias marked this conversation as resolved
Outdated
rarias
commented
Just a comment so I don't forget, it may be doable to fix nanos6 so that it takes the PAPI version from the .pc file: https://github.com/bsc-pm/nanos6/blob/master/m4/papi.m4#L25 Just a comment so I don't forget, it may be doable to fix nanos6 so that it takes the PAPI version from the .pc file:
https://github.com/bsc-pm/nanos6/blob/master/m4/papi.m4#L25
https://github.com/icl-utk-edu/papi/blob/master/src/papi.pc.in#L8
abonerib
commented
Even if we fix this, papi does not cross-compile to risc-v. I tried to fix it, adding the needed configuration flags for cross compilation, but it still fails because it misses some instructions:
Even if we fix this, papi does not cross-compile to risc-v.
I tried to fix it, adding the needed configuration flags for cross compilation, but it still fails because it misses some instructions:
```
mb.h:67:2: error: #error Need to define rmb for this architecture!
```
rarias
commented
It seems they recently added support for RISC-V, but we use 7.1.0 which is too old: I'll prefer waiting until the next release of nixos, unless we need to backport it. It seems they recently added support for RISC-V, but we use 7.1.0 which is too old:
https://github.com/icl-utk-edu/papi/commit/b464420f3a2855b2c800413a4c5767b69e088087
I'll prefer waiting until the next release of nixos, unless we need to backport it.
|
||||
numactl
|
||||
hwloc
|
||||
|
||||
@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
doCheck = true;
|
||||
enableParallelBuilding = true;
|
||||
nativeBuildInputs = [ mpiAll ];
|
||||
buildInputs = [ mpiAll ];
|
||||
hardeningDisable = [ "all" ];
|
||||
configureFlags = [
|
||||
@ -40,7 +41,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
meta = {
|
||||
description = "OSU Micro-Benchmarks";
|
||||
homepage = http://mvapich.cse.ohio-state.edu/benchmarks/;
|
||||
homepage = "http://mvapich.cse.ohio-state.edu/benchmarks/";
|
||||
maintainers = [ ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
|
||||
@ -13,8 +13,6 @@
|
||||
, useMpi ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
release = rec {
|
||||
version = "1.12.0";
|
||||
@ -45,7 +43,7 @@ in
|
||||
postPatch = ''
|
||||
patchShebangs --build test/
|
||||
'';
|
||||
nativeBuildInputs = [ cmake ];
|
||||
nativeBuildInputs = [ cmake ] ++ lib.optionals (useMpi) [ mpi ];
|
||||
|
rarias marked this conversation as resolved
Outdated
rarias
commented
Wouldn't we need mpi in buildInputs as well? I'm not sure how it works under the hood but it needs to pick the mpi libraries for the host architecture as if mpi were in buildInputs. I'm building Wouldn't we need mpi in buildInputs as well? I'm not sure how it works under the hood but it needs to pick the mpi libraries for the host architecture as if mpi were in buildInputs. I'm building `.#pkgsCross.riscv64.ovni` with useMPI to true to see what happens.
abonerib
commented
I don't know either. We have I don't know either. We have `useMpi ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform)` so by default we won't have mpi when cross compiling between architectures (not sure how binfmt emulation works with canExecute)
rarias
commented
It doesn't seem to be able to find MPI: I'll test adding it in buildInputs only, as I think cmake only looks for the libmpi.so library, it doesn't use the mpicc wrapper.
It doesn't rely on that, is done in evaluation time based on the architeture tuples: It doesn't seem to be able to find MPI:
```
hut% nix log /nix/store/3il3bv2igpfzccfrd8zjwxd30s0lq2w9-ovni-riscv64-unknown-linux-gnu-1.12.0.drv | tail
-- Could NOT find MPI_C (missing: MPI_C_WORKS)
CMake Error at /nix/store/29ax4k0a83zhz43lb73cv610d95wdsx1-cmake-3.31.6/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find MPI (missing: MPI_C_FOUND)
Call Stack (most recent call first):
/nix/store/29ax4k0a83zhz43lb73cv610d95wdsx1-cmake-3.31.6/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/nix/store/29ax4k0a83zhz43lb73cv610d95wdsx1-cmake-3.31.6/share/cmake-3.31/Modules/FindMPI.cmake:1842 (find_package_handle_standard_args)
src/emu/CMakeLists.txt:107 (find_package)
-- Configuring incomplete, errors occurred!
```
I'll test adding it in buildInputs only, as I think cmake only looks for the libmpi.so library, it doesn't use the mpicc wrapper.
> not sure how binfmt emulation works with canExecute
It doesn't rely on that, is done in evaluation time based on the architeture tuples:
https://github.com/NixOS/nixpkgs/blob/a19a8e52c326b80a2c203724ed68c7e16b365683/lib/systems/default.nix#L95
https://github.com/NixOS/nixpkgs/blob/a19a8e52c326b80a2c203724ed68c7e16b365683/lib/systems/parse.nix#L436
|
||||
buildInputs = lib.optionals (useMpi) [ mpi ];
|
||||
cmakeBuildType = if (enableDebug) then "Debug" else "Release";
|
||||
cmakeFlags = [
|
||||
|
||||
@ -60,17 +60,17 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoconf
|
||||
automake
|
||||
autoreconfHook
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
autoreconfHook
|
||||
boost
|
||||
libxml2.dev
|
||||
xml2
|
||||
wx
|
||||
autoconf
|
||||
automake
|
||||
paraverKernel
|
||||
openssl.dev
|
||||
];
|
||||
|
||||
@ -44,14 +44,17 @@ stdenv.mkDerivation rec {
|
||||
"--enable-openmp"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
boost
|
||||
libxml2.dev
|
||||
xml2
|
||||
autoconf
|
||||
automake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
libxml2.dev
|
||||
xml2
|
||||
zlib
|
||||
];
|
||||
}
|
||||
|
||||
@ -61,13 +61,16 @@ stdenv.mkDerivation rec {
|
||||
"--with-wx-config=${wx}/bin/wx-config"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoconf
|
||||
automake
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
xml2
|
||||
libxml2.dev
|
||||
wx
|
||||
autoconf
|
||||
automake
|
||||
openssl.dev
|
||||
];
|
||||
|
||||
|
||||
@ -18,8 +18,12 @@ stdenv.mkDerivation rec {
|
||||
hardeningDisable = [ "all" ];
|
||||
dontStrip = true;
|
||||
configureFlags = [ "--with-ovni=${ovni}" ];
|
||||
buildInputs = [
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
ovni
|
||||
mpi
|
||||
];
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
, gnumake
|
||||
, boost
|
||||
, mpi
|
||||
, gcc
|
||||
, autoreconfHook
|
||||
, enableOvni ? true
|
||||
, ovni ? null
|
||||
@ -41,20 +40,23 @@ let
|
||||
};
|
||||
};
|
||||
source = if (useGit) then git else release;
|
||||
in stdenv.mkDerivation rec {
|
||||
in stdenv.mkDerivation {
|
||||
pname = "tampi";
|
||||
inherit (source) src version;
|
||||
enableParallelBuilding = true;
|
||||
separateDebugInfo = true;
|
||||
buildInputs = [
|
||||
autoreconfHook
|
||||
automake
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoconf
|
||||
libtool
|
||||
automake
|
||||
autoreconfHook
|
||||
gnumake
|
||||
libtool
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
mpi
|
||||
gcc
|
||||
] ++ optional (enableOvni) ovni;
|
||||
configureFlags = optional (enableOvni) "--with-ovni=${ovni}";
|
||||
dontDisableStatic = true;
|
||||
|
||||
@rarias do you want to add this to
bsc-ci.crossalso?It would be great to have some target that we can build by hand that includes bsc cross packages. Maybe something like this?