Also handle binaries in and
This commit is contained in:
parent
6cb8095222
commit
5ad6adedec
@ -1,7 +1,6 @@
|
|||||||
%__mpi_provides %{_rpmconfigdir}/mpi.prov %{buildroot} %{?__filter_GLIBC_PRIVATE:--filter-private}
|
%__mpi_provides %{_rpmconfigdir}/mpi.prov %{buildroot} %{?__filter_GLIBC_PRIVATE:--filter-private}
|
||||||
%__mpi_requires %{_rpmconfigdir}/mpi.req %{buildroot} %{?__filter_GLIBC_PRIVATE:--filter-private}
|
%__mpi_requires %{_rpmconfigdir}/mpi.req %{buildroot} %{?__filter_GLIBC_PRIVATE:--filter-private}
|
||||||
%__mpi_path ^%{_prefix}/lib(64)?/(openmpi|mpich)/.*$
|
%__mpi_path ^%{_prefix}/lib(64)?/.*$
|
||||||
%__mpi_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*$
|
%__mpi_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*$
|
||||||
%__mpi_flags exeonly,magic_and_path
|
%__mpi_flags exeonly,magic_and_path
|
||||||
%__elf_exclude_path ^%{_prefix}/lib(64)?/(openmpi|mpich)/.*$
|
%__elf_exclude_path ^%{_prefix}/lib(64)?/.*$
|
||||||
%__libsymlink_exclude_path ^%{_prefix}/lib(64)?/(openmpi|mpich)/.*$
|
|
||||||
|
18
mpi.prov
18
mpi.prov
@ -34,8 +34,8 @@ elfdepsargs="$@"
|
|||||||
|
|
||||||
# Search for all MPI implementations:
|
# Search for all MPI implementations:
|
||||||
# - Search all modules which start with mpi
|
# - Search all modules which start with mpi
|
||||||
# - For each module, store $MPI_HOME -> $MPI_COMPILER in assoc. array
|
# - For each module, store $MPI_DIR -> $MPI_COMPILER in assoc. array
|
||||||
declare -A mpi_compier_for_home
|
declare -A mpi_compier_for_dir
|
||||||
if [ -e /etc/profile.d/modules.sh ]; then
|
if [ -e /etc/profile.d/modules.sh ]; then
|
||||||
. /etc/profile.d/modules.sh;
|
. /etc/profile.d/modules.sh;
|
||||||
|
|
||||||
@ -49,7 +49,9 @@ if [ -e /etc/profile.d/modules.sh ]; then
|
|||||||
|
|
||||||
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
|
module load $module
|
||||||
mpi_compier_for_home[${MPI_HOME}]=${MPI_COMPILER}
|
mpi_compier_for_dir[${MPI_HOME}]=${MPI_COMPILER}
|
||||||
|
mpi_compier_for_dir[${MPI_FORTRAN_MOD_DIR}]=${MPI_COMPILER}
|
||||||
|
mpi_compier_for_dir[${MPI_PYTHON_SITEARCH}]=${MPI_COMPILER}
|
||||||
module unload $module
|
module unload $module
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@ -67,11 +69,11 @@ if [ -x /usr/lib/rpm/elfdeps -a -n "$filelist" ]; then
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the path to the scanned binary starts with an $MPI_HOME, append the
|
# If the path to the scanned binary starts with a known mpi binary directory,
|
||||||
# corresponding ($MPI_COMPILER) to the provides string
|
# append the corresponding ($MPI_COMPILER) to the provides string
|
||||||
for mpi_home in "${!mpi_compier_for_home[@]}"; do
|
for mpi_dir in "${!mpi_compier_for_dir[@]}"; do
|
||||||
if [[ "$file" == "$buildroot$mpi_home"* ]]; then
|
if [[ "$file" == "$buildroot$mpi_dir"* ]]; then
|
||||||
prov="${prov}(${mpi_compier_for_home[$mpi_home]})"
|
prov="${prov}(${mpi_compier_for_dir[$mpi_dir]})"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
18
mpi.req
18
mpi.req
@ -34,9 +34,9 @@ elfdepsargs="$@"
|
|||||||
|
|
||||||
# Search for all MPI implementations:
|
# Search for all MPI implementations:
|
||||||
# - Search all modules which start with mpi
|
# - Search all modules which start with mpi
|
||||||
# - For each module, store $MPI_HOME -> $MPI_COMPILER and
|
# - For each module, store $MPI_DIR -> $MPI_COMPILER and
|
||||||
# $MPI_COMPILER -> $MPI_LIB in assoc. array
|
# $MPI_COMPILER -> $MPI_LIB in assoc. array
|
||||||
declare -A mpi_compier_for_home
|
declare -A mpi_compier_for_dir
|
||||||
declare -A mpi_lib_for_compiler
|
declare -A mpi_lib_for_compiler
|
||||||
if [ -e /etc/profile.d/modules.sh ]; then
|
if [ -e /etc/profile.d/modules.sh ]; then
|
||||||
. /etc/profile.d/modules.sh;
|
. /etc/profile.d/modules.sh;
|
||||||
@ -51,7 +51,9 @@ if [ -e /etc/profile.d/modules.sh ]; then
|
|||||||
|
|
||||||
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
|
module load $module
|
||||||
mpi_compier_for_home[${MPI_HOME}]=${MPI_COMPILER}
|
mpi_compier_for_dir[${MPI_HOME}]=${MPI_COMPILER}
|
||||||
|
mpi_compier_for_dir[${MPI_FORTRAN_MOD_DIR}]=${MPI_COMPILER}
|
||||||
|
mpi_compier_for_dir[${MPI_PYTHON_SITEARCH}]=${MPI_COMPILER}
|
||||||
mpi_lib_for_compiler[${MPI_COMPILER}]=${MPI_LIB}
|
mpi_lib_for_compiler[${MPI_COMPILER}]=${MPI_LIB}
|
||||||
module unload $module
|
module unload $module
|
||||||
done
|
done
|
||||||
@ -67,16 +69,16 @@ if [ -x /usr/lib/rpm/elfdeps -a -n "$filelist" ]; then
|
|||||||
# Get the default requres string from elfdeps
|
# Get the default requres string from elfdeps
|
||||||
reqs=$(echo $file | /usr/lib/rpm/elfdeps --requires $elfdepsargs)
|
reqs=$(echo $file | /usr/lib/rpm/elfdeps --requires $elfdepsargs)
|
||||||
|
|
||||||
# Check whether the scanned binary is inside an $MPI_HOME dir
|
# Check whether the scanned binary is inside a know mpi binary dir
|
||||||
mpi_comp=
|
mpi_comp=
|
||||||
for mpi_home in "${!mpi_compier_for_home[@]}"; do
|
for mpi_dir in "${!mpi_compier_for_dir[@]}"; do
|
||||||
if [[ "$file" == "$buildroot$mpi_home"* ]]; then
|
if [[ "$file" == "$buildroot$mpi_dir"* ]]; then
|
||||||
mpi_comp="${mpi_compier_for_home[$mpi_home]}"
|
mpi_comp="${mpi_compier_for_dir[$mpi_dir]}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# If the scanned binary is inside an $MPI_HOME, for each dependency, check
|
# If the scanned binary is inside an mpi dir, for each dependency, check
|
||||||
# whether the library exists in $MPI_LIB, and if yes, append
|
# whether the library exists in $MPI_LIB, and if yes, append
|
||||||
# ($MPI_COMPILER) to each requires string
|
# ($MPI_COMPILER) to each requires string
|
||||||
if [ ! -z $mpi_comp ]; then
|
if [ ! -z $mpi_comp ]; then
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# Make libfoo.so symlinks require the soname-provide of the target library
|
# Make libfoo.so symlinks require the soname-provide of the target library
|
||||||
%__mpilibsymlink_requires %{_rpmconfigdir}/mpi.prov %{buildroot} --soname-only
|
%__mpilibsymlink_requires %{_rpmconfigdir}/mpi.prov %{buildroot} --soname-only
|
||||||
%__mpilibsymlink_magic ^symbolic link to .*lib.*\.so\..*$
|
%__mpilibsymlink_magic ^symbolic link to .*lib.*\.so\..*$
|
||||||
%__mpilibsymlink_path ^%{_prefix}/lib(64)?/(openmpi|mpich)/.*\.so$
|
%__mpilibsymlink_path ^%{_prefix}/lib(64)?/.*$
|
||||||
%__mpilibsymlink_flags magic_and_path
|
%__mpilibsymlink_flags magic_and_path
|
||||||
|
%__libsymlink_exclude_path ^%{_prefix}/lib(64)?/.*$
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Name: rpm-mpi-hooks
|
Name: rpm-mpi-hooks
|
||||||
Version: 2
|
Version: 3
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: RPM dependency generator hooks for MPI packages
|
Summary: RPM dependency generator hooks for MPI packages
|
||||||
|
|
||||||
@ -47,6 +47,9 @@ install -Dpm 0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/mpi.req
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 10 2015 Sandro Mani <manisandro@gmail.com> 3-1
|
||||||
|
- Also handle binaries in $MPI_FORTRAN_MOD_DIR and $MPI_PYTHON_SITEARCH
|
||||||
|
|
||||||
* Sun Jul 26 2015 Sandro Mani <manisandro@gmail.com> 2-1
|
* Sun Jul 26 2015 Sandro Mani <manisandro@gmail.com> 2-1
|
||||||
- Add %%__mpi_magic, %%__mpi_flags to mpi.attrs
|
- Add %%__mpi_magic, %%__mpi_flags to mpi.attrs
|
||||||
- Add mpilibsymlink.attr
|
- Add mpilibsymlink.attr
|
||||||
|
Loading…
Reference in New Issue
Block a user