Add support for mcc and clang in Intel mpicc
This commit is contained in:
parent
a1f33444b5
commit
33a46f41ce
@ -6,7 +6,6 @@
|
|||||||
, enableDebug ? false
|
, enableDebug ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "intel-mpi-${version}";
|
name = "intel-mpi-${version}";
|
||||||
version = "2019.7.217";
|
version = "2019.7.217";
|
||||||
@ -31,31 +30,43 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
dontBuild = true;
|
buildInputs = [
|
||||||
installPhase = ''
|
rpmextract
|
||||||
mkdir -p $out
|
libfabric
|
||||||
rpmextract rpm/intel-mpi-*.rpm
|
patchelf
|
||||||
cd opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64
|
];
|
||||||
|
|
||||||
|
postUnpack = ''
|
||||||
|
pushd $sourceRoot
|
||||||
|
rpmextract rpm/intel-mpi-*.rpm
|
||||||
|
popd
|
||||||
|
'';
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./mpicc.patch
|
||||||
|
./mpicxx.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
for i in bin/mpi* ; do
|
for i in bin/mpi* ; do
|
||||||
sed -i "s:I_MPI_SUBSTITUTE_INSTALLDIR:$out:g" $i
|
sed -i "s:I_MPI_SUBSTITUTE_INSTALLDIR:$out:g" $i
|
||||||
done
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
cd opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64
|
||||||
|
mkdir -p $out
|
||||||
mv etc $out
|
mv etc $out
|
||||||
mv bin $out
|
mv bin $out
|
||||||
mv include $out
|
mv include $out
|
||||||
|
|
||||||
mkdir $out/lib
|
mkdir $out/lib
|
||||||
cp -a lib/lib* $out/lib
|
cp -a lib/lib* $out/lib
|
||||||
cp -a lib/${lib_variant}_mt/lib* $out/lib
|
cp -a lib/${lib_variant}_mt/lib* $out/lib
|
||||||
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
echo $out/lib contains:
|
|
||||||
ls -l $out/lib
|
|
||||||
echo ----------------------
|
|
||||||
find $out/bin -type f -executable -exec \
|
find $out/bin -type f -executable -exec \
|
||||||
patchelf \
|
patchelf \
|
||||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
@ -64,10 +75,4 @@ stdenv.mkDerivation rec {
|
|||||||
find $out/lib -name '*.so' -exec \
|
find $out/lib -name '*.so' -exec \
|
||||||
patchelf --set-rpath "$out/lib:${stdenv.cc}/lib:${stdenv.glibc}/lib:${libfabric}/lib" '{}' \;
|
patchelf --set-rpath "$out/lib:${stdenv.cc}/lib:${stdenv.glibc}/lib:${libfabric}/lib" '{}' \;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
rpmextract
|
|
||||||
libfabric
|
|
||||||
patchelf
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
20
bsc/intel-mpi/mpicc.patch
Normal file
20
bsc/intel-mpi/mpicc.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
--- a/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/bin/mpicc 2020-06-30 14:22:04.510566478 +0200
|
||||||
|
+++ b/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/bin/mpicc 2020-06-30 14:24:58.250998988 +0200
|
||||||
|
@@ -50,7 +50,7 @@
|
||||||
|
if [ x"$opt_args" == x"" ]; then
|
||||||
|
case "${compiler_short_name}" in
|
||||||
|
icc) $dir/mpiicc -cc=$compiler_name "$@" ;;
|
||||||
|
- cc|*gcc*) $dir/mpigcc -cc=$compiler_name "$@" ;;
|
||||||
|
+ cc|*gcc*|mcc|clang) $dir/mpigcc -cc=$compiler_name "$@" ;;
|
||||||
|
mpicc) $dir/mpigcc "$@" ;;
|
||||||
|
*)
|
||||||
|
echo "Error: unsupported compiler name '$compiler_name'."
|
||||||
|
@@ -60,7 +60,7 @@
|
||||||
|
else
|
||||||
|
case "${compiler_short_name}" in
|
||||||
|
icc) $dir/mpiicc -cc=$compiler_name "$@" $opt_args ;;
|
||||||
|
- cc|*gcc*) $dir/mpigcc -cc=$compiler_name "$@" $opt_args ;;
|
||||||
|
+ cc|*gcc*|mcc|clang) $dir/mpigcc -cc=$compiler_name "$@" $opt_args ;;
|
||||||
|
mpicc) $dir/mpigcc "$@" $opt_args ;;
|
||||||
|
*)
|
||||||
|
echo "Error: unsupported compiler name '$compiler_name'."
|
28
bsc/intel-mpi/mpicxx.patch
Normal file
28
bsc/intel-mpi/mpicxx.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
--- a/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/bin/mpicxx 2020-06-30 14:26:14.619723932 +0200
|
||||||
|
+++ b/opt/intel/compilers_and_libraries_2020.1.217/linux/mpi/intel64/bin/mpicxx 2020-06-30 14:27:56.644687134 +0200
|
||||||
|
@@ -49,9 +49,9 @@
|
||||||
|
|
||||||
|
if [ x"$opt_args" == x"" ]; then
|
||||||
|
case "${compiler_short_name}" in
|
||||||
|
- icc|icpc) $dir/mpiicpc -cxx=$compiler_name "$@" ;;
|
||||||
|
- *g++*) $dir/mpigxx -cxx=$compiler_name "$@" ;;
|
||||||
|
- mpicxx) $dir/mpigxx "$@" ;;
|
||||||
|
+ icc|icpc) $dir/mpiicpc -cxx=$compiler_name "$@" ;;
|
||||||
|
+ *g++*|clang*++|mcxx) $dir/mpigxx -cxx=$compiler_name "$@" ;;
|
||||||
|
+ mpicxx) $dir/mpigxx "$@" ;;
|
||||||
|
*)
|
||||||
|
echo "Error: unsupported compiler name '$compiler_name'."
|
||||||
|
echo "Check -cxx=<compiler_name> command line option and I_MPI_CXX='$I_MPI_CXX' and MPICH_CXX='$MPICH_CXX' variables.";
|
||||||
|
@@ -59,9 +59,9 @@
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
case "${compiler_short_name}" in
|
||||||
|
- icc|icpc) $dir/mpiicpc -cxx=$compiler_name "$@" $opt_args ;;
|
||||||
|
- *g++*) $dir/mpigxx -cxx=$compiler_name "$@" $opt_args ;;
|
||||||
|
- mpicxx) $dir/mpigxx "$@" $opt_args ;;
|
||||||
|
+ icc|icpc) $dir/mpiicpc -cxx=$compiler_name "$@" $opt_args ;;
|
||||||
|
+ *g++*|clang*++|mcxx) $dir/mpigxx -cxx=$compiler_name "$@" $opt_args ;;
|
||||||
|
+ mpicxx) $dir/mpigxx "$@" $opt_args ;;
|
||||||
|
*)
|
||||||
|
echo "Error: unsupported compiler name '$compiler_name'."
|
||||||
|
echo "Check -cxx=<compiler_name> command line option and I_MPI_CXX='$I_MPI_CXX' and MPICH_CXX='$MPICH_CXX' variables.";
|
Loading…
Reference in New Issue
Block a user