diff --git a/mpi.prov b/mpi.prov index a397d14..5a672cf 100755 --- a/mpi.prov +++ b/mpi.prov @@ -46,12 +46,18 @@ if [ -e /etc/profile.d/modules.sh ]; then done export MODULEPATH="$MODULEPATH:$(IFS=:; echo "${_MODULEPATH[*]}")" - for module in $(module -t avail 2>&1 | grep "^mpi/"); do + for module in $(module -t avail 2>&1 | grep "^mpi/."); do module load $module mpi_compiler_for_dir[${MPI_HOME}]=${MPI_COMPILER} mpi_compiler_for_dir[${MPI_FORTRAN_MOD_DIR}]=${MPI_COMPILER} - mpi_compiler_for_dir[${MPI_PYTHON2_SITEARCH}]=${MPI_COMPILER} - mpi_compiler_for_dir[${MPI_PYTHON3_SITEARCH}]=${MPI_COMPILER} + if [ -n "${MPI_PYTHON2_SITEARCH}" ]; then + mpi_compiler_for_dir[${MPI_PYTHON2_SITEARCH}]=${MPI_COMPILER} + else + mpi_compiler_for_dir[${MPI_PYTHON_SITEARCH}]=${MPI_COMPILER} + fi + if [ -n "${MPI_PYTHON3_SITEARCH}" ]; then + mpi_compiler_for_dir[${MPI_PYTHON3_SITEARCH}]=${MPI_COMPILER} + fi module unload $module done fi diff --git a/mpi.req b/mpi.req index 176d399..f859fad 100755 --- a/mpi.req +++ b/mpi.req @@ -48,12 +48,18 @@ if [ -e /etc/profile.d/modules.sh ]; then done export MODULEPATH="$MODULEPATH:$(IFS=:; echo "${_MODULEPATH[*]}")" - for module in $(module -t avail 2>&1 | grep "^mpi/"); do + for module in $(module -t avail 2>&1 | grep "^mpi/."); do module load $module mpi_compiler_for_dir[${MPI_HOME}]=${MPI_COMPILER} mpi_compiler_for_dir[${MPI_FORTRAN_MOD_DIR}]=${MPI_COMPILER} - mpi_compiler_for_dir[${MPI_PYTHON2_SITEARCH}]=${MPI_COMPILER} - mpi_compiler_for_dir[${MPI_PYTHON3_SITEARCH}]=${MPI_COMPILER} + if [ -n "${MPI_PYTHON2_SITEARCH}" ]; then + mpi_compiler_for_dir[${MPI_PYTHON2_SITEARCH}]=${MPI_COMPILER} + else + mpi_compiler_for_dir[${MPI_PYTHON_SITEARCH}]=${MPI_COMPILER} + fi + if [ -n "${MPI_PYTHON3_SITEARCH}" ]; then + mpi_compiler_for_dir[${MPI_PYTHON3_SITEARCH}]=${MPI_COMPILER} + fi mpi_lib_for_compiler[${MPI_COMPILER}]=${MPI_LIB} module unload $module done diff --git a/rpm-mpi-hooks.spec b/rpm-mpi-hooks.spec index bcd7752..63b6a38 100644 --- a/rpm-mpi-hooks.spec +++ b/rpm-mpi-hooks.spec @@ -1,6 +1,6 @@ Name: rpm-mpi-hooks -Version: 5 -Release: 4%{?dist} +Version: 6 +Release: 1%{?dist} Summary: RPM dependency generator hooks for MPI packages License: MIT @@ -46,6 +46,10 @@ install -Dpm 0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/mpi.req %changelog +* Tue Dec 4 2018 Orion Poplawski - 6-1 +- Avoid trying to load mpi/ directory as a module +- Handle old MPI_PYTHON_SITEARCH and MPI_PYTHON3_SITEARCH conditionally for EL7 + * Sat Jul 14 2018 Fedora Release Engineering - 5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild