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 2fff7e4a7b - Show all commits

View File

@ -12,6 +12,7 @@
# For each arch
, enableFortran ? stdenv.hostPlatform == stdenv.buildPlatform
, perl
, targetPackages
}:
let
@ -45,10 +46,10 @@ in mpich.overrideAttrs (old: {
];
preFixup = ''
sed -i 's:^CC=.*:CC=gcc:' $out/bin/mpicc
sed -i 's:^CXX=.*:CXX=g++:' $out/bin/mpicxx
sed -i 's:^CC=.*:CC=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' $out/bin/mpicc
sed -i 's:^CXX=.*:CXX=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' $out/bin/mpicxx
'' + lib.optionalString enableFortran ''
sed -i 's:^FC=.*:FC=gfortran:' $out/bin/mpifort
sed -i 's:^FC=.*:FC=${targetPackages.gfortran or gfortran}/bin/${targetPackages.gfortran.targetPrefix or gfortran.targetPrefix}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" ];