Use MPI variables

This commit is contained in:
sagitter 2017-08-13 15:02:16 +02:00
parent 9af9a19adf
commit 722a325d89

View File

@ -34,7 +34,7 @@
%endif %endif
## blas is not available on fedora 24 ## blas is not available on fedora 24
%if 0%{?fedora} < 25 %if 0%{?fedora} && 0%{?fedora} < 25
ExcludeArch: aarch64 ExcludeArch: aarch64
%endif %endif
@ -50,6 +50,11 @@ ExcludeArch: aarch64
%endif %endif
# #
## SuperLUDIST needs parmetis
%bcond_with superludist
%bcond_with superlumt
#
# hdf5' is required by 'cgns' # hdf5' is required by 'cgns'
# hdf5 needs MPI # hdf5 needs MPI
%if 0%{?fedora} || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
@ -130,7 +135,7 @@ ExcludeArch: aarch64
Name: petsc Name: petsc
Summary: Portable Extensible Toolkit for Scientific Computation Summary: Portable Extensible Toolkit for Scientific Computation
Version: 3.7.6 Version: 3.7.6
Release: 6%{?dist} Release: 7%{?dist}
License: BSD License: BSD
URL: https://www.mcs.anl.gov/petsc URL: https://www.mcs.anl.gov/petsc
Source0: http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-%{version}.tar.gz Source0: http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-%{version}.tar.gz
@ -150,6 +155,9 @@ Patch3: %{name}-disable_petscnagupgrade.patch
%if %{with superlu} %if %{with superlu}
BuildRequires: SuperLU-devel BuildRequires: SuperLU-devel
%endif %endif
%if %{with superlumt}
BuildRequires: SuperLUMT-devel
%endif
%if %{with sundials} %if %{with sundials}
BuildRequires: sundials-devel BuildRequires: sundials-devel
%endif %endif
@ -257,6 +265,9 @@ BuildRequires: MUMPS-openmpi-devel
%if %{with sundials} %if %{with sundials}
BuildRequires: sundials-openmpi-devel BuildRequires: sundials-openmpi-devel
%endif %endif
%if %{with superludist}
BuildRequires: superlu_dist-openmpi-devel
%endif
%if %{with fftw} %if %{with fftw}
BuildRequires: fftw-devel BuildRequires: fftw-devel
BuildRequires: fftw-openmpi-devel BuildRequires: fftw-openmpi-devel
@ -312,6 +323,9 @@ BuildRequires: MUMPS-mpich-devel
%if %{with sundials} %if %{with sundials}
BuildRequires: sundials-mpich-devel BuildRequires: sundials-mpich-devel
%endif %endif
%if %{with superludist}
BuildRequires: superlu_dist-mpich-devel
%endif
%if %{with hypre} %if %{with hypre}
BuildRequires: hypre-mpich-devel BuildRequires: hypre-mpich-devel
%endif %endif
@ -531,9 +545,9 @@ pushd buildopenmpi_dir
--with-64-bit-indices=0 \ --with-64-bit-indices=0 \
--with-fortran-interfaces=1 \ --with-fortran-interfaces=1 \
--with-windows-graphics=0 \ --with-windows-graphics=0 \
--CC=%{_libdir}/openmpi/bin/mpicc \ --CC=$MPI_BIN/mpicc \
--CXX=%{_libdir}/openmpi/bin/mpicxx \ --CXX=$MPI_BIN/mpicxx \
--FC=%{_libdir}/openmpi/bin/mpif77 \ --FC=$MPI_BIN/mpif77 \
--with-shared-ld=ld \ --with-shared-ld=ld \
--with-pic=1 \ --with-pic=1 \
--with-clib-autodetect=0 \ --with-clib-autodetect=0 \
@ -559,39 +573,44 @@ pushd buildopenmpi_dir
%endif %endif
%if %{with scalapack} %if %{with scalapack}
--with-scalapack=1 \ --with-scalapack=1 \
--with-scalapack-lib="-L%{_libmpidir} -lscalapack" \ --with-scalapack-lib="-L$MPI_LIB -lscalapack" \
--with-scalapck-include="" \ --with-scalapck-include="" \
%endif %endif
%if %{with mpi} %if %{with mpi}
--with-mpi=1 \ --with-mpi=1 \
--with-mpi-compilers=%{_libdir}/openmpi/bin/mpicc \ --with-mpi-compilers=$MPI_BIN/mpicc \
--with-mpiexec=%{_libdir}/openmpi/bin/mpiexec \ --with-mpiexec=$MPI_BIN/mpiexec \
--with-mpiuni-fortran-binding=0 \ --with-mpiuni-fortran-binding=0 \
%endif %endif
%if %{with cgns} %if %{with cgns}
--with-cgns=1 \ --with-cgns=1 \
--with-cgns-include="" \ --with-cgns-include="" \
--with-cgns-lib="-L%{_libmpidir} -lhdf5 -lcgns" \ --with-cgns-lib="-L$MPI_LIB -lhdf5 -lcgns" \
%endif %endif
%if %{with hdf5} %if %{with hdf5}
--with-hdf5=1 \ --with-hdf5=1 \
--with-hdf5-include="" \ --with-hdf5-include="" \
--with-hdf5-lib="-L%{_libmpidir} -lhdf5" \ --with-hdf5-lib="-L$MPI_LIB -lhdf5" \
%endif %endif
%if %{with ptscotch} %if %{with ptscotch}
--with-ptscotch=1 \ --with-ptscotch=1 \
--with-ptscotch-include="" \ --with-ptscotch-include="" \
--with-ptscotch-lib="-L%{_libmpidir} -lptscotch -lscotch -lptscotcherr -lscotcherr" \ --with-ptscotch-lib="-L$MPI_LIB -lptscotch -lscotch -lptscotcherr -lscotcherr" \
%endif %endif
%if %{with mumps} %if %{with mumps}
--with-mumps=1 \ --with-mumps=1 \
--with-mumps-include="" \ --with-mumps-include="" \
--with-mumps-lib="-L%{_libmpidir} -lmumps_common -ldmumps -lpord" \ --with-mumps-lib="-L$MPI_LIB -lmumps_common -ldmumps -lpord" \
%endif %endif
%if %{with sundials} %if %{with sundials}
--with-sundials=1 \ --with-sundials=1 \
--with-sundials-include="" \ --with-sundials-include="" \
--with-sundials-lib="-L%{_libmpidir} -lsundials_nvecparallel -lsundials_cvode" \ --with-sundials-lib="-L$MPI_LIB -lsundials_nvecparallel -lsundials_cvode" \
%endif
%if %{with superludist}
--with-superlu_dist=1 \
--with-superlu_dist-include=$MPI_INCLUDE/superlu_dist \
--with-superlu_dist-lib=-lsuperlu_dist \
%endif %endif
--with-x=1 \ --with-x=1 \
--with-openmp=0 \ --with-openmp=0 \
@ -600,13 +619,13 @@ pushd buildopenmpi_dir
--with-ssl=0 \ --with-ssl=0 \
%if %{with hypre} %if %{with hypre}
--with-hypre=1 \ --with-hypre=1 \
--with-hypre-include=%{_incmpidir}/hypre \ --with-hypre-include=$MPI_INCLUDE/hypre \
--with-hypre-lib="-L%{_libmpidir} -lHYPRE" \ --with-hypre-lib="-L$MPI_LIB -lHYPRE" \
%endif %endif
%if %{with fftw} %if %{with fftw}
--with-fftw=1 \ --with-fftw=1 \
--with-fftw-include="" \ --with-fftw-include="" \
--with-fftw-lib="-L%{_libmpidir} -lfftw3_mpi -lfftw3" \ --with-fftw-lib="-L$MPI_LIB -lfftw3_mpi -lfftw3" \
%endif %endif
--with-pthread=1 \ --with-pthread=1 \
--with-valgrind=1 --with-valgrind=1
@ -632,9 +651,9 @@ pushd buildmpich_dir
--with-64-bit-indices=0 \ --with-64-bit-indices=0 \
--with-fortran-interfaces=1 \ --with-fortran-interfaces=1 \
--with-windows-graphics=0 \ --with-windows-graphics=0 \
--CC=%{_libdir}/mpich/bin/mpicc \ --CC=$MPI_BIN/mpicc \
--CXX=%{_libdir}/mpich/bin/mpicxx \ --CXX=$MPI_BIN/mpicxx \
--FC=%{_libdir}/mpich/bin/mpif77 \ --FC=$MPI_BIN/mpif77 \
--with-shared-ld=ld \ --with-shared-ld=ld \
--with-pic=1 \ --with-pic=1 \
--with-clib-autodetect=0 \ --with-clib-autodetect=0 \
@ -660,39 +679,44 @@ pushd buildmpich_dir
%endif %endif
%if %{with scalapack} %if %{with scalapack}
--with-scalapack=1 \ --with-scalapack=1 \
--with-scalapack-lib="-L%{_libmpichdir} -lscalapack" \ --with-scalapack-lib="-L$MPI_LIB -lscalapack" \
--with-scalapck-include="" \ --with-scalapck-include="" \
%endif %endif
%if %{with mpi} %if %{with mpi}
--with-mpi=1 \ --with-mpi=1 \
--with-mpi-compilers=%{_libdir}/mpich/bin/mpicc \ --with-mpi-compilers=$MPI_BIN/mpicc \
--with-mpiexec=%{_libdir}/mpich/bin/mpiexec \ --with-mpiexec=$MPI_BIN/mpiexec \
--with-mpiuni-fortran-binding=0 \ --with-mpiuni-fortran-binding=0 \
%endif %endif
%if %{with cgns} %if %{with cgns}
--with-cgns=1 \ --with-cgns=1 \
--with-cgns-include="" \ --with-cgns-include="" \
--with-cgns-lib="-L%{_libmpichdir} -lhdf5 -lcgns" \ --with-cgns-lib="-L$MPI_LIB -lhdf5 -lcgns" \
%endif %endif
%if %{with hdf5} %if %{with hdf5}
--with-hdf5=1 \ --with-hdf5=1 \
--with-hdf5-include="" \ --with-hdf5-include="" \
--with-hdf5-lib="-L%{_libmpichdir} -lhdf5" \ --with-hdf5-lib="-L$MPI_LIB -lhdf5" \
%endif %endif
%if %{with ptscotch} %if %{with ptscotch}
--with-ptscotch=1 \ --with-ptscotch=1 \
--with-ptscotch-include="" \ --with-ptscotch-include="" \
--with-ptscotch-lib="-L%{_libmpichdir} -lptscotch -lscotch -lptscotcherr -lscotcherr" \ --with-ptscotch-lib="-L$MPI_LIB -lptscotch -lscotch -lptscotcherr -lscotcherr" \
%endif %endif
%if %{with mumps} %if %{with mumps}
--with-mumps=1 \ --with-mumps=1 \
--with-mumps-include="" \ --with-mumps-include="" \
--with-mumps-lib="-L%{_libmpichdir} -lmumps_common -ldmumps -lpord" \ --with-mumps-lib="-L$MPI_LIB -lmumps_common -ldmumps -lpord" \
%endif %endif
%if %{with sundials} %if %{with sundials}
--with-sundials=1 \ --with-sundials=1 \
--with-sundials-include="" \ --with-sundials-include="" \
--with-sundials-lib="-L%{_libmpichdir} -lsundials_nvecparallel -lsundials_cvode" \ --with-sundials-lib="-L$MPI_LIB -lsundials_nvecparallel -lsundials_cvode" \
%endif
%if %{with superludist}
--with-superlu_dist=1 \
--with-superlu_dist-include=$MPI_INCLUDE/superlu_dist \
--with-superlu_dist-lib=-lsuperlu_dist \
%endif %endif
--with-x=1 \ --with-x=1 \
--with-openmp=0 \ --with-openmp=0 \
@ -701,13 +725,13 @@ pushd buildmpich_dir
--with-ssl=0 \ --with-ssl=0 \
%if %{with hypre} %if %{with hypre}
--with-hypre=1 \ --with-hypre=1 \
--with-hypre-include=%{_incmpichdir}/hypre \ --with-hypre-include=$MPI_INCLUDE/hypre \
--with-hypre-lib="-L%{_libmpichdir} -lHYPRE" \ --with-hypre-lib="-L$MPI_LIB -lHYPRE" \
%endif %endif
%if %{with fftw} %if %{with fftw}
--with-fftw=1 \ --with-fftw=1 \
--with-fftw-include="" \ --with-fftw-include="" \
--with-fftw-lib="-L%{_libmpichdir} -lfftw3_mpi -lfftw3" \ --with-fftw-lib="-L$MPI_LIB -lfftw3_mpi -lfftw3" \
%endif %endif
--with-pthread=1 \ --with-pthread=1 \
--with-valgrind=1 --with-valgrind=1
@ -808,27 +832,31 @@ EOF
%if %{with openmpi} %if %{with openmpi}
pushd buildopenmpi_dir pushd buildopenmpi_dir
mkdir -p $RPM_BUILD_ROOT%{_libmpidir} $RPM_BUILD_ROOT%{_incmpidir}/%{name} %{_openmpi_load}
mkdir -p $RPM_BUILD_ROOT$MPI_LIB $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT%{_libmpidir} install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT$MPI_LIB
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpidir}/libpetsc.so ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpidir}/libpetsc.so.3.7 ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so.3.7
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_incmpidir}/%{name} install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
cp -a include/* $RPM_BUILD_ROOT%{_incmpidir}/%{name} cp -a include/* $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
%{_openmpi_unload}
popd popd
%endif %endif
%if %{with mpich} %if %{with mpich}
pushd buildmpich_dir pushd buildmpich_dir
mkdir -p $RPM_BUILD_ROOT%{_libmpichdir} $RPM_BUILD_ROOT%{_incmpichdir}/%{name} %{_mpich_load}
mkdir -p $RPM_BUILD_ROOT$MPI_LIB $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT%{_libmpichdir} install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT$MPI_LIB
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpichdir}/libpetsc.so ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpichdir}/libpetsc.so.3.7 ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so.3.7
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_incmpichdir}/%{name} install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
cp -a include/* $RPM_BUILD_ROOT%{_incmpichdir}/%{name} cp -a include/* $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
%{_mpich_unload}
popd popd
%endif %endif
@ -889,7 +917,7 @@ make -C build64 test
%if %{with openmpi} %if %{with openmpi}
%{_openmpi_load} %{_openmpi_load}
export LD_LIBRARY_PATH=%{_libmpidir}:%{_libdir}:%{_builddir}/%{name}-%{version}/buildopenmpi_dir/%{_arch}/lib export LD_LIBRARY_PATH=$MPI_LIB:%{_libdir}:%{_builddir}/%{name}-%{version}/buildopenmpi_dir/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildopenmpi_dir export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildopenmpi_dir
export PETSC_ARCH=%{_arch} export PETSC_ARCH=%{_arch}
export MPI_INTERFACE_HOSTNAME=localhost export MPI_INTERFACE_HOSTNAME=localhost
@ -901,7 +929,7 @@ make -C buildopenmpi_dir test
%if 0%{?fedora} || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
%if %{with mpich} %if %{with mpich}
%{_mpich_load} %{_mpich_load}
export LD_LIBRARY_PATH=%{_libmpichdir}:%{_libdir}:%{_builddir}/%{name}-%{version}/buildmpich_dir/%{_arch}/lib export LD_LIBRARY_PATH=$MPI_LIB:%{_libdir}:%{_builddir}/%{name}-%{version}/buildmpich_dir/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildmpich_dir export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildmpich_dir
export PETSC_ARCH=%{_arch} export PETSC_ARCH=%{_arch}
export MPI_INTERFACE_HOSTNAME=localhost export MPI_INTERFACE_HOSTNAME=localhost
@ -959,6 +987,10 @@ make -C buildmpich_dir test
%endif %endif
%changelog %changelog
* Sun Aug 13 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.6-7
- Superlu_dist needs parmetis
- Use MPI variables
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.6-6 * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild