Only enable MPI in ovni on native builds
Tested with: hut% nix build .#bsc-ci.all hut% nix build .#pkgsCross.riscv64.ovni Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es> Reviewed-by: Aleix Boné <aleix.boneribo@bsc.es>
This commit is contained in:
parent
e046363e52
commit
74e11db8b6
@ -9,6 +9,8 @@
|
||||
, gitUrl ? "ssh://git@bscpm03.bsc.es/rarias/ovni.git"
|
||||
, gitCommit ? "7a33deffb7aaae70527125d48428f22169c9d39e"
|
||||
, enableDebug ? false
|
||||
# Only enable MPI if the build is native (fails on cross-compilation)
|
||||
, useMpi ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
||||
}:
|
||||
|
||||
with lib;
|
||||
@ -43,9 +45,12 @@ in
|
||||
postPatch = ''
|
||||
patchShebangs --build test/
|
||||
'';
|
||||
nativeBuildInputs = [ cmake mpi ];
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = lib.optionals (useMpi) [ mpi ];
|
||||
cmakeBuildType = if (enableDebug) then "Debug" else "Release";
|
||||
cmakeFlags = [ "-DOVNI_GIT_COMMIT=${src.shortRev}" ];
|
||||
cmakeFlags = [
|
||||
"-DOVNI_GIT_COMMIT=${src.shortRev}"
|
||||
] ++ lib.optionals (!useMpi) [ "-DUSE_MPI=OFF" ];
|
||||
preCheck = ''
|
||||
export CTEST_OUTPUT_ON_FAILURE=1
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user