From a3bc982a2ee7e1fc794710386f0ec2986d2f868a Mon Sep 17 00:00:00 2001 From: jcsiadal Date: Fri, 5 May 2023 00:04:35 -0700 Subject: [PATCH] Update oneAPI install Signed-off-by: jcsiadal --- .../SOURCES/mod_generator.sh | 103 ------- .../SOURCES/modfile-ohpc.input | 23 -- .../SPECS/intel-compilers-devel.spec | 205 +------------- .../impi-devel/SOURCES/mod_generator_impi.sh | 103 ------- .../impi-devel/SPECS/intel-mpi.spec | 265 +----------------- 5 files changed, 27 insertions(+), 672 deletions(-) delete mode 100755 components/compiler-families/intel-compilers-devel/SOURCES/mod_generator.sh delete mode 100644 components/compiler-families/intel-compilers-devel/SOURCES/modfile-ohpc.input delete mode 100755 components/mpi-families/impi-devel/SOURCES/mod_generator_impi.sh diff --git a/components/compiler-families/intel-compilers-devel/SOURCES/mod_generator.sh b/components/compiler-families/intel-compilers-devel/SOURCES/mod_generator.sh deleted file mode 100755 index 25fe5be351..0000000000 --- a/components/compiler-families/intel-compilers-devel/SOURCES/mod_generator.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -# -# OpenHPC build script/utilities -# -#----------------------------------------------------------------------- -# Licensed under the Apache License, Version 2.0 (the "License"); you -# may not use this file except in compliance with the License. You may -# obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. See the License for the specific language governing -# permissions and limitations under the License. -#----------------------------------------------------------------------- -# Utility to derive modules environment variable settings from shell -# script initialization file. -#----------------------------------------------------------------------- - -if [ $# -lt 1 ];then - echo "Usage: $0 args" - exit 1 -fi - -# environment variables to ignore - -ignoreVars="^SHLVL=|^INTEL_LICENSE_FILE=|^PWD=|^_=|^WARNING:" - -inFile=$1 -shift -export remainArgs="$@" - -if [ ! -s $inFile ];then - echo "$inFile not available locally" - exit 1 -fi - -TMPFILE=/tmp/mod_generator.$RANDOM -OUTFILE=$TMPFILE.out - -cat < $TMPFILE -#!/bin/bash -unset LD_LIBRARY_PATH -unset LIBRARY_PATH - -MYPATH=\${PATH} - -#source $inFile "$remainArgs" >& /dev/null -source $inFile ${remainArgs} >& /dev/null - -/usr/bin/printenv | sed s!:\${MYPATH}!! -EOF - - -chmod 700 $TMPFILE || exit 1 - -env -i $TMPFILE | egrep -v $ignoreVars > $OUTFILE - -if [ ! -s $OUTFILE ];then - echo "No environment variables detected" - exit 1 -fi - -maxLen=0 - -# scan for max variable name length - -for var in `cat $OUTFILE`; do - locLen=`echo $var | awk -F = '{print $1}'| wc -m` || exit 1 - - if [ $locLen -gt $maxLen ];then - maxLen=$locLen - fi -done - -echo " " -echo "# OpenHPC machine generated from `basename $inFile`" - -while read var ; do - varName=`echo $var | awk -F = '{print $1}'` || exit 1 - varDef=`echo $var | awk -F = '{print $2}'` || exit 1 - - echo $varName | egrep -q "PATH" - - if [ $? -eq 0 ];then - printf "%-13s %-${maxLen}s %s\n" "prepend-path" $varName $varDef - else - # check if this variable needs extra quoting (say because it includes spaces) - - echo "$varDef" | egrep -q '\s' - if [ $? -eq 0 ];then - printf "%-13s %-${maxLen}s \"%s\"\n" "setenv" $varName "$varDef" - else - printf "%-13s %-${maxLen}s %s\n" "setenv" $varName "$varDef" - fi - fi -done < $OUTFILE - -echo "# end of machine generated" -echo " " - diff --git a/components/compiler-families/intel-compilers-devel/SOURCES/modfile-ohpc.input b/components/compiler-families/intel-compilers-devel/SOURCES/modfile-ohpc.input deleted file mode 100644 index 53a600f16f..0000000000 --- a/components/compiler-families/intel-compilers-devel/SOURCES/modfile-ohpc.input +++ /dev/null @@ -1,23 +0,0 @@ -# machine generated from compilervars.sh - -setenv MKLROOT /opt/intel/compilers_and_libraries_2016.3.210/linux/mkl -prepend-path MANPATH /opt/intel/compilers_and_libraries_2016.3.210/linux/documentation/en/man/common/:/opt/intel/documentation_2016/en/debugger//gdb-ia/man/:/opt/intel/documentation_2016/en/debugger//gdb-mic/man/:/opt/intel/documentation_2016/en/debugger//gdb-igfx/man/ -setenv IPPROOT /opt/intel/compilers_and_libraries_2016.3.210/linux/ipp -setenv GDBSERVER_MIC /opt/intel/debugger_2016/gdb/targets/mic/bin/gdbserver -prepend-path LIBRARY_PATH /opt/intel/compilers_and_libraries_2016.3.210/linux/ipp/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/intel64/gcc4.4:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/lib/intel64_lin:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/../tbb/lib/intel64_lin/gcc4.4:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/../compiler/lib/intel64_lin -prepend-path MIC_LD_LIBRARY_PATH /opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/mic:/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/mic/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/mic:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/mic:/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/mic -prepend-path LD_LIBRARY_PATH /opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2016.3.210/linux/ipp/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64:/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/intel64/gcc4.4:/opt/intel/debugger_2016/libipt/intel64/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/lib/intel64_lin:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/../tbb/lib/intel64_lin/gcc4.4:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/../compiler/lib/intel64_lin -prepend-path MIC_LIBRARY_PATH /opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/mic:/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/mic/lib:/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/lib/mic -prepend-path CPATH /opt/intel/compilers_and_libraries_2016.3.210/linux/ipp/include:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/include:/opt/intel/compilers_and_libraries_2016.3.210/linux/tbb/include:/opt/intel/compilers_and_libraries_2016.3.210/linux/daal/include -prepend-path NLSPATH /opt/intel/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64/locale/%l_%t/%N:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/locale/%l_%t/%N:/opt/intel/debugger_2016/gdb/intel64_mic/share/locale/%l_%t/%N:/opt/intel/debugger_2016/gdb/intel64/share/locale/%l_%t/%N -prepend-path PATH /opt/intel/compilers_and_libraries_2016.3.210/linux/bin/intel64:/opt/intel/debugger_2016/gdb/intel64_mic/bin -setenv TBBROOT /opt/intel/compilers_and_libraries_2016.3.210/linux/tbb -setenv GDB_CROSS /opt/intel/debugger_2016/gdb/intel64_mic/bin/gdb-mic -setenv DAALROOT /opt/intel/compilers_and_libraries_2016.3.210/linux/daal -setenv MPM_LAUNCHER /opt/intel/debugger_2016/mpm/mic/bin/start_mpm.sh -setenv INTEL_PYTHONHOME /opt/intel/debugger_2016/python/intel64/ -prepend-path CLASSPATH /opt/intel/compilers_and_libraries_2016.3.210/linux/daal/lib/daal.jar -prepend-path INFOPATH /opt/intel/documentation_2016/en/debugger//gdb-ia/info/:/opt/intel/documentation_2016/en/debugger//gdb-mic/info/:/opt/intel/documentation_2016/en/debugger//gdb-igfx/info/ - -# end of machine generated - diff --git a/components/compiler-families/intel-compilers-devel/SPECS/intel-compilers-devel.spec b/components/compiler-families/intel-compilers-devel/SPECS/intel-compilers-devel.spec index d2c55c5d0b..313602c424 100644 --- a/components/compiler-families/intel-compilers-devel/SPECS/intel-compilers-devel.spec +++ b/components/compiler-families/intel-compilers-devel/SPECS/intel-compilers-devel.spec @@ -13,9 +13,12 @@ %define pname intel-compilers-devel %define keyname GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB %define oneapi_manifest %{OHPC_MODULES}/intel/.rpm-manifest -%define psxe_manifest %{OHPC_MODULES}/intel/.manifest -%define min_intel_ver 2021.4.0 - +# Using a minimum version has been problematic as DNF will happily +# install newer versions during build time. If the user has the minimum +# version, but the build system was already using a newer version, then +# the resulting binaries might rely on symbols which are not present +# in the minimum version. Newer versions may still be installed in parallel. +%define exact_intel_ver 2023.1.0 Summary: OpenHPC compatibility package for Intel(R) oneAPI HPC Toolkit Name: %{pname}%{PROJ_DELIM} @@ -26,18 +29,17 @@ URL: https://github.com/openhpc/ohpc Group: %{PROJ_NAME}/compiler-families BuildArch: x86_64 AutoReq: no -Source1: mod_generator.sh -Source2: oneAPI.repo +Source1: oneAPI.repo #!BuildIgnore: post-build-checks Requires: gcc libstdc++-devel -Requires(pre): intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic >= %{min_intel_ver} -Requires: intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic >= %{min_intel_ver} -Requires: intel-oneapi-mkl intel-oneapi-mkl-devel -Requires: intel-oneapi-compiler-fortran -Recommends: intel-hpckit >= %{min_intel_vers} +Requires(pre): intel-oneapi-dpcpp-cpp-%{exact_intel_ver} +Requires: intel-oneapi-dpcpp-cpp-%{exact_intel_ver} +Requires: intel-oneapi-mkl-devel-%{exact_intel_ver} +Requires: intel-oneapi-compiler-fortran-%{exact_intel_ver} +Recommends: intel-hpckit >= %{exact_intel_ver} %description Provides OpenHPC-style compatible modules for use with the Intel(R) oneAPI @@ -56,10 +58,7 @@ HPC Toolkit. %endif # Install RPM key and yum repo -install -D -m644 %{SOURCE2} -t %{buildroot}%{repodir}/ - -# Mod generator for PSXE support -install -D -m755 %{SOURCE1} %{buildroot}/%{OHPC_ADMIN}/compat/modulegen/mod_generator.sh +install -D -m644 %{SOURCE1} -t %{buildroot}%{repodir}/ # Module directories mkdir -p %{buildroot}/%{OHPC_MODULEDEPS}/oneapi @@ -215,181 +214,7 @@ Summary: Intel(R) oneAPI HPC Toolkit Repository Setup %description -n intel-oneapi-toolkit-release%{PROJ_DELIM} Installs and configures the online repository for the Intel(R) oneAPI Toolkit. - +m %files -n intel-oneapi-toolkit-release%{PROJ_DELIM} -%{repodir}/%{basename:%{SOURCE2}} - -################################################################################ - -%define psxemod intel-psxe-compilers-devel%{PROJ_DELIM} - -%package -n %{psxemod} -Summary: OpenHPC compatibility package for Intel(R) Parallel Studio XE - -Obsoletes: %pname%{PROJ_DELIM} < %{version} - -%description -n %{psxemod} -Provides OpenHPC-style compatible modules for use with the Intel(R) Parallel -Studio compiler suite. - - -%pre -n %{psxemod} -p /bin/bash -# Since OpenHPC 2.0 will not upgrade 1.x, there's no need for -# older intel-compilers-devel upgrade patches - -# Verify psxe compilers are installed. Punt if not detected. -echo "Checking for local PSXE compiler installation(s)." -icc_subpath="linux/bin/intel64/icc$" -versions_all=$(rpm -qal | grep "${icc_subpath}" | grep -v "oneapi") - -if [ $? -eq 1 ];then - echo " " - echo "Error: Unable to detect local Parallel Studio installation. The toolchain" - echo " providing ${icc_subpath} must be installed prior to this compatibility package" - echo " " - exit 1 -fi - -# Verify min version expectations -min_ver="19.1.0" -declare -a versions=() -declare -a topDirs=() -for file in ${versions_all}; do - version=$(rpm -q --qf '%%{VERSION}.%%{RELEASE}\n' -f ${file}) - echo "--> Version ${version} detected" - if [ "$min_ver" = "$(printf '${version}\n${min_ver}' | sort -V | head -n 1)" ]; then - echo "Warning: ${version} < $min_ver, skipping" - else - versions+="${version}" - topDirs+="$(echo $file | sed "s,/$icc_subpath,,")" - fi -done - -if [ -z "${versions}" ]; then - echo "" - echo "Error: local PSXE compatibility support is for versions > ${min_ver}" - echo " " - exit 1 -fi - -mkdir -p %{_localstatedir}/lib/rpm-state/%{name}/ -printf "%s\n" ${versions[@]} > %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-versions -printf "%s\n" ${topDirs[@]} > %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-dirs - - -%post -n %{psxemod} -scanner=%{OHPC_ADMIN}/compat/modulegen/mod_generator.sh -declare -a versions=() -declare -a topDirs=() -readarray -t versions < %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-versions -readarray -t topDirs < %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-dirs -rm -rf %{_localstatedir}/lib/rpm-state/%{name}/ - -echo "Creating OpenHPC-style modulefiles for local PSXE compiler installation(s)." - -# initialize manifest to log files created during this process -rm -f %{psxe_manifest} - -# Create modulefiles for each locally detected installation. -for (( x=0; x < ${#versions[@]}; x++ )); do - topDir=${topDirs[$x]} - version=${versions[$x]} - echo "--> Installing modulefile for version=${version}" - - # Check for compilervars before writing a file - if [ ! -e ${topDir}/linux/bin/compilervars.sh ]; then - echo "Error: Unable to access compilervars.sh" - echo " Skipping modules for (${topDir})" - break - fi - - # Main module - cat << EOF > %{OHPC_MODULES}/intel/${version} -#%Module1.0##################################################################### - -set version "${version}" - -proc ModulesHelp { } { -global version -puts stderr "\nSee the man pages for icc, icpc, and ifort for detailed information" -puts stderr "on available compiler options and command-line syntax." -puts stderr "\nVersion \$version\n" -} - -module-whatis "Name: Intel(R) Compiler" -module-whatis "Version: \$version" -module-whatis "Category: compiler, runtime support" -module-whatis "Description: Intel(R) Compiler Family (C/C++/Fortran for x86_64)" -module-whatis "URL: http://software.intel.com/en-us/articles/intel-compilers/" - -set version \$version - -# update module path hierarchy -prepend-path MODULEPATH %{OHPC_MODULEDEPS}/intel - -family "compiler" -EOF - - echo "%{OHPC_MODULES}/intel/${version}" >> %{psxe_manifest} - - # Append with environment vars parsed directlry from mpivars.sh - ${scanner} ${topDir}/linux/bin/compilervars.sh -arch intel64 -platform linux >> %{OHPC_MODULES}/intel/${version} - if [ $? -ne 0 ]; then - echo "ERROR: Could not generate content for %{OHPC_MODULES}/intel/${version}" - break - fi - - # .version file - cat << EOF > %{OHPC_MODULES}/intel/.version.${version} -#%Module1.0##################################################################### -set ModulesVersion "${version}" -EOF - - echo "%{OHPC_MODULES}/intel/.version.${version}" >> %{psxe_manifest} - - # Provide standalone module for use with GNU toolchain - mkdir -p %{OHPC_MODULEDEPS}/gnu/mkl - - cat << EOF > %{OHPC_MODULEDEPS}/gnu/mkl/${version} -#%Module1.0##################################################################### - -set version "${version} - -proc ModulesHelp { } { -global version -puts stderr "\nSets MKLROOT environment variable\n" -puts stderr "\$version" -} - -module-whatis "Name: Intel(R) Math Kernel Library" -module-whatis "Version: \$version" -module-whatis "Category: library, runtime support" -module-whatis "Description: Intel Math Kernel Library for C/C++ and Fortran" -module-whatis "URL: https://software.intel.com/en-us/en-us/intel-mkl" - -setenv MKLROOT ${topDir}/linux/mkl -prepend-path LD_LIBRARY_PATH ${topDir}/linux/mkl/lib/intel64 -EOF - - echo "%{OHPC_MODULEDEPS}/gnu/mkl/${version}" >> %{psxe_manifest} - -done - - -%preun -n %{psxemod} -if [ -s %{psxe_manifest} ]; then - while IFS= read -r file; do - if [ -e $file ]; then - rm -f $file - fi - done < %{psxe_manifest} -else - echo "WARNING: Manifest not found" -fi - - -%files -n %{psxemod} -%{OHPC_ADMIN}/compat/modulegen/mod_generator.sh -%dir %{OHPC_MODULES}/intel -%ghost %{psxe_manifest} +%{repodir}/%{basename:%{SOURCE1}} diff --git a/components/mpi-families/impi-devel/SOURCES/mod_generator_impi.sh b/components/mpi-families/impi-devel/SOURCES/mod_generator_impi.sh deleted file mode 100755 index 25fe5be351..0000000000 --- a/components/mpi-families/impi-devel/SOURCES/mod_generator_impi.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -# -# OpenHPC build script/utilities -# -#----------------------------------------------------------------------- -# Licensed under the Apache License, Version 2.0 (the "License"); you -# may not use this file except in compliance with the License. You may -# obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. See the License for the specific language governing -# permissions and limitations under the License. -#----------------------------------------------------------------------- -# Utility to derive modules environment variable settings from shell -# script initialization file. -#----------------------------------------------------------------------- - -if [ $# -lt 1 ];then - echo "Usage: $0 args" - exit 1 -fi - -# environment variables to ignore - -ignoreVars="^SHLVL=|^INTEL_LICENSE_FILE=|^PWD=|^_=|^WARNING:" - -inFile=$1 -shift -export remainArgs="$@" - -if [ ! -s $inFile ];then - echo "$inFile not available locally" - exit 1 -fi - -TMPFILE=/tmp/mod_generator.$RANDOM -OUTFILE=$TMPFILE.out - -cat < $TMPFILE -#!/bin/bash -unset LD_LIBRARY_PATH -unset LIBRARY_PATH - -MYPATH=\${PATH} - -#source $inFile "$remainArgs" >& /dev/null -source $inFile ${remainArgs} >& /dev/null - -/usr/bin/printenv | sed s!:\${MYPATH}!! -EOF - - -chmod 700 $TMPFILE || exit 1 - -env -i $TMPFILE | egrep -v $ignoreVars > $OUTFILE - -if [ ! -s $OUTFILE ];then - echo "No environment variables detected" - exit 1 -fi - -maxLen=0 - -# scan for max variable name length - -for var in `cat $OUTFILE`; do - locLen=`echo $var | awk -F = '{print $1}'| wc -m` || exit 1 - - if [ $locLen -gt $maxLen ];then - maxLen=$locLen - fi -done - -echo " " -echo "# OpenHPC machine generated from `basename $inFile`" - -while read var ; do - varName=`echo $var | awk -F = '{print $1}'` || exit 1 - varDef=`echo $var | awk -F = '{print $2}'` || exit 1 - - echo $varName | egrep -q "PATH" - - if [ $? -eq 0 ];then - printf "%-13s %-${maxLen}s %s\n" "prepend-path" $varName $varDef - else - # check if this variable needs extra quoting (say because it includes spaces) - - echo "$varDef" | egrep -q '\s' - if [ $? -eq 0 ];then - printf "%-13s %-${maxLen}s \"%s\"\n" "setenv" $varName "$varDef" - else - printf "%-13s %-${maxLen}s %s\n" "setenv" $varName "$varDef" - fi - fi -done < $OUTFILE - -echo "# end of machine generated" -echo " " - diff --git a/components/mpi-families/impi-devel/SPECS/intel-mpi.spec b/components/mpi-families/impi-devel/SPECS/intel-mpi.spec index 2b1593e5ea..1b18c010b0 100644 --- a/components/mpi-families/impi-devel/SPECS/intel-mpi.spec +++ b/components/mpi-families/impi-devel/SPECS/intel-mpi.spec @@ -13,29 +13,30 @@ %define pname intel-mpi-devel %define gnu_major_ver 12 %define oneapi_manifest %{OHPC_MODULEDEPS}/intel/impi/.rpm-manifest -%define psxe_manifest %{OHPC_MODULEDEPS}/intel/impi/.manifest -%define min_intel_ver 2021.4.0 - +# Using a minimum version has been problematic as DNF will happily +# install newer versions during build time. If the user has the minimum +# version, but the build system was already using a newer version, then +# the resulting binaries might rely on symbols which are not present +# in the minimum version. Newer versions may still be installed in parallel. +%define exact_intel_ver 2021.9.0 Summary: OpenHPC compatibility package for Intel(R) oneAPI MPI Library Name: %{pname}%{PROJ_DELIM} -Version: 2021.1 -Release: %{?dist}.1 +Version: 2023.1 +Release: 1 License: Apache-2.0 URL: https://github.com/openhpc/ohpc Group: %{PROJ_NAME}/mpi-families BuildArch: x86_64 AutoReq: no -Source1: mod_generator_impi.sh - #!BuildIgnore: post-build-checks Requires: sed -Requires(pre): intel-compilers-devel%{PROJ_DELIM} >= 2021 -Requires(pre): intel-oneapi-mpi-devel >= %{min_intel_ver} -Requires: intel-oneapi-mpi-devel >= %{min_intel_ver} -Requires: intel-compilers-devel%{PROJ_DELIM} >= 2021 +Requires(pre): intel-compilers-devel%{PROJ_DELIM} = %{version} +Requires(pre): intel-oneapi-mpi-devel-%{exact_intel_ver} +Requires: intel-oneapi-mpi-devel-%{exact_intel_ver} +Requires: intel-compilers-devel%{PROJ_DELIM} = %{version} Requires: prun%{PROJ_DELIM} %description @@ -48,9 +49,6 @@ MPI Library. %install -# Mod generator for PSXE support -install -D -m755 %{SOURCE1} %{buildroot}/%{OHPC_ADMIN}/compat/modulegen/mod_generator_impi.sh - # Module directories mkdir -p %{buildroot}/%{OHPC_MODULEDEPS}/intel/impi mkdir -p %{buildroot}/%{OHPC_MODULEDEPS}/gnu/impi @@ -230,242 +228,3 @@ fi %dir %{OHPC_MODULEDEPS}/gnu/impi %dir %{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}/impi %ghost %{oneapi_manifest} - -############################################################################### - -%define psxemod intel-psxe-mpi-devel%{PROJ_DELIM} - -%package -n %{psxemod} -Summary: OpenHPC compatibility package for Intel(R) MPI Library - -Obsoletes: %pname%{PROJ_DELIM} < %{version} -Requires: intel-psxe-compilers-devel%{PROJ_DELIM} = %{version} -Requires: prun%{PROJ_DELIM} -Requires: sed, gawk - -%description -n %{psxemod} -Provides OpenHPC-style compatible modules for use with MPI Library in the -Intel(R) Parallel Studio suite. - - -%pre -n %{psxemod} -p /bin/bash -# Verify psxe mpi stack is installed. Punt if not detected. -echo "Checking for local PSXE MPI installation(s)." -icc_subpath="linux/mpi/intel64/bin/mpicc$" -versions_all=$(rpm -qal | grep "${icc_subpath}" | grep -v "oneapi") - -if [ $? -eq 1 ];then - echo "" - echo "Error: Unable to detect local Parallel Studio MPI installation. The toolchain" - echo " providing ${icc_subpath} must be installed prior to this compatibility package" - echo " " - exit 1 -fi - -# Verify min version expectations -min_ver="2019" -declare -a versions=() -declare -a topDirs=() -declare -a mpiDirs=() -for file in ${versions_all}; do - version=$(rpm -q --qf '%%{VERSION}.%%{RELEASE}\n' -f ${file}) - echo "--> Version ${version} detected" - if [ "$min_ver" = "$(printf '${version}\n${min_ver}' | sort -V | head -n 1)" ]; then - echo "Warning: ${version} < $min_ver, skipping" - else - versions+="${version}" - topDirs+="$(echo $file | sed "s,/${icc_subpath},,")" - mpiDirs+="${file%/bin/*}" - fi -done - -if [ -z "${versions}" ]; then - echo "" - echo "Error: local PSXE compatibility support is for versions > ${min_ver}" - echo " " - exit 1 -fi - -rm -rf %{_localstatedir}/lib/rpm-state/%{name} -mkdir -p %{_localstatedir}/lib/rpm-state/%{name}/ -printf "%s\n" ${versions[@]} > %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-versions -printf "%s\n" ${topDirs[@]} > %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-dirs -printf "%s\n" ${mpiDirs[@]} > %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-mpis - - -%post -n %{psxemod} -p /bin/bash -scanner=%{OHPC_ADMIN}/compat/modulegen/mod_generator_impi.sh -declare -a versions=() -declare -a topDirs=() -declare -a mpiDirs=() -readarray -t versions < %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-versions -readarray -t topDirs < %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-dirs -readarray -t mpiDirs < %{_localstatedir}/lib/rpm-state/%{name}/rpm-install-mpis -rm -rf %{_localstatedir}/lib/rpm-state/%{name} - -echo "Creating OpenHPC-style modulefiles for local PSXE MPI installation(s)." - -# Create modulefiles for each locally detected installation. -rm -f %{psxe_manifest} - -for (( x=0; x < ${#versions[@]}; x++ )); do - topDir=${topDirs[$x]} - mpiDir=${mpiDirs[$x]} - version=${versions[$x]} - echo "--> Installing modulefile for version=${version}" - - # Check for compilervars before writing a file - if [ ! -e ${topDir}/linux/mpi/intel64/bin/mpivars.sh ]; then - echo "Error: Unable to access mpivars.sh" - echo " Skipping modules for (${topDir})" - break - fi - - # Create alternate bin directory links - ohpcDir=${mpiDir}/bin_ohpc - mkdir -p ${ohpcDir} - if [ -e ${mpiDir}/bin/mpiicc ]; then - ln -sf ${mpiDir}/bin/mpiicc ${ohpcDir}/mpicc - fi - if [ -e ${mpiDir}/bin/mpiicpc ]; then - ln -sf ${mpiDir}/bin/mpiicpc ${ohpcDir}/mpicxx - fi - if [ -e ${mpiDir}/bin/mpiifort ]; then - ln -sf ${mpiDir}/bin/mpiifort ${ohpcDir}/mpif90 - ln -sf ${mpiDir}/bin/mpiifort ${ohpcDir}/mpif77 - fi - - echo "${ohpcDir}/" >> %{psxe_manifest} - - # Main module - cat << EOF > %{OHPC_MODULEDEPS}/intel/impi/${version} -#%Module1.0##################################################################### - -set version "${version}" - -proc ModulesHelp { } { -global version -puts stderr "\nThis module loads the Intel MPI environment\n" -puts stderr "mpiifort (Fortran source)" -puts stderr "mpiicc (C source)" -puts stderr "mpiicpc (C++ source)" -puts stderr "\nVersion \$version\n" -} - -module-whatis "Name: Intel MPI" -module-whatis "Version: \$version" -module-whatis "Category: library, runtime support" -module-whatis "Description: Intel MPI Library (C/C++/Fortran for x86_64)" -module-whatis "URL: http://software.intel.com/en-us/articles/intel-mpi-library/" - -prepend-path MODULEPATH %{OHPC_MODULEDEPS}/intel-impi - -setenv MPI_DIR $mpiDir - -family "MPI" -EOF - - echo "%{OHPC_MODULEDEPS}/intel/impi/${version}" >> %{psxe_manifest} - - # Append with environment vars parsed directlry from mpivars.sh - ${scanner} ${topDir}/linux/mpi/intel64/bin/mpivars.sh >> %{OHPC_MODULEDEPS}/intel/impi/${version} - if [ $? -ne 0 ]; then - echo "ERROR: Could not generate content for %{OHPC_MODULEDEPS}/intel/impi/${version}" - break - fi - - # Prepend bin_ohpc - cat << EOF >> %{OHPC_MODULEDEPS}/intel/impi/${version} - -# Prefer bin_ohpc to allow developers to use standard mpicc, mpif90, -# etc to access Intel toolchain. -prepend-path PATH ${ohpcDir} - -EOF - - # Version file - cat << EOF > %{OHPC_MODULEDEPS}/intel/impi/.version.$version -#%Module1.0##################################################################### -set ModulesVersion "${version}" -EOF - - echo "%{OHPC_MODULEDEPS}/intel/impi/.version.${version}" >> %{psxe_manifest} - - # OpenHPC module file for GNU compiler toolchain - cat << EOF > %{OHPC_MODULEDEPS}/gnu/impi/${version} -#%Module1.0##################################################################### - -set version "${version}" - -proc ModulesHelp { } { -global version -puts stderr "\nThis module loads the Intel MPI environment for use with the GNU" -puts stderr "compiler toolchain\n" -puts stderr "mpif90 (Fortran source)" -puts stderr "mpicc (C source)" -puts stderr "mpicxx (C++ source)" -puts stderr "\nVersion \$version\n" -} - -module-whatis "Name: Intel MPI" -module-whatis "Version: \$version" -module-whatis "Category: library, runtime support" -module-whatis "Description: Intel MPI Library (C/C++/Fortran for x86_64)" -module-whatis "URL: http://software.intel.com/en-us/articles/intel-mpi-library/" - -prepend-path MODULEPATH %{OHPC_MODULEDEPS}/gnu-impi -setenv MPI_DIR ${mpiDir} - -family "MPI" -EOF - - echo "%{OHPC_MODULEDEPS}/gnu/impi/${version}" >> %{psxe_manifest} - - # Append with environment vars parsed directly from mpivars.sh - ${scanner} ${topDir}/linux/mpi/intel64/bin/mpivars.sh >> %{OHPC_MODULEDEPS}/gnu/impi/${version} - if [ $? -ne 0 ]; then - echo "ERROR: Could not generate content for %{OHPC_MODULEDEPS}/gnu/impi/${version}" - break - fi - - # Version file - cat << EOF > %{OHPC_MODULEDEPS}/gnu/impi/.version.${version} -#%Module1.0##################################################################### -set ModulesVersion "${version}" -EOF - - echo "%{OHPC_MODULEDEPS}/gnu/impi/.version.${version}" >> %{psxe_manifest} - - # support for additional gnu variants - cp %{OHPC_MODULEDEPS}/gnu/impi/${version} %{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}/impi/${version} - cp %{OHPC_MODULEDEPS}/gnu/impi/.version.${version} %{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}/impi/.version.${version} - sed -i "s,%{OHPC_MODULEDEPS}/gnu-impi,%{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}-impi," %{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}/impi/${version} - - echo "%{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}/impi/${version}" >> %{psxe_manifest} - echo "%{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}/impi/.version.${version}" >> %{psxe_manifest} - -done - - -%preun -n %{psxemod} -p /bin/bash -if [ -s %{psxe_manifest} ]; then - while IFS= read -r file; do - if [[ "$file" =~ "/bin_ohpc/" ]]; then - rm -f $file/* - rmdir $file - fi - if [ -e $file ]; then - rm -f $file - fi - done < %{psxe_manifest} -else - echo "WARNING: Manifest not found" -fi - - -%files -n %{psxemod} -%{OHPC_ADMIN}/compat/modulegen/mod_generator_impi.sh -%dir %{OHPC_MODULEDEPS}/intel/impi -%dir %{OHPC_MODULEDEPS}/gnu/impi -%dir %{OHPC_MODULEDEPS}/gnu%{gnu_major_ver}/impi -%ghost %{psxe_manifest}