From e5c18b6665fad2d3954daf8395775597ab162d51 Mon Sep 17 00:00:00 2001 From: zhanglu Date: Wed, 15 Jan 2020 16:18:25 +0800 Subject: [PATCH] fix selfbuild --- fftw.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fftw.spec b/fftw.spec index a44334c..638cbd3 100644 --- a/fftw.spec +++ b/fftw.spec @@ -194,7 +194,9 @@ This package includes help documentation and manuals related to %{name} %autosetup -p1 %build +%if %{with mpich} || %{with openmpi} source /etc/profile.d/modules.sh +%endif autoreconf -vfi export F77=gfortran @@ -240,6 +242,7 @@ build_section --enable-long-double %endif cd .. +%if %{with mpich} || %{with openmpi} for mpi in %{mpi_list} do module load mpi/${mpi}-%{_arch} @@ -263,6 +266,7 @@ do cd .. module unload mpi/${mpi}-%{_arch} done +%endif %install function install_section() @@ -271,7 +275,9 @@ function install_section() find %{buildroot}%{_libdir}/${mpi}/lib -name libfftw\* -a \! -name \*_mpi.\* -delete rm -r %{buildroot}%{_libdir}/${mpi}/{bin,share} } +%if %{with mpich} || %{with openmpi} source /etc/profile.d/modules.sh +%endif %make_install -C single %make_install -C double @@ -283,6 +289,7 @@ source /etc/profile.d/modules.sh %global delete_la find $RPM_BUILD_ROOT -type f -name "*.la" -delete +%if %{with mpich} || %{with openmpi} for mpi in %{mpi_list} do module load mpi/${mpi}-%{_arch} @@ -291,12 +298,15 @@ do install_section long module unload mpi/${mpi}-%{_arch} done +%endif rm -f %{buildroot}%{_infodir}/dir %delete_la %check +%if %{with mpich} || %{with openmpi} source /etc/profile.d/modules.sh +%endif mydir=`pwd` export LD_LIBRARY_PATH=$mydir/single/.libs:$mydir/single/threads/.libs @@ -311,6 +321,7 @@ make %{?_smp_mflags} -C long check make %{?_smp_mflags} -C quad check %endif +%if %{with mpich} || %{with openmpi} for mpi in %{mpi_list} do module load mpi/${mpi}-%{_arch} @@ -321,6 +332,7 @@ do make %{?_smp_mflags} -C ${mpi}-long/mpi check module unload mpi/${mpi}-%{_arch} done +%endif %post libs-single -p /sbin/ldconfig %postun libs-single -p /sbin/ldconfig