openmpi: use pkgsHostTarget for gfortran

This is very confusing. “stdenv” is created from the parent stage so
pkgsTargetTarget.stdenv.cc is a compiler that runs /on/ host platform
and creates binaries for target platform. gfortran on the other hand
is not special cased like stdenv, so the equivalent to
pkgsTargetTarget.stdenv.cc is pkgsHostTarget.gfortran.

I’ve rewritten this to be a little less confusing, “pkgsHostTarget” is
equivalent to “pkgs” so it is unneeded. All that is left is
“pkgsTargetTarget.stdenv” which is equivalent to
“targetPackages.stdenv”.

Fixes #88951

/cc @markuskowa @ericson2314
This commit is contained in:
Matthew Bauer 2020-05-26 16:30:04 -05:00
parent ac3128f22d
commit c60144d4c0

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchpatch, gfortran, perl, libnl { stdenv, fetchurl, fetchpatch, gfortran, perl, libnl
, rdma-core, zlib, numactl, libevent, hwloc, pkgsTargetTarget, symlinkJoin , rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin
, libpsm2, libfabric , libpsm2, libfabric
# Enable CUDA support # Enable CUDA support
@ -75,16 +75,16 @@ in stdenv.mkDerivation rec {
# default compilers should be indentical to the # default compilers should be indentical to the
# compilers at build time # compilers at build time
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc:' \ sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
$out/share/openmpi/mpicc-wrapper-data.txt $out/share/openmpi/mpicc-wrapper-data.txt
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc:' \ sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
$out/share/openmpi/ortecc-wrapper-data.txt $out/share/openmpi/ortecc-wrapper-data.txt
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++:' \ sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' \
$out/share/openmpi/mpic++-wrapper-data.txt $out/share/openmpi/mpic++-wrapper-data.txt
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.gfortran}/bin/${pkgsTargetTarget.gfortran.targetPrefix}gfortran:' \ sed -i 's:compiler=.*:compiler=${gfortran}/bin/${gfortran.targetPrefix}gfortran:' \
$out/share/openmpi/mpifort-wrapper-data.txt $out/share/openmpi/mpifort-wrapper-data.txt
''; '';