New package (bz#1350257)

This commit is contained in:
sagitter 2016-10-24 19:59:33 +02:00
parent 37cab28f10
commit ece75dc88c
10 changed files with 1174 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/petsc-3.7.4.tar.gz

15
petsc-3.7-no-rpath.patch Normal file
View File

@ -0,0 +1,15 @@
---
config/BuildSystem/config/setCompilers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- config/BuildSystem/config/setCompilers.py
+++ config/BuildSystem/config/setCompilers.py
@@ -1387,7 +1387,7 @@
self.pushLanguage(language)
# test '-R' before '-rpath' as sun compilers [c,fortran] don't give proper errors with wrong options.
if not Configure.isDarwin(self.log):
- testFlags = ['-Wl,-rpath,', '-R','-rpath ' , '-Wl,-R,']
+ testFlags = []
else:
testFlags = ['-Wl,-rpath,']
# test '-R' before '-Wl,-rpath' for SUN compilers [as cc on linux accepts -Wl,-rpath, but f90 & CC do not.

View File

@ -0,0 +1,10 @@
--- src/dm/impls/plex/plexcgns.c~ 2015-06-09 22:24:49.000000000 +0100
+++ src/dm/impls/plex/plexcgns.c 2015-07-04 23:16:15.861601437 +0100
@@ -1,6 +1,7 @@
#define PETSCDM_DLL
#include <petsc/private/dmpleximpl.h> /*I "petscdmplex.h" I*/
+#undef I
#if defined(PETSC_HAVE_CGNS)
#include <cgnslib.h>
#include <cgns_io.h>

View File

@ -0,0 +1,17 @@
diff --git a/lib/petsc/conf/rules b/lib/petsc/conf/rules
index c6cfba4..7491faf 100644
--- lib/petsc/conf/rules
+++ lib/petsc/conf/rules
@@ -60,9 +60,10 @@ chklib_dir: chk_makej
@if [ ! -d "${INSTALL_LIB_DIR}" ]; then \
echo Making directory ${INSTALL_LIB_DIR} for library; ${MKDIR} ${INSTALL_LIB_DIR} ; fi
-
# 3. Check if the shared libs are out of date
-chkopts: chk_upgrade
+chkopts:
+ @true
+chkopts_disabled: chk_upgrade
@for LIBNAME in ${SHLIBS}; do \
library=${INSTALL_LIB_DIR}/$$LIBNAME.a; \
sharedlibrary=${INSTALL_LIB_DIR}/$$LIBNAME.${SL_LINKER_SUFFIX}; \

32
petsc-lib64.patch Normal file
View File

@ -0,0 +1,32 @@
---
config/BuildSystem/config/setCompilers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- config/BuildSystem/config/setCompilers.py
+++ config/BuildSystem/config/setCompilers.py
@@ -1387,7 +1387,7 @@
self.pushLanguage(language)
# test '-R' before '-rpath' as sun compilers [c,fortran] don't give proper errors with wrong options.
if not Configure.isDarwin(self.log):
- testFlags = ['-Wl,-rpath,', '-R','-rpath ' , '-Wl,-R,']
+ testFlags = []
else:
testFlags = ['-Wl,-rpath,']
# test '-R' before '-Wl,-rpath' for SUN compilers [as cc on linux accepts -Wl,-rpath, but f90 & CC do not.
--- gmakefile.orig 2016-05-16 04:57:35.000000000 +0200
+++ gmakefile 2016-06-22 13:59:47.905111833 +0200
@@ -29,10 +30,10 @@
basename_all = $(basename $(basename $(basename $(basename $(1)))))
sl_linker_args = $(call SL_LINKER_FUNCTION,$(call basename_all,$@),$(libpetsc_abi_version),$(libpetsc_lib_version))
-libpetsc_shared := $(LIBDIR)/libpetsc.$(SL_LINKER_SUFFIX)
-libpetsc_soname := $(call soname_function,$(LIBDIR)/libpetsc)
-libpetsc_libname := $(call libname_function,$(LIBDIR)/libpetsc)
-libpetsc_static := $(LIBDIR)/libpetsc.$(AR_LIB_SUFFIX)
+libpetsc_shared := $(LIBDIR)/libpetsc64.$(SL_LINKER_SUFFIX)
+libpetsc_soname := $(call soname_function,$(LIBDIR)/libpetsc64)
+libpetsc_libname := $(call libname_function,$(LIBDIR)/libpetsc64)
+libpetsc_static := $(LIBDIR)/libpetsc64.$(AR_LIB_SUFFIX)
libpetscpkgs_shared := $(foreach pkg, $(pkgs), $(LIBDIR)/libpetsc$(pkg).$(SL_LINKER_SUFFIX))
libpetscpkgs_soname := $(foreach pkg, $(pkgs), $(call soname_function,$(LIBDIR)/libpetsc$(pkg)))
libpetscpkgs_libname := $(foreach pkg, $(pkgs), $(call libname_function,$(LIBDIR)/libpetsc$(pkg)))

13
petsc-mpiuni-check.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/snes/examples/tutorials/makefile b/src/snes/examples/tutorials/makefile
index 38dc7e8..fcac7dd 100644
--- a/src/snes/examples/tutorials/makefile
+++ b/src/snes/examples/tutorials/makefile
@@ -931,7 +931,7 @@ testex19: ex19.PETSc
else echo "Possible error running C/C++ src/snes/examples/tutorials/ex19 with 1 MPI process"; \
echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
cat ex19_1.tmp; fi; \
- if [ "${MPIEXEC}" != "${PETSC_DIR}/bin/petsc-mpiexec.uni" ]; then \
+ if [ ! "${MPI_IS_MPIUNI}" ]; then \
${MPIEXEC} -n 2 ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres > ex19_1.tmp 2>&1; \
if (${DIFF} output/ex19_1.testout ex19_1.tmp > /dev/null 2>&1) then \
echo "C/C++ example src/snes/examples/tutorials/ex19 run successfully with 2 MPI processes"; \

71
petsc-progname.patch Normal file
View File

@ -0,0 +1,71 @@
From 1a5f81e5a142bc6fde36c3a51c072ace33ca0cf8 Mon Sep 17 00:00:00 2001
From: Barry Smith <bsmith@mcs.anl.gov>
Date: Fri, 12 Aug 2016 14:02:28 -0500
Subject: [PATCH] Remove use of unitialized memory by always zeroing out end of
programname in petscinitialize_internal
Time: .5 hours
Reported-by: nightly tests
---
src/sys/objects/ftn-custom/zstart.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/sys/objects/ftn-custom/zstart.c b/src/sys/objects/ftn-custom/zstart.c
index fe16e32..086165e 100644
--- a/src/sys/objects/ftn-custom/zstart.c
+++ b/src/sys/objects/ftn-custom/zstart.c
@@ -250,13 +250,9 @@ extern PetscErrorCode PetscInitializeSAWs(const char[]);
*/
PETSC_EXTERN void PETSC_STDCALL petscinitialize_(CHAR filename PETSC_MIXED_LEN(len),PetscErrorCode *ierr PETSC_END_LEN(len))
{
+ int j,i;
#if defined (PETSC_USE_NARGS)
- short flg,i;
-#else
- int i;
-#if !defined(PETSC_HAVE_PXFGETARG_NEW) && !defined (PETSC_HAVE_PXFGETARG_NEW) && !defined(PETSC_HAVE_FORTRAN_GET_COMMAND_ARGUMENT)
- int j;
-#endif
+ short flg;
#endif
#if defined(PETSC_HAVE_CUDA)
PetscBool flg2;
@@ -267,7 +263,7 @@ PETSC_EXTERN void PETSC_STDCALL petscinitialize_(CHAR filename PETSC_MIXED_LEN(l
char *t1,name[256],hostname[64];
PetscMPIInt f_petsc_comm_world;
- *ierr = PetscMemzero(name,256); if (*ierr) return;
+ *ierr = PetscMemzero(name,sizeof(name)); if (*ierr) return;
if (PetscInitializeCalled) {*ierr = 0; return;}
/* this must be initialized in a routine, not as a constant declaration*/
@@ -283,7 +279,7 @@ PETSC_EXTERN void PETSC_STDCALL petscinitialize_(CHAR filename PETSC_MIXED_LEN(l
if (*ierr) return;
i = 0;
#if defined (PETSC_HAVE_FORTRAN_GET_COMMAND_ARGUMENT) /* same as 'else' case */
- getarg_(&i,name,256);
+ getarg_(&i,name,sizeof(name));
#elif defined (PETSC_HAVE_PXFGETARG_NEW)
{ int ilen,sierr;
getarg_(&i,name,&ilen,&sierr,256);
@@ -294,15 +290,15 @@ PETSC_EXTERN void PETSC_STDCALL petscinitialize_(CHAR filename PETSC_MIXED_LEN(l
GETARG(&i,name,256,&flg);
#else
getarg_(&i,name,256);
+#endif
/* Eliminate spaces at the end of the string */
- for (j=254; j>=0; j--) {
+ for (j=sizeof(name)-2; j>=0; j--) {
if (name[j] != ' ') {
name[j+1] = 0;
break;
}
}
if (j<0) PetscStrncpy(name,"Unknown Name",256);
-#endif
*ierr = PetscSetProgramName(name);
if (*ierr) {(*PetscErrorPrintf)("PetscInitialize: Calling PetscSetProgramName()\n");return;}
--
2.7.4.1.g5468f9e

View File

@ -0,0 +1,33 @@
From 69cca02db8de80df74bb113429c95518e4fd7281 Mon Sep 17 00:00:00 2001
From: Satish Balay <balay@mcs.anl.gov>
Date: Thu, 13 Oct 2016 09:02:19 -0500
Subject: [PATCH] test: remove false positive errorcheck with
-Werror=format-security option
---
lib/petsc/conf/rules | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/petsc/conf/rules b/lib/petsc/conf/rules
index 3716e42..bf09884 100644
--- a/lib/petsc/conf/rules
+++ b/lib/petsc/conf/rules
@@ -488,6 +488,7 @@ getautoconfargs:
grep -v "may result in errors or" | \
grep -v "clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated" | \
grep -v "is deprecated" | \
+ grep -v "Werror=format-security" | \
egrep -i '(Error|warning|Can|Unresolved)' >> /dev/null;\
if [ "$$?" != 1 ]; then \
printf ${PETSC_TEXT_HILIGHT}"*******************Error detected during compile or link!*******************\n";\
@@ -533,6 +534,7 @@ getautoconfargs:
grep -v "IPO Error: unresolved" | \
grep -v "warning multiple definitions of symbol _matdensegetarray_" | \
grep -v "clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated" | \
+ grep -v "Werror=format-security" | \
egrep -i '(Error|warning|Can|Unresolved)' >> /dev/null ; \
if [ "$$?" != 1 ]; then \
printf ${PETSC_TEXT_HILIGHT}"*******************Error detected during compile or link!*******************\n";\
--
2.7.4.1.g5468f9e

981
petsc.spec Normal file
View File

@ -0,0 +1,981 @@
# default harden flags breaks gfortran work
%undefine _hardened_build
# Testing ?
%bcond_without check
## Debug builds
%bcond_with debug
#
# Define _pkgdocdir macro on epel
%{?el6:%global _pkgdocdir %{_docdir}/%{name}}
%{?el7:%global _pkgdocdir %{_docdir}/%{name}}
#
# No MPI support on these arches
%ifnarch s390 s390x
%bcond_without openmpi
%endif
# No MPICH support on these arches
%if 0%{?rhel} || 0%{?rhel} < 7
%ifarch %{power64}
%bcond_with mpich
%endif
%endif
%if 0%{?rhel} || 0%{?rhel} < 7
%ifnarch %{power64}
%bcond_without mpich
%endif
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%bcond_without mpich
%endif
# We are using blas/lapack on s390x architectures only
# since openblas is not provided
%bcond_without blas
#
## PETSC looks incompatible with serial MUMPS
%bcond_with mumps_serial
#
## Does not build with SuperLU < 5.2.0
%if 0%{?fedora} >= 25
%bcond_without superlu
%endif
#
# hdf5' is required by 'cgns'
# hdf5 needs MPI
%if 0%{?fedora} || 0%{?rhel} >= 7
%bcond_without cgns
%bcond_without hdf5
%else
%bcond_with cgns
%bcond_with hdf5
%endif
# With suitesparse support ?
%{!?el6:%global with_suitesparse 1}
#
## PETSc needs fftw's MPI implementation
%if 0%{?fedora} >= 25
%bcond_without fftw
%else
%bcond_with fftw
%endif
#
# 'scalapack' is required by 'mumps'
%if %{with openmpi}
%bcond_without mpi
%bcond_without sundials
%bcond_without scalapack
%bcond_without ptscotch
%bcond_without mumps
%bcond_without hypre
%global _incmpidir %{_includedir}/openmpi-%{_arch}
%global _libmpidir %{_libdir}/openmpi/lib
%endif
%if %{with mpich}
%bcond_without mpi
%bcond_without sundials
%bcond_without scalapack
%bcond_without ptscotch
%bcond_without mumps
%bcond_without hypre
%global _incmpichdir %{_includedir}/mpich-%{_arch}
%global _libmpichdir %{_libdir}/mpich/lib
%endif
# 64bit-int libs not built
# bz#1382916
%if %{?__isa_bits:%{__isa_bits}}%{!?__isa_bits:32} == 64
# blas64 not in el6
%if 0%{?el6}
%bcond_with arch64
%else
%bcond_with arch64
%endif
%else
%bcond_with arch64
%endif
%if 0%{?el6}
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}
%endif
%if %{with arch64}
%bcond_without blas64
%endif
Name: petsc
Summary: Portable Extensible Toolkit for Scientific Computation
Version: 3.7.4
Release: 8%{?dist}
License: BSD
URL: https://www.mcs.anl.gov/petsc
Source0: http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-%{version}.tar.gz
## Remove rpath flags
Patch0: %{name}-3.7-no-rpath.patch
## Rename library name for 64-bit integer package
Patch1: %{name}-lib64.patch
# Avoid a clash with complex.h
Patch2: %{name}-avoid_clash_with_complex.h.patch
# Diable checkopts and petscnagupgrade.py
Patch3: %{name}-disable_petscnagupgrade.patch
Patch4: %{name}-progname.patch
Patch5: %{name}-mpiuni-check.patch
Patch6: %{name}-remove_false_positive_errorcheck.patch
%if %{with superlu}
BuildRequires: SuperLU-devel
%endif
%if %{with sundials}
BuildRequires: sundials-devel
%endif
%if %{with mumps_serial}
BuildRequires: MUMPS-devel
%endif
%if 0%{?with_suitesparse}
BuildRequires: suitesparse-devel
%endif
%if %{with blas}
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
BuildRequires: blas-devel
BuildRequires: lapack-devel
%else
BuildRequires: openblas-devel
%endif
%endif
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: libX11-devel
BuildRequires: python2-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: valgrind-devel
BuildRequires: tcsh
%description
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations.
%package devel
Summary: Portable Extensible Toolkit for Scientific Computation (developer files)
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: gcc-gfortran%{?_isa}
%description devel
Portable Extensible Toolkit for Scientific Computation (developer files).
%package doc
Summary: Portable Extensible Toolkit for Scientific Computation (documentation files)
BuildArch: noarch
%description doc
Portable Extensible Toolkit for Scientific Computation.
PDF and HTML documentation files.
%if %{with arch64}
%package -n petsc64
Summary: Portable Extensible Toolkit for Scientific Computation (64bit INTEGER)
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
BuildRequires: blas64-devel
BuildRequires: lapack64-devel
%else
BuildRequires: openblas-serial64 >= 0.2.19-1
BuildRequires: openblas-devel >= 0.2.19-1
%endif
%description -n petsc64
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations (64bit INTEGER).
%package -n petsc64-devel
Requires: %{name}64%{?_isa} = %{version}-%{release}
Requires: gcc-gfortran%{?_isa}
Summary: Portable Extensible Toolkit for Scientific Computation (64bit INTEGER)
%description -n petsc64-devel
Portable Extensible Toolkit for Scientific Computation (developer files)
(64bit INTEGER).
%endif
#############################################################################
#########
%if %{with openmpi}
%package openmpi
Summary: Portable Extensible Toolkit for Scientific Computation (OpenMPI)
BuildRequires: openmpi-devel
%if %{with hdf5}
BuildRequires: hdf5-openmpi-devel
%endif
%if %{with cgns}
BuildRequires: cgnslib-devel
BuildRequires: hdf5-devel
%endif
%if %{with ptscotch}
BuildRequires: ptscotch-openmpi-devel
%endif
%if %{with scalapack}
BuildRequires: scalapack-openmpi-devel
BuildRequires: blacs-openmpi-devel
%endif
%if %{with mumps}
BuildRequires: MUMPS-openmpi-devel
%endif
%if %{with sundials}
BuildRequires: sundials-openmpi-devel
%endif
%if %{with fftw}
BuildRequires: fftw-devel
BuildRequires: fftw-openmpi-devel
%endif
%if %{with hypre}
BuildRequires: hypre-openmpi-devel
%endif
%if %{with blas}
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
BuildRequires: blas-devel
BuildRequires: lapack-devel
%else
BuildRequires: openblas-devel
%endif
%endif
%description openmpi
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations.
%package openmpi-devel
Summary: Portable Extensible Toolkit for Scientific Computation (OpenMPI)
Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
Requires: openmpi-devel%{?_isa}
%description openmpi-devel
Portable Extensible Toolkit for Scientific Computation (developer files).
%endif
######
###############################################################################
######
%if %{with mpich}
%package mpich
Summary: Portable Extensible Toolkit for Scientific Computation (MPICH)
BuildRequires: mpich-devel
%if %{with hdf5}
BuildRequires: hdf5-mpich-devel
%endif
%if %{with cgns}
BuildRequires: cgnslib-devel
BuildRequires: hdf5-devel
%endif
%if %{with ptscotch}
BuildRequires: ptscotch-mpich-devel
%endif
%if %{with scalapack}
BuildRequires: scalapack-mpich-devel
BuildRequires: blacs-mpich-devel
%endif
%if %{with mumps}
BuildRequires: MUMPS-mpich-devel
%endif
%if %{with sundials}
BuildRequires: sundials-mpich-devel
%endif
%if %{with hypre}
BuildRequires: hypre-mpich-devel
%endif
%if %{with fftw}
BuildRequires: fftw-devel
BuildRequires: fftw-mpich-devel
%endif
%if %{with blas}
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
BuildRequires: blas-devel
BuildRequires: lapack-devel
%else
BuildRequires: openblas-devel
%endif
%endif
%if 0%{?el6}
Requires: mpich%{?_isa}
%endif
%description mpich
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations.
%package mpich-devel
Summary: Portable Extensible Toolkit for Scientific Computation (MPICH)
Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
Requires: mpich-devel%{?_isa}
%description mpich-devel
Portable Extensible Toolkit for Scientific Computation (developer files).
%endif
######
#############################################################################
%prep
%setup -q -c
pushd %{name}-%{version}
%patch3 -p0
%patch4 -p1
%patch5 -p1
%patch6 -p1
popd
%if %{with arch64}
cp -a %{name}-%{version} build64
pushd build64
%patch1 -p0
%if 0%{?fedora} || 0%{?rhel} >= 7
%patch2 -p0
%endif
popd
%endif
pushd %{name}-%{version}
find . -name 'setup.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
find . -name 'configure' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
find config -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
find src/benchmarks/streams -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
%patch0 -p0
%if 0%{?fedora} || 0%{?rhel} >= 7
%patch2 -p0
%endif
popd
%if %{with openmpi}
cp -a %{name}-%{version} buildopenmpi_dir
%endif
%if %{with mpich}
cp -a %{name}-%{version} buildmpich_dir
%endif
%build
pushd %{name}-%{version}
%configure CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC" \
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=0 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
--CC=gcc \
--FC=gfortran \
--CXX=g++ \
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
--with-threadsafety=0 --with-log=1 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas}
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
--with-blas-lib=-lblas \
--with-lapack-lib=-llapack \
--known-64-bit-blas-indices=0 \
%else
--with-blas-lapack-lib=-lopenblas \
--known-64-bit-blas-indices=0 \
%endif
%endif
%if %{with superlu}
--with-superlu=1 \
--with-superlu-include=%{_includedir}/SuperLU \
--with-superlu-lib=-lsuperlu \
%endif
--with-mpiuni-fortran-binding=1 \
%if %{with mumps_serial}
--with-mumps-serial=1 \
--with-mumps-include=%{_includedir}/MUMPS \
--with-mumps-lib="-lmumps_common -ldmumps -lpord" \
%endif
--with-mpi=0 \
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
%if 0%{?with_suitesparse}
--with-suitesparse=1 \
--with-suitesparse-include=%{_includedir}/suitesparse \
--with-suitesparse-lib="-lumfpack -lklu -lcholmod -lamd" \
%endif
%if %{with superlu}
--with-superlu=1 \
--with-superlu-include=%{_includedir}/SuperLU \
--with-superlu-lib=-lsuperlu \
%endif
--with-pthread=1 \
--with-valgrind=1
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/%{name}-%{version} PETSC_ARCH=%{_arch} all
popd
%if %{with arch64}
pushd build64
%configure CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC" \
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=1 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
--CC=gcc \
--FC=gfortran \
--CXX=g++ \
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
--with-mpi=0 \
--with-mpiuni-fortran-binding=1 \
--with-threadsafety=0 --with-log=1 \
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas64}
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
--with-blas-lib="-lblas64" \
--with-lapack-lib="-llapack64" \
--known-64-bit-blas-indices=1 \
%else
--with-blas-lapack-lib="-lopenblas64" \
--known-64-bit-blas-indices=1 \
%endif
%endif
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
--with-pthread=1 \
--with-valgrind=1
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/build64 PETSC_ARCH=%{_arch} all
popd
%endif
%if %{with openmpi}
pushd buildopenmpi_dir
%{_openmpi_load}
%configure CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC" \
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=0 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
--CC=%{_libdir}/openmpi/bin/mpicc \
--CXX=%{_libdir}/openmpi/bin/mpicxx \
--FC=%{_libdir}/openmpi/bin/mpif77 \
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
--with-threadsafety=0 --with-log=1 \
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas}
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
--with-blas-lib="-lblas" \
--with-lapack-lib="-llapack" \
--known-64-bit-blas-indices=0 \
%else
--with-blas-lapack-lib="-lopenblas" \
--known-64-bit-blas-indices=0 \
%endif
%endif
%if %{with scalapack}
--with-scalapack=1 \
--with-scalapack-lib="-L%{_libmpidir} -lscalapack" \
--with-scalapck-include="" \
%endif
%if %{with mpi}
--with-mpi=1 \
--with-mpi-compilers=%{_libdir}/openmpi/bin/mpicc \
--with-mpiexec=%{_libdir}/openmpi/bin/mpiexec \
--with-mpiuni-fortran-binding=0 \
%endif
%if %{with cgns}
--with-cgns=1 \
--with-cgns-include="" \
--with-cgns-lib="-L%{_libmpidir} -lhdf5 -lcgns" \
%endif
%if %{with hdf5}
--with-hdf5=1 \
--with-hdf5-include="" \
--with-hdf5-lib="-L%{_libmpidir} -lhdf5" \
%endif
%if %{with ptscotch}
--with-ptscotch=1 \
--with-ptscotch-include="" \
--with-ptscotch-lib="-L%{_libmpidir} -lptscotch -lscotch -lptscotcherr -lscotcherr" \
%endif
%if %{with mumps}
--with-mumps=1 \
--with-mumps-include="" \
--with-mumps-lib="-L%{_libmpidir} -lmumps_common -ldmumps -lpord" \
%endif
%if %{with sundials}
--with-sundials=1 \
--with-sundials-include="" \
--with-sundials-lib="-L%{_libmpidir} -lsundials_nvecparallel -lsundials_cvode" \
%endif
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
%if %{with hypre}
--with-hypre=1 \
--with-hypre-include=%{_incmpidir}/hypre \
--with-hypre-lib="-L%{_libmpidir} -lHYPRE" \
%endif
%if %{with fftw}
--with-fftw=1 \
--with-fftw-include="" \
--with-fftw-lib="-L%{_libmpidir} -lfftw3_mpi -lfftw3" \
%endif
--with-pthread=1 \
--with-valgrind=1
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/buildopenmpi_dir PETSC_ARCH=%{_arch} all
%{_openmpi_unload}
popd
%endif
%if %{with mpich}
pushd buildmpich_dir
%{_mpich_load}
%configure CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC" \
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=0 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
--CC=%{_libdir}/mpich/bin/mpicc \
--CXX=%{_libdir}/mpich/bin/mpicxx \
--FC=%{_libdir}/mpich/bin/mpif77 \
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
--with-threadsafety=0 --with-log=1 \
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas}
%ifnarch x86_64 %{ix86} armv7hl %{power64} aarch64
--with-blas-lib=-lblas \
--with-lapack-lib=-llapack \
--known-64-bit-blas-indices=0 \
%else
--with-blas-lapack-lib=-lopenblas \
--known-64-bit-blas-indices=0 \
%endif
%endif
%if %{with scalapack}
--with-scalapack=1 \
--with-scalapack-lib="-L%{_libmpichdir} -lscalapack" \
--with-scalapck-include="" \
%endif
%if %{with mpi}
--with-mpi=1 \
--with-mpi-compilers=%{_libdir}/mpich/bin/mpicc \
--with-mpiexec=%{_libdir}/mpich/bin/mpiexec \
--with-mpiuni-fortran-binding=0 \
%endif
%if %{with cgns}
--with-cgns=1 \
--with-cgns-include="" \
--with-cgns-lib="-L%{_libmpichdir} -lhdf5 -lcgns" \
%endif
%if %{with hdf5}
--with-hdf5=1 \
--with-hdf5-include="" \
--with-hdf5-lib="-L%{_libmpichdir} -lhdf5" \
%endif
%if %{with ptscotch}
--with-ptscotch=1 \
--with-ptscotch-include="" \
--with-ptscotch-lib="-L%{_libmpichdir} -lptscotch -lscotch -lptscotcherr -lscotcherr" \
%endif
%if %{with mumps}
--with-mumps=1 \
--with-mumps-include="" \
--with-mumps-lib="-L%{_libmpichdir} -lmumps_common -ldmumps -lpord" \
%endif
%if %{with sundials}
--with-sundials=1 \
--with-sundials-include="" \
--with-sundials-lib="-L%{_libmpichdir} -lsundials_nvecparallel -lsundials_cvode" \
%endif
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
%if %{with hypre}
--with-hypre=1 \
--with-hypre-include=%{_incmpichdir}/hypre \
--with-hypre-lib="-L%{_libmpichdir} -lHYPRE" \
%endif
%if %{with fftw}
--with-fftw=1 \
--with-fftw-include="" \
--with-fftw-lib="-L%{_libmpichdir} -lfftw3_mpi -lfftw3" \
%endif
--with-pthread=1 \
--with-valgrind=1
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/buildmpich_dir PETSC_ARCH=%{_arch} all
%{_mpich_unload}
popd
%endif
%install
pushd %{name}-%{version}
mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}/%{name}
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT%{_libdir}
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc.so
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc.so.3.7
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
cp -a include/* $RPM_BUILD_ROOT%{_includedir}/%{name}
popd
%if %{with arch64}
pushd build64
mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}/%{name}64
install -pm 755 %{_arch}/lib/libpetsc64.* $RPM_BUILD_ROOT%{_libdir}
ln -sf libpetsc64.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc64.so
ln -sf libpetsc64.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc64.so.3.7
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}64
cp -a include/* $RPM_BUILD_ROOT%{_includedir}/%{name}
popd
%endif
%if %{with openmpi}
pushd buildopenmpi_dir
mkdir -p $RPM_BUILD_ROOT%{_libmpidir} $RPM_BUILD_ROOT%{_incmpidir}/%{name}
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT%{_libmpidir}
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpidir}/libpetsc.so
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpidir}/libpetsc.so.3.7
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_incmpidir}/%{name}
cp -a include/* $RPM_BUILD_ROOT%{_incmpidir}/%{name}
popd
%endif
%if %{with mpich}
pushd buildmpich_dir
mkdir -p $RPM_BUILD_ROOT%{_libmpichdir} $RPM_BUILD_ROOT%{_incmpichdir}/%{name}
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT%{_libmpichdir}
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpichdir}/libpetsc.so
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libmpichdir}/libpetsc.so.3.7
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_incmpichdir}/%{name}
cp -a include/* $RPM_BUILD_ROOT%{_incmpichdir}/%{name}
popd
%endif
# Move html documentation in _pkgdocdir
pushd $RPM_BUILD_ROOT%{_includedir}
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/headers
for i in `find . -name "*.h.html" -type f -print`; do
mv $i $RPM_BUILD_ROOT%{_pkgdocdir}/headers
done
for i in `find . -name "*.html" -type f -print`; do
mv $i $RPM_BUILD_ROOT%{_pkgdocdir}/headers
done
find . -name "Makefile" -type f -print | xargs /bin/rm -f
popd
cp -a %{name}-%{version}/docs/* $RPM_BUILD_ROOT%{_pkgdocdir}
#
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%if %{with arch64}
%post -n petsc64
/sbin/ldconfig
%postun -n petsc64
/sbin/ldconfig
%endif
%if %{with check}
%check
export LD_LIBRARY_PATH=%{_libdir}:%{_builddir}/%{name}-%{version}/%{name}-%{version}/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/%{name}-%{version}
export PETSC_ARCH=%{_arch}
%if %{with debug}
export PETSCVALGRIND_OPTIONS=" --tool=memcheck --leak-check=yes --track-origins=yes"
make -C %{name}-%{version} test MPIEXEC='%{_builddir}/%{name}-%{version}/%{name}-%{version}/bin/petscmpiexec -valgrind'
%else
make -C %{name}-%{version} test
%endif
%if %{with arch64}
export LD_LIBRARY_PATH=%{_libdir}:%{_builddir}/%{name}-%{version}/build64/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/build64
export PETSC_ARCH=%{_arch}
## 'make test' needs to link against -lpetsc
## Not elegant fix
ln -s %{_builddir}/%{name}-%{version}/build64/%{_arch}/lib/libpetsc64.so %{_builddir}/%{name}-%{version}/build64/%{_arch}/lib/libpetsc.so
%if %{with debug}
export PETSCVALGRIND_OPTIONS=" --tool=memcheck --leak-check=yes --track-origins=yes"
make -C build64 test MPIEXEC='%{_builddir}/%{name}-%{version}/build64/bin/petscmpiexec -valgrind'
%else
make -C build64 test
%endif
%endif
%if %{with openmpi}
%{_openmpi_load}
export LD_LIBRARY_PATH=%{_libmpidir}:%{_libdir}:%{_builddir}/%{name}-%{version}/buildopenmpi_dir/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildopenmpi_dir
export PETSC_ARCH=%{_arch}
export MPI_INTERFACE_HOSTNAME=localhost
make -C buildopenmpi_dir test
%{_openmpi_unload}
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%if %{with mpich}
%{_mpich_load}
export LD_LIBRARY_PATH=%{_libmpichdir}:%{_libdir}:%{_builddir}/%{name}-%{version}/buildmpich_dir/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildmpich_dir
export PETSC_ARCH=%{_arch}
export MPI_INTERFACE_HOSTNAME=localhost
make -C buildmpich_dir test
%{_mpich_unload}
%endif
%endif
%endif
%files
%license %{name}-%{version}/LICENSE
%{_libdir}/libpetsc.so.*
%files devel
%{_libdir}/libpetsc.so
%{_includedir}/%{name}/
%files doc
%license %{name}-%{version}/LICENSE
%{_pkgdocdir}/
%if %{with arch64}
%files -n petsc64
%license build64/LICENSE
%{_libdir}/libpetsc64.so.*
%files -n petsc64-devel
%{_libdir}/libpetsc64.so
%{_includedir}/%{name}64/
%endif
%if %{with openmpi}
%files openmpi
%license buildopenmpi_dir/LICENSE
%{_libmpidir}/libpetsc.so.*
%files openmpi-devel
%{_libmpidir}/libpetsc.so
%{_incmpidir}/%{name}/
%endif
%if %{with mpich}
%files mpich
%license buildmpich_dir/LICENSE
%{_libmpichdir}/libpetsc.so.*
%files mpich-devel
%{_libmpichdir}/libpetsc.so
%{_incmpichdir}/%{name}/
%endif
%changelog
* Sat Oct 22 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-8
- Build 64bit-int libs (bz#1382916)
* Fri Oct 21 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-7
- Install missing header files
* Wed Oct 19 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-6
- Add the -O3 to restore vectorization over the RPM defaults
- Remove gmp support
* Thu Oct 13 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-5
- 64bit-int libs not built (bz#1382916)
- Enable gmp and suitesparse support
* Thu Oct 13 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-4
- superlu and fftw enabled
- Fixed settings of compiler flags
- Disable flags for "hardened" builds
* Mon Oct 10 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-3
- Enabled fftw-mpi support (Fedora > 24)
- Omitted PAPI (obsolete)
- Omitted tetgen support (used with C++)
* Sun Oct 09 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-2
- Default optimization level (-O2)
* Sun Oct 09 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-1
- Update to 3.7.4
- PAPI support disabled (upstream advice)
* Sat Oct 08 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-8
- Add tcsh as BR package
- Patched for disabling petscnagupgrade.py check
* Fri Oct 07 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-7
- Use Make for testing
* Thu Oct 06 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-6
- Remove linkage to mpiblacs
- Tests enabled
* Thu Oct 06 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-5
- hwloc/metis (needs parmetis) disabled (upstream advice)
- X support enabled
- Libraries detection disabled
* Wed Oct 05 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-4
- Fix library paths
* Wed Oct 05 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-3
- Fix PTScotch
* Wed Oct 05 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-2
- Disabled fftw support
* Wed Sep 28 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-1
- Update to 3.7.3
- Remove module files
* Tue Sep 13 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-12
- Fix MAKE_NP option
- Remove --known-endian option
- Use architecture condition for openblas
- Fix unused-direct-shlib-dependency warnings
* Fri Aug 26 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-11
- Use SuperLU on >=f25 only
* Thu Aug 25 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-10
- Some fixes for epel6 builds
- Add -O3 flag
- Headers installed under a private directory
- Use %%{_modulesdir} macro
- Use 'openblas' instead of 'blas'
* Wed Aug 10 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-9
- Fortran modules moved into devel sub-packages
- Some fixes of SPEC file's lines
- Set compiler/linker flags against PAPI-5.1.1 on epel6
* Thu Jul 28 2016 Dave Love <loveshack@fedoraproject.org> - 3.7.2-8
- Support el6
- Add cgnslib support
* Sat Jul 23 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-7
- Rebuild with Hypre support
* Sun Jul 10 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-6
- Packed additional header files
- Tests performed on EPEL7
* Mon Jun 27 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-5
- Perform tests one-by-one
- Packaged all documentation files
* Mon Jun 27 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-4
- Build OpenMPI/MPICH libraries
- Fix known-endian option
* Mon Jun 27 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-3
- Disable additional libraries
- Build a minimal PETSC
* Fri Jun 24 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-2
- Perform test
* Sun Jun 19 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-1
- New package

View File

@ -0,0 +1 @@
aaf94fa54ef83022c14091f10866eedf petsc-3.7.4.tar.gz