openmpi: use absolute paths compiler wrapper

The MPI compiler wrappers should point to the
compilers used at build time per default.
This commit is contained in:
Markus Kowalewski 2019-04-04 15:13:34 +02:00 committed by Bjørn Forsman
parent 2e363860c6
commit 3857d3d6f9

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchpatch, gfortran, perl, libnl
, rdma-core, zlib, numactl, libevent, hwloc
, rdma-core, zlib, numactl, libevent, hwloc, pkgsTargetTarget
# Enable the Sun Grid Engine bindings
, enableSGE ? false
@ -58,6 +58,23 @@ in stdenv.mkDerivation rec {
rm -f $out/lib/*.la
'';
postFixup = ''
# default compilers should be indentical to the
# compilers at build time
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc:' \
$out/share/openmpi/mpicc-wrapper-data.txt
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc:' \
$out/share/openmpi/ortecc-wrapper-data.txt
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++:' \
$out/share/openmpi/mpic++-wrapper-data.txt
sed -i 's:compiler=.*:compiler=${pkgsTargetTarget.gfortran}/bin/${pkgsTargetTarget.gfortran.targetPrefix}gfortran:' \
$out/share/openmpi/mpifort-wrapper-data.txt
'';
doCheck = true;
meta = with stdenv.lib; {