Fix mpich cross compilation and clean up tagaspi #213

Manually merged
abonerib merged 7 commits from abonerib/jungle:fix/cross-mpich into master 2025-10-31 16:27:20 +01:00
Showing only changes of commit 410040a4a0 - Show all commits

View File

@ -6,6 +6,12 @@
, pmix
, gfortran
, symlinkJoin
# Disabled when cross-compiling
# To fix cross compilation, we should fill the values in:
# https://github.com/pmodels/mpich/blob/main/maint/fcrosscompile/cross_values.txt.in
# For each arch
, enableFortran ? stdenv.hostPlatform == stdenv.buildPlatform
, perl
}:
let
@ -15,10 +21,13 @@ let
paths = [ pmix.dev pmix.out ];
};
in mpich.overrideAttrs (old: {
buildInput = old.buildInputs ++ [
buildInputs = old.buildInputs ++ [
libfabric
pmixAll
];
nativeBuildInputs = old.nativeBuildInputs ++ [
perl
];
configureFlags = [
"--enable-shared"
"--enable-sharedlib"
@ -31,7 +40,17 @@ in mpich.overrideAttrs (old: {
] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
"FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
"FCFLAGS=-fallow-argument-mismatch"
] ++ lib.optionals (!enableFortran) [
"--disable-fortran"
];
preFixup = ''
sed -i 's:^CC=.*:CC=gcc:' $out/bin/mpicc
sed -i 's:^CXX=.*:CXX=g++:' $out/bin/mpicxx
'' + lib.optionalString enableFortran ''
sed -i 's:^FC=.*:FC=gfortran:' $out/bin/mpifort
'';
abonerib marked this conversation as resolved Outdated

I noticed openmpi nixpkgs they use targetPacages.gfortran or gfortran daf6dc47aa/pkgs/by-name/op/openmpi/package.nix (L189)

Not sure if we should also do that in our openmpi.

I noticed openmpi nixpkgs they use `targetPacages.gfortran or gfortran` https://github.com/NixOS/nixpkgs/blob/daf6dc47aa4b44791372d6139ab7b25269184d55/pkgs/by-name/op/openmpi/package.nix#L189 Not sure if we should also do that in our openmpi.

Currently we don't use the openmpi package of jungle, so I wouldn't change it.

Currently we don't use the openmpi package of jungle, so I wouldn't change it.
hardeningDisable = [ "all" ];
meta = old.meta // {