The package rpms/sundials2.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/sundials2.git/commit/?id=975d6a3d7ae....
Change: +%ifnarch s390x
Thanks.
Full change: ============
commit 975d6a3d7ae6f622332b47ee23efef996f469870 Author: sagitter sagitter@fedoraproject.org Date: Thu Aug 8 21:00:13 2019 +0200
Sundials2 libraries on EPEL7
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da3b8ca --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/sundials-2.7.0.tar.gz diff --git a/sources b/sources new file mode 100644 index 0000000..0c5c26a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (sundials-2.7.0.tar.gz) = c86c167538065a4109b36ae7c8f60f3d92184133cfa661b5acfccee052c38f40be865412a1746bb57907b61602c212c0f15e1e30ef29e8a49db6d46a75a28e69 diff --git a/sundials2-2.7.0-set_superlumt_name.patch b/sundials2-2.7.0-set_superlumt_name.patch new file mode 100644 index 0000000..28c3283 --- /dev/null +++ b/sundials2-2.7.0-set_superlumt_name.patch @@ -0,0 +1,11 @@ +--- config/FindSUPERLUMT.orig.cmake 2016-09-27 00:16:47.000000000 +0200 ++++ config/FindSUPERLUMT.cmake 2016-10-04 12:08:58.202988791 +0200 +@@ -42,7 +42,7 @@ + + else() + # find library with user provided directory path +- set(SUPERLUMT_LIBRARY_NAME superlu_mt_${POST}) ++ set(SUPERLUMT_LIBRARY_NAME superlumt_d) + find_library(SUPERLUMT_LIBRARY ${SUPERLUMT_LIBRARY_NAME} ${SUPERLUMT_LIBRARY_DIR} NO_DEFAULT_PATH) + endif() + mark_as_advanced(SUPERLUMT_LIBRARY) diff --git a/sundials2.spec b/sundials2.spec new file mode 100644 index 0000000..afeddea --- /dev/null +++ b/sundials2.spec @@ -0,0 +1,502 @@ +## Debug builds? +%bcond_with debug +# +%global with_openmpi 1 +%global with_mpich 1 + +%if 0%{?rhel} +%global dts devtoolset-8- +%global dtsbindir /opt/rh/devtoolset-8/root/usr/bin/ +%endif + +Summary: Suite of nonlinear solvers +Name: sundials2 +Version: 2.7.0 +Release: 1%{?dist} +# SUNDIALS is licensed under BSD with some additional (but unrestrictive) clauses. +# Check the file 'LICENSE' for details. +License: BSD +URL: https://www.llnl.gov/casc/sundials/ +Source0: https://www.llnl.gov/casc/sundials/download/code/sundials-%%7Bversion%7D.tar... + +# This patch rename superLUMT library +Patch0: %{name}-%{version}-set_superlumt_name.patch + +BuildRequires: %{?dts}gcc-gfortran +BuildRequires: %{?dts}gcc +BuildRequires: suitesparse-devel +BuildRequires: cmake3 +BuildRequires: lapack-devel +BuildRequires: blas-devel +BuildRequires: SuperLUMT-devel +BuildRequires: rsh + +Obsoletes: sundials < 0:2.7.0-11 +Obsoletes: sundials-openmp < 0:2.7.0-11 +Obsoletes: sundials-fortran < 0:2.7.0-11 +Obsoletes: sundials-threads < 0:2.7.0-11 + +%description +SUNDIALS is a SUite of Non-linear DIfferential/ALgebraic equation Solvers +for use in writing mathematical software. + +SUNDIALS was implemented with the goal of providing robust time integrators +and nonlinear solvers that can easily be incorporated into existing simulation +codes. The primary design goals were to require minimal information from the +user, allow users to easily supply their own data structures underneath the +solvers, and allow for easy incorporation of user-supplied linear solvers and +preconditioners. + +%package devel +Summary: Suite of nonlinear solvers (developer files) +Requires: %{name}%{?_isa} = %{version}-%{release} +Provides: %{name}-static = %{version}-%{release} +%description devel +SUNDIALS is a SUite of Non-linear DIfferential/ALgebraic equation Solvers +for use in writing mathematical software. +This package contains the developer files (.so file, header files). +############################################################################# +######### +%if 0%{?with_openmpi} +%package openmpi +Summary: Suite of nonlinear solvers +BuildRequires: openmpi-devel +%ifnarch s390x +BuildRequires: hypre-openmpi-devel +%endif +Requires: openmpi +Obsoletes: sundials-openmpi < 0:2.7.0-11 +Obsoletes: sundials-fortran-openmpi < 0:2.7.0-11 +%description openmpi +SUNDIALS is a SUite of Non-linear DIfferential/ALgebraic equation Solvers +for use in writing mathematical software. +This package contains the Sundials Fortran parallel OpenMPI libraries. + +%package openmpi-devel +Summary: Suite of nonlinear solvers +Requires: %{name}-openmpi%{?_isa} = %{version}-%{release} +%description openmpi-devel +SUNDIALS is a SUite of Non-linear DIfferential/ALgebraic equation Solvers +for use in writing mathematical software. +This package contains the Sundials parallel OpenMPI devel libraries and +header files. +%endif +###### +############################################################################### +###### +%if 0%{?with_mpich} +%package mpich +Summary: Suite of nonlinear solvers +BuildRequires: mpich-devel +%ifnarch s390x +BuildRequires: hypre-mpich-devel +%endif +Requires: mpich +Obsoletes: sundials-mpich < 0:2.7.0-11 +Obsoletes: sundials-fortran-mpich < 0:2.7.0-11 +%description mpich +SUNDIALS is a SUite of Non-linear DIfferential/ALgebraic equation Solvers +for use in writing mathematical software. +This package contains the Sundials parallel MPICH libraries. + +%package mpich-devel +Summary: Suite of nonlinear solvers +Requires: %{name}-mpich%{?_isa} = %{version}-%{release} +%description mpich-devel +SUNDIALS is a SUite of Non-linear DIfferential/ALgebraic equation Solvers +for use in writing mathematical software. +This package contains the Sundials parallel MPICH devel libraries and +header files. +%endif +###### +############################################################################# + +%package doc +Summary: Suite of nonlinear solvers (documentation) +BuildArch: noarch +%description doc +SUNDIALS is a SUite of Non-linear DIfferential/ALgebraic equation Solvers +for use in writing mathematical software. +This package contains the documentation files. + +%prep +%setup -qc + +pushd sundials-%{version} +%ifnarch %{power64} aarch64 +%patch0 -p0 +%endif + +# Set destination library's paths +sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/arkode/CMakeLists.txt +sed -i 's|DESTINATION lib|DESTINATION %{_lib}|g' src/arkode/fcmix/CMakeLists.txt +sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/cvode/CMakeLists.txt +sed -i 's|DESTINATION lib|DESTINATION %{_lib}|g' src/cvode/fcmix/CMakeLists.txt +sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/cvodes/CMakeLists.txt +sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/ida/CMakeLists.txt +sed -i 's|DESTINATION lib|DESTINATION %{_lib}|g' src/ida/fcmix/CMakeLists.txt +sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/idas/CMakeLists.txt +sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/kinsol/CMakeLists.txt +sed -i 's|DESTINATION lib|DESTINATION %{_lib}|g' src/kinsol/fcmix/CMakeLists.txt +sed -i 's|DESTINATION lib|DESTINATION %{_lib}|g' src/nvec_openmp/CMakeLists.txt + +# Set pthread library's paths +sed -i 's|INSTALL(TARGETS sundials_nvecpthreads_shared DESTINATION lib)|INSTALL(TARGETS sundials_nvecpthreads_shared DESTINATION %{_libdir})|g' src/nvec_pthreads/CMakeLists.txt +sed -i 's|INSTALL(TARGETS sundials_fnvecpthreads_shared DESTINATION lib)|INSTALL(TARGETS sundials_fnvecpthreads_shared DESTINATION %{_libdir})|g' src/nvec_pthreads/CMakeLists.txt + +# Set serial library's paths +sed -i 's|TARGETS sundials_nvecserial_shared DESTINATION lib|TARGETS sundials_nvecserial_shared DESTINATION %{_libdir}|g' src/nvec_ser/CMakeLists.txt +sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/%{name}/nvector|g' src/nvec_ser/CMakeLists.txt +sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/%{name}/nvector|g' src/nvec_openmp/CMakeLists.txt +sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/%{name}/nvector|g' src/nvec_pthreads/CMakeLists.txt +sed -i 's|DESTINATION include/arkode|DESTINATION %{_includedir}/%{name}/arkode|g' src/arkode/CMakeLists.txt +sed -i 's|DESTINATION include/cvode|DESTINATION %{_includedir}/%{name}/cvode|g' src/cvode/CMakeLists.txt +sed -i 's|DESTINATION include/cvodes|DESTINATION %{_includedir}/%{name}/cvodes|g' src/cvodes/CMakeLists.txt +sed -i 's|DESTINATION include/ida|DESTINATION %{_includedir}/%{name}/ida|g' src/ida/CMakeLists.txt +sed -i 's|DESTINATION include/idas|DESTINATION %{_includedir}/%{name}/idas|g' src/idas/CMakeLists.txt +sed -i 's|DESTINATION include/kinsol|DESTINATION %{_includedir}/%{name}/kinsol|g' src/kinsol/CMakeLists.txt +sed -i 's|DESTINATION include/sundials|DESTINATION %{_includedir}/%{name}|g' src/sundials/CMakeLists.txt +sed -i 's|DESTINATION include/sundials|DESTINATION %{_includedir}/%{name}|g' CMakeLists.txt +sed -i 's|TARGETS sundials_fnvecserial_shared DESTINATION lib|TARGETS sundials_fnvecserial_shared DESTINATION %{_libdir}|g' src/nvec_ser/CMakeLists.txt + +# Rename Libraries +sed -i 's/sundials_arkode/sundials2_arkode/g' src/arkode/CMakeLists.txt +sed -i 's/sundials_farkode/sundials2_farkode/g' src/arkode/fcmix/CMakeLists.txt +sed -i 's/sundials_cvode/sundials2_cvode/g' src/cvode/CMakeLists.txt +sed -i 's/sundials_fcvode/sundials2_fcvode/g' src/cvode/fcmix/CMakeLists.txt +sed -i 's/sundials_cvodes/sundials2_cvodes/g' src/cvodes/CMakeLists.txt +sed -i 's/sundials_ida/sundials2_ida/g' src/ida/CMakeLists.txt +sed -i 's/sundials_fida/sundials2_fida/g' src/ida/fcmix/CMakeLists.txt +sed -i 's/sundials_idas/sundials2_idas/g' src/idas/CMakeLists.txt +sed -i 's/sundials_kinsol/sundials2_kinsol/g' src/kinsol/CMakeLists.txt +sed -i 's/sundials_fkinsol/sundials2_fkinsol/g' src/kinsol/fcmix/CMakeLists.txt +sed -i 's/sundials_nvecopenmp/sundials2_nvecopenmp/g' src/nvec_openmp/CMakeLists.txt +sed -i 's/sundials_fnvecopenmp/sundials2_fnvecopenmp/g' src/nvec_openmp/CMakeLists.txt +sed -i 's/sundials_nvecserial/sundials2_nvecserial/g' src/nvec_ser/CMakeLists.txt +sed -i 's/sundials_fnvecserial/sundials2_fnvecserial/g' src/nvec_ser/CMakeLists.txt +sed -i 's/sundials_nvecpthreads/sundials2_nvecpthreads/g' src/nvec_pthreads/CMakeLists.txt +sed -i 's/sundials_fnvecpthreads/sundials2_fnvecpthreads/g' src/nvec_pthreads/CMakeLists.txt +sed -i 's/sundials_nvecparallel/sundials2_nvecparallel/g' src/nvec_par/CMakeLists.txt +sed -i 's/sundials_fnvecparallel/sundials2_fnvecparallel/g' src/nvec_par/CMakeLists.txt +sed -i 's/sundials_nvecparhyp/sundials2_nvecparhyp/g' src/nvec_parhyp/CMakeLists.txt + +## mpif77 test fails +## Hardened flags break cmake's MPI Fortran compiler test +sed -i 's|set(MPIF_PERFORM_TEST TRUE)|set(MPIF_PERFORM_TEST FALSE)|g' config/SundialsMPIF.cmake +sed -i 's|set(MPIF_FOUND FALSE)|set(MPIF_FOUND TRUE)|g' config/SundialsMPIF.cmake + +mv src/arkode/README src/README-arkode +mv src/cvode/README src/README-cvode +mv src/cvodes/README src/README-cvodes +mv src/ida/README src/README-ida +mv src/idas/README src/README.idas +mv src/kinsol/README src/README-kinsol +mv src/nvec_ser/README src/README-nvec_ser +mv src/nvec_par/README src/README-nvec_par +mv src/nvec_pthreads/README src/README-nvec_pthreads +popd + +%if 0%{?with_openmpi} +cp -a sundials-%{version} buildopenmpi_dir +%endif +%if 0%{?with_mpich} +cp -a sundials-%{version} buildmpich_dir +%endif + +%build +pushd sundials-%{version} +mkdir -p build && cd build +%if %{with debug} +export CFLAGS="" +cmake \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_C_FLAGS_DEBUG:STRING="-O0 -g -Wl,-z,relro -Wl,-z,now" \ + -DCMAKE_Fortran_FLAGS_DEBUG:STRING="-O0 -g -Wl,-z,relro -Wl,-z,now -I%{_fmoddir} -pthread -fopenmp" \ + -DCMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING="%{__global_ldflags} -Wl,-z,now -lklu -llapack -lblas -lgomp -lsuperlumt_d -lpthread -lm" \ +%else +%cmake3 \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -Wl,-z,now -pthread -fopenmp" \ + -DCMAKE_Fortran_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -Wl,-z,now -pthread -fopenmp" \ + -DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} -Wl,-z,now -lklu -llapack -lblas -lgomp -lsuperlumt_d -lpthread -lm" \ +%endif + -DCMAKE_C_COMPILER:FILE=%{?dtsbindir}gcc \ + -DCMAKE_Fortran_COMPILER:FILE=%{?dtsbindir}gcc-gfortran \ + -DCMAKE_MODULE_LINKER_FLAGS:STRING="%{__global_ldflags} -Wl,-z,now" \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DEXAMPLES_ENABLE=OFF -DEXAMPLES_INSTALL=OFF \ + -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ + -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF \ + -DMPI_ENABLE:BOOL=OFF \ + -DCMAKE_Fortran_COMPILER:STRING=gfortran \ + -DFCMIX_ENABLE:BOOL=ON \ + -DF90_ENABLE:BOOL=ON \ + -DUSE_GENERIC_MATH:BOOL=ON \ + -DOPENMP_ENABLE:BOOL=ON \ + -DCXX_ENABLE:BOOL=ON \ + -DPTHREAD_ENABLE:BOOL=ON \ + -DLAPACK_ENABLE:BOOL=ON \ + -DSUNDIALS_PRECISION:STRING=double \ + -DSUPERLUMT_ENABLE:BOOL=ON \ + -DSUPERLUMT_INCLUDE_DIR:PATH=%{_includedir}/SuperLUMT \ + -DSUPERLUMT_LIBRARY_DIR:PATH=%{_libdir} \ + -DSUPERLUMT_THREAD_TYPE:STRING=OpenMP \ + -DHYPRE_ENABLE:BOOL=OFF \ + -DKLU_ENABLE=ON -DKLU_LIBRARY_DIR:PATH=%{_libdir} -DKLU_INCLUDE_DIR:PATH=%{_includedir}/suitesparse -Wno-dev .. + +%make_build +cd .. +popd + +############################################################################# +####### +%if 0%{?with_openmpi} +pushd buildopenmpi_dir +##Set openmpi library's paths +sed -i 's|TARGETS sundials2_nvecparallel_shared DESTINATION lib|TARGETS sundials2_nvecparallel_shared DESTINATION %{_libdir}/openmpi/lib|g' src/nvec_par/CMakeLists.txt +sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/openmpi-%{_arch}/%{name}/nvector|g' src/nvec_par/CMakeLists.txt +sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/openmpi-%{_arch}/%{name}/nvector|g' src/nvec_parhyp/CMakeLists.txt +sed -i 's|TARGETS sundials2_fnvecparallel_shared DESTINATION lib|TARGETS sundials2_fnvecparallel_shared DESTINATION %{_libdir}/openmpi/lib|g' src/nvec_par/CMakeLists.txt +sed -i 's|TARGETS sundials2_nvecparhyp_shared DESTINATION lib|TARGETS sundials2_nvecparhyp_shared DESTINATION %{_libdir}/openmpi/lib|g' src/nvec_parhyp/CMakeLists.txt + +mkdir -p build && cd build +%{_openmpi_load} +export CC=mpicc +export CXX=mpicxx +export FC=mpif77 +%if %{with debug} +export CFLAGS="" +cmake \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_C_FLAGS_DEBUG:STRING="-O0 -g -Wl,-z,relro -Wl,-z,now" \ + -DCMAKE_Fortran_FLAGS_DEBUG:STRING="-O0 -g -Wl,-z,relro -Wl,-z,now -I${MPI_FORTRAN_MOD_DIR} -pthread -fopenmp" \ + -DCMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING="%{__global_ldflags} -Wl,-z,now -lm -lpthread -lgomp -lklu \ +%ifnarch s390x +-L${MPI_LIB} -lHYPRE" \ +%endif +%else +%cmake3 \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -Wl,-z,now" \ + -DCMAKE_Fortran_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -Wl,-z,now -pthread -fopenmp" \ +%ifnarch s390x + -DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} -Wl,-z,now -lm -lpthread -lgomp -lklu -L${MPI_LIB} -lHYPRE" \ +%else + -DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} -Wl,-z,now -lm -lpthread -lgomp -lklu" \ +%endif +%endif + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DEXAMPLES_ENABLE=OFF -DEXAMPLES_INSTALL=OFF \ + -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF \ + -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ + -DMPI_ENABLE:BOOL=ON \ + -DMPI_MPICC:STRING=${MPI_BIN}/mpicc \ + -DMPI_RUN_COMMAND=${MPI_BIN}/mpirun \ + -DMPI_MPIF77:STRING=${MPI_BIN}/mpif77 \ + -DFCMIX_ENABLE:BOOL=ON \ + -DF90_ENABLE:BOOL=OFF \ + -DUSE_GENERIC_MATH:BOOL=ON \ + -DOPENMP_ENABLE:BOOL=ON \ + -DCXX_ENABLE:BOOL=ON \ + -DCMAKE_Fortran_COMPILER:STRING=${MPI_BIN}/mpif77 \ + -DPTHREAD_ENABLE:BOOL=ON \ + -DLAPACK_ENABLE:BOOL=ON \ + -DSUPERLUMT_ENABLE:BOOL=OFF \ +%ifnarch s390x + -DHYPRE_ENABLE:BOOL=ON \ + -DHYPRE_INCLUDE_DIR:PATH=${MPI_INCLUDE}/hypre \ + -DHYPRE_LIBRARY_DIR:PATH=${MPI_LIB} \ +%endif + -DKLU_ENABLE=ON -DKLU_LIBRARY_DIR:PATH=%{_libdir} -DKLU_INCLUDE_DIR:PATH=%{_includedir}/suitesparse -Wno-dev .. + +%make_build +%{_openmpi_unload} +cd .. +popd +%endif +###### +############################################################################# +###### +%if 0%{?with_mpich} +pushd buildmpich_dir +##Set mpich library's paths +sed -i 's|TARGETS sundials2_nvecparallel_shared DESTINATION lib|TARGETS sundials2_nvecparallel_shared DESTINATION %{_libdir}/mpich/lib|g' src/nvec_par/CMakeLists.txt +sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/mpich-%{_arch}/%{name}/nvector|g' src/nvec_par/CMakeLists.txt +sed -i 's|DESTINATION include/nvector|DESTINATION %{_includedir}/mpich-%{_arch}/%{name}/nvector|g' src/nvec_parhyp/CMakeLists.txt +sed -i 's|TARGETS sundials2_fnvecparallel_shared DESTINATION lib|TARGETS sundials2_fnvecparallel_shared DESTINATION %{_libdir}/mpich/lib|g' src/nvec_par/CMakeLists.txt +sed -i 's|TARGETS sundials2_nvecparhyp_shared DESTINATION lib|TARGETS sundials2_nvecparhyp_shared DESTINATION %{_libdir}/mpich/lib|g' src/nvec_parhyp/CMakeLists.txt + +mkdir -p build && cd build +%{_mpich_load} +export CC=mpicc +export CXX=mpicxx +export F77=mpif77 +export FC=mpif90 +%if %{with debug} +export CFLAGS="" +cmake \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_C_FLAGS_DEBUG:STRING="-O0 -g -Wl,-z,relro -Wl,-z,now" \ + -DCMAKE_Fortran_FLAGS_DEBUG:STRING="-O0 -g -Wl,-z,relro -Wl,-z,now -I${MPI_FORTRAN_MOD_DIR} -lm -lpthread -lgomp" \ + -DCMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING="%{__global_ldflags} -Wl,-z,now -lm -lpthread -lgomp -lklu \ +%ifnarch s390x +-L${MPI_LIB} -lHYPRE" \ +%endif +%else +%cmake3 \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -Wl,-z,now" \ + -DCMAKE_Fortran_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -Wl,-z,now -lm -lpthread -lgomp" \ +%ifnarch s390x + -DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} -Wl,-z,now -lm -lpthread -lgomp -lklu -L${MPI_LIB} -lHYPRE" \ +%else + -DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} -Wl,-z,now -lm -lpthread -lgomp -lklu" \ +%endif +%endif + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DEXAMPLES_ENABLE=OFF -DEXAMPLES_INSTALL=OFF \ + -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF \ + -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ + -DMPI_ENABLE:BOOL=ON \ + -DMPI_MPICC:STRING=${MPI_BIN}/mpicc \ + -DMPI_RUN_COMMAND=${MPI_BIN}mpirun \ + -DMPI_MPIF77:STRING=${MPI_BIN}/mpif77 \ + -DMPI_MPIF90:STRING=${MPI_BIN}/mpif90 \ + -DFCMIX_ENABLE:BOOL=ON \ + -DF90_ENABLE:BOOL=ON \ + -DUSE_GENERIC_MATH:BOOL=ON \ + -DOPENMP_ENABLE:BOOL=ON \ + -DCXX_ENABLE:BOOL=ON \ + -DCMAKE_Fortran_COMPILER:STRING=${MPI_BIN}/mpif77 \ + -DPTHREAD_ENABLE:BOOL=ON \ + -DLAPACK_ENABLE:BOOL=ON \ + -DSUPERLUMT_ENABLE:BOOL=OFF \ +%ifnarch s390x + -DHYPRE_ENABLE:BOOL=ON \ + -DHYPRE_INCLUDE_DIR:PATH=${MPI_INCLUDE}/hypre \ + -DHYPRE_LIBRARY_DIR:PATH=${MPI_LIB} \ +%endif + -DKLU_ENABLE=ON -DKLU_LIBRARY_DIR:PATH=%{_libdir} -DKLU_INCLUDE_DIR:PATH=%{_includedir}/suitesparse -Wno-dev .. + +%make_build +%{_mpich_unload} +cd .. +popd +%endif +###### +############################################################################# + +%install +%if 0%{?with_openmpi} +%{_openmpi_load} +%make_install -C buildopenmpi_dir/build + +find %{buildroot}${MPI_LIB} -name "libsundials-*" -exec rename 's/libsundials/libsundials2/' {} ; +%{_openmpi_unload} +%endif + +%if 0%{?with_mpich} +%{_mpich_load} +%make_install -C buildmpich_dir/build + +find %{buildroot}${MPI_LIB} -name "libsundials-*" -exec rename 's/libsundials/libsundials2/' {} ; +%{_mpich_unload} +%endif + +%make_install -C sundials-%{version}/build + +%ldconfig_scriptlets + +%files +%license sundials-%{version}/LICENSE +%doc sundials-%{version}/README sundials-%{version}/src/README-* +%{_libdir}/libsundials2_nvecserial.so.* +%{_libdir}/libsundials2_cvode.so.* +%{_libdir}/libsundials2_cvodes.so.* +%{_libdir}/libsundials2_arkode.so.* +%{_libdir}/libsundials2_ida.so.* +%{_libdir}/libsundials2_idas.so.* +%{_libdir}/libsundials2_kinsol.so.* +%{_libdir}/libsundials2_nvecopenmp.so.* +%{_libdir}/libsundials2_fnvecopenmp.so.* +%{_libdir}/libsundials2_fnvecserial.so.* +%{_libdir}/libsundials2_nvecpthreads.so.* +%{_libdir}/libsundials2_fnvecpthreads.so.* + +%files doc +%license sundials-%{version}/LICENSE +%doc sundials-%{version}/README +%doc sundials-%{version}/doc/cvode/cv_examples.pdf +%doc sundials-%{version}/doc/cvode/cv_guide.pdf +%doc sundials-%{version}/doc/kinsol/kin_examples.pdf +%doc sundials-%{version}/doc/kinsol/kin_guide.pdf +%doc sundials-%{version}/doc/cvodes/cvs_examples.pdf +%doc sundials-%{version}/doc/cvodes/cvs_guide.pdf +%doc sundials-%{version}/doc/ida/ida_examples.pdf +%doc sundials-%{version}/doc/ida/ida_guide.pdf +%doc sundials-%{version}/doc/arkode/* + +%files devel +%{_libdir}/libsundials2_nvecserial.so +%{_libdir}/libsundials2_cvode.so +%{_libdir}/libsundials2_cvodes.so +%{_libdir}/libsundials2_arkode.so +%{_libdir}/libsundials2_ida.so +%{_libdir}/libsundials2_idas.so +%{_libdir}/libsundials2_kinsol.so +%{_libdir}/libsundials2_nvecopenmp.so +%{_libdir}/libsundials2_fnvecopenmp.so +%{_libdir}/libsundials2_fnvecserial.so +%{_libdir}/libsundials2_nvecpthreads.so +%{_libdir}/libsundials2_fnvecpthreads.so +%{_libdir}/libsundials2_*.a +%{_includedir}/%{name}/ + +%if 0%{?with_openmpi} +%files openmpi +%license sundials-%{version}/LICENSE +%doc sundials-%{version}/README sundials-%{version}/src/README-nvec_par +%{_libdir}/openmpi/lib/libsundials2_nvecparallel.so.* +%{_libdir}/openmpi/lib/libsundials2_fnvecparallel.so.* +%ifnarch s390x +%{_libdir}/openmpi/lib/libsundials2_nvecparhyp.so.* +%endif + +%files openmpi-devel +%{_includedir}/openmpi-%{_arch}/%{name}/ +%{_libdir}/openmpi/lib/libsundials2_nvecparallel.so +%{_libdir}/openmpi/lib/libsundials2_fnvecparallel.so +%ifnarch s390x +%{_libdir}/openmpi/lib/libsundials2_nvecparhyp.so +%endif +%endif + +%if 0%{?with_mpich} +%files mpich +%license sundials-%{version}/LICENSE +%doc sundials-%{version}/README sundials-%{version}/src/README-nvec_par +%{_libdir}/mpich/lib/libsundials2_nvecparallel.so.* +%{_libdir}/mpich/lib/libsundials2_fnvecparallel.so.* +%ifnarch s390x +%{_libdir}/mpich/lib/libsundials2_nvecparhyp.so.* +%endif + +%files mpich-devel +%{_includedir}/mpich-%{_arch}/%{name}/ +%{_libdir}/mpich/lib/libsundials2_nvecparallel.so +%{_libdir}/mpich/lib/libsundials2_fnvecparallel.so +%ifnarch s390x +%{_libdir}/mpich/lib/libsundials2_nvecparhyp.so +%endif +%endif + +%changelog +* Sat Jul 27 2019 Antonio Trande <sagitterATfedoraproject.org> - 2.7.0-1 +- Sundials2 libraries on EPEL +- Use devtooolset-8
arch-excludes@lists.fedoraproject.org