Fix nativeBuildInputs and add cross compilation target #10
@ -13,8 +13,6 @@
|
|||||||
, useMpi ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
, useMpi ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
release = rec {
|
release = rec {
|
||||||
version = "1.12.0";
|
version = "1.12.0";
|
||||||
@ -45,7 +43,7 @@ in
|
|||||||
postPatch = ''
|
postPatch = ''
|
||||||
patchShebangs --build test/
|
patchShebangs --build test/
|
||||||
'';
|
'';
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ] ++ lib.optionals (useMpi) [ mpi ];
|
||||||
|
rarias marked this conversation as resolved
Outdated
|
|||||||
buildInputs = lib.optionals (useMpi) [ mpi ];
|
buildInputs = lib.optionals (useMpi) [ mpi ];
|
||||||
cmakeBuildType = if (enableDebug) then "Debug" else "Release";
|
cmakeBuildType = if (enableDebug) then "Debug" else "Release";
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
|
|||||||
Reference in New Issue
Block a user
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.ovniwith useMPI to true to see what happens.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)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:
a19a8e52c3/lib/systems/default.nix (L95)a19a8e52c3/lib/systems/parse.nix (L436)