Hello community, here is the log from the commit of package hypre for openSUSE:Factory checked in at 2019-07-05 13:48:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hypre (Old) and /work/SRC/openSUSE:Factory/.hypre.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hypre" Fri Jul 5 13:48:40 2019 rev:2 rq:680428 version:2.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/hypre/hypre.changes 2019-01-28 20:49:04.301865489 +0100 +++ /work/SRC/openSUSE:Factory/.hypre.new.4615/hypre.changes 2019-07-05 13:48:41.445450773 +0200 @@ -1,0 +2,39 @@ +Wed Feb 27 09:16:16 UTC 2019 - Egbert Eich <[email protected]> + +- Build the examples and docs as a separate HPC package. +- Made example and doc packages 'noarch'. +- Remove duplicates from examples. +- Fix rpmlint warnings about macros in comments. +- Fix library path to work both on 32 and 64 bit. + +------------------------------------------------------------------- +Tue Feb 26 09:41:05 UTC 2019 - [email protected] + +- Switched to cmake build system to fix boo#1126367 + * added hypre_CMakeLists.patch for proper version numbering + * added dependency for lapack and superlu devel for non hpc builds +- Due to boo#1127070 does not compile for mvapich2/mpich + +------------------------------------------------------------------- +Wed Feb 13 11:35:06 UTC 2019 - Antoine Ginies <[email protected]> + +- Add a sub examples package to test in prod env + Add: hypre_Makefile_examples.patch + +------------------------------------------------------------------- +Sun Feb 10 22:11:16 UTC 2019 - Egbert Eich <[email protected]> + +- Properly create and tear down default version links when the + HPC master packages are installed/uninstalled. +- Fix dependencies for HPC. +- Add dependency to HPC modulefile. +- Fix package groups. +- Add pkgconfig file. +- Consolidate use of openmpi1, openmpi2, openmpi3 for non-HPC builds. + +------------------------------------------------------------------- +Fri Jan 25 13:29:16 UTC 2019 - [email protected] + +- Disable openmpi1 builds on SLE. + +------------------------------------------------------------------- New: ---- hypre_CMakeLists.patch hypre_Makefile_examples.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hypre.spec ++++++ --- /var/tmp/diff_new_pack.sXIJWT/_old 2019-07-05 13:48:42.053451710 +0200 +++ /var/tmp/diff_new_pack.sXIJWT/_new 2019-07-05 13:48:42.057451717 +0200 @@ -16,7 +16,7 @@ # -%global flavor @BUILD_FLAVOR@ +%global flavor @BUILD_FLAVOR@%{?nil} %define ver 2.15.1 %define _ver 2_15_1 %define somver 0 @@ -27,8 +27,12 @@ %define PNAME %(echo %{pname} | tr [a-z] [A-Z]) %if 0%{?is_opensuse} || 0%{?is_backports} +%undefine DisOMPI1 +%undefine DisOMPI2 %undefine DisOMPI3 %else +%define DisOMPI1 ExclusiveArch: do_not_build +%undefine DisOMPI2 %define DisOMPI3 ExclusiveArch: do_not_build %endif @@ -41,19 +45,21 @@ %undefine suffix %undefine mpi_family %bcond_with hpc -%define install_doc 1 +%bcond_without install_doc %endif %if "%{flavor}" == "openmpi" %global mpi_family openmpi %define mpi_vers 1 %bcond_with hpc +%{?DisOMPI1} %endif %if "%{flavor}" == "openmpi2" %global mpi_family openmpi %define mpi_vers 2 %bcond_with hpc +%{?DisOMPI2} %endif %if "%{flavor}" == "mvapich2" @@ -66,6 +72,14 @@ %bcond_with hpc %endif +%if "%{flavor}" == "doc-hpc" +%bcond_without hpc +%bcond_without install_doc +%bcond_with build_all +%else +%bcond_without build_all +%endif + %if "%{flavor}" == "gnu-mvapich2-hpc" %undefine c_f_ver %define mpi_family mvapich2 @@ -86,6 +100,7 @@ %define mpi_family openmpi %define mpi_vers 1 %bcond_without hpc +%{?DisOMPI1} %endif %if "%{flavor}" == "gnu-openmpi2-hpc" @@ -94,6 +109,7 @@ %define mpi_family openmpi %define mpi_vers 2 %bcond_without hpc +%{?DisOMPI2} %endif %if "%{flavor}" == "gnu-openmpi3-hpc" @@ -111,9 +127,11 @@ %endif %{?mpi_family:%{bcond_without mpi}}%{!?mpi_family:%{bcond_with mpi}} -%{?with_hpc:%{!?compiler_family:%global compiler_family gnu}} -%{?with_mpi:%global my_suffix -%{mpi_family}} +# For compatibility package names +%if "%{mpi_family}" != "openmpi" || "%{mpi_vers}" != "1" +%define mpi_ext %{?mpi_vers} +%endif %if %{without hpc} %if %{without mpi} @@ -122,7 +140,8 @@ %define my_libdir %_libdir %define my_incdir %_includedir %else - %global my_prefix %{_libdir}/mpi/gcc/%{mpi_family} + %global my_suffix -%{?mpi_family}%{?mpi_ext} + %global my_prefix %{_libdir}/mpi/gcc/%{mpi_family}%{?mpi_ext} %global my_bindir %{my_prefix}/bin %global my_libdir %{my_prefix}/%{_lib}/ %global my_incdir %{my_prefix}/include/ @@ -133,7 +152,7 @@ %endif %define libname lib%{PNAME}%{somver}%{?my_suffix} %else # with hpc -%{hpc_init -c %compiler_family %{?c_f_ver:-v %{c_f_ver}} %{?with_mpi:-m {%mpi_family}} %{?mpi_ver:-V %{mpi_ver}} %{?ext:-e %{ext}}} +%{hpc_init %{?compiler_family:-c %compiler_family %{?c_f_ver:-v %{c_f_ver}}} %{?with_mpi:-m {%mpi_family}} %{?mpi_vers:-V %{mpi_vers}} %{?ext:-e %{ext}}} %define my_prefix %hpc_prefix %define my_bindir %hpc_bindir %define my_libdir %hpc_libdir @@ -146,30 +165,34 @@ Version: %{ver} Release: 0 Summary: Scalable algorithms for solving linear systems of equations -License: LGPL-2.1 -Group: Development/Tools/Other +License: LGPL-2.1-only +Group: Productivity/Scientific/Math Url: https://www.llnl.gov/casc/hypre/ Source: https://github.com/LLNL/hypre/archive/v%{version}.tar.gz#/hypre-%{version}.tar.gz +Patch0: hypre_Makefile_examples.patch +Patch1: hypre_CMakeLists.patch + # TODO : add babel #BuildRequires: babel-devel -%if %{without hpc} +%if %{with build_all} + %if %{without hpc} BuildRequires: gcc-c++ BuildRequires: gcc-fortran BuildRequires: lapack-devel BuildRequires: superlu-devel -%if 0%{?with mpi} -BuildRequires: %{mpi_family}-devel -%endif -%else -Requires: %{compiler_family}%{?c_f_ver}-compilers-hpc -Requires: superlu%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel + %if 0%{?with mpi} +BuildRequires: %{mpi_family}%{?mpi_ext}-devel + %endif + %else BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel BuildRequires: %{mpi_family}%{?mpi_vers}-%{compiler_family}%{?c_f_ver}-hpc-macros-devel BuildRequires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel BuildRequires: superlu%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel + %endif +BuildRequires: cmake +%endif # build_all +%if %{with hpc} BuildRequires: suse-hpc -%hpc_requires -%hpc_requires_devel %endif BuildRequires: fdupes # Default library install path @@ -184,6 +207,12 @@ %package -n %{libname} Summary: Scalable algorithms for solving linear systems of equations Group: System/Libraries +%if %{with hpc} +%hpc_requires +Requires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc +Requires: libsuperlu%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc +Requires: lua-lmod >= 7.6.1 +%endif %description -n %{libname} Hypre is a library of preconditioners that feature parallel multigrid @@ -192,29 +221,54 @@ phenomena in the defense, environmental, energy, and biological sciences. -This package contains %{?mpi_family}%{!?mpi_family:serial} shared libraries of Hypre. +This package contains %{?mpi_family}%{?mpi_vers}%{!?mpi_family:serial} shared libraries of Hypre. %package devel Summary: Headers and library links for %{libname} Group: Development/Libraries/C and C++ Requires: %{libname} = %version +Requires: lapack-devel +Requires: superlu-devel +%if %{with hpc} +Requires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel +Requires: superlu%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel +%hpc_requires_devel +%endif %description devel %{PNAME} headers and libraries files needed for development -This package contains development files of the %{?mpi_family}%{!?mpi_family:serial} version of Hypre. +This package contains development files of the %{?mpi_family}%{?mpi_vers}%{!?mpi_family:serial} version of Hypre. +%package examples +Summary: Examples for Hypre +Group: Documentation/Other +BuildArch: noarch + +%description examples +This package contains examples for Hypre. + +%if %{with install_doc} %package doc Summary: Development documentation for Hypre Group: Documentation/Other +BuildArch: noarch +BuildRequires: texlive-bibtex +BuildRequires: texlive-latex-bin-bin +BuildRequires: texlive-xypic %description doc This package contains development documentation for Hypre. +%endif -%{?with_hpc:%{hpc_master_package -l -N %PNAME -n lib%{PNAME}%{hpc_package_name_tail}}} -%{?with_hpc:%{hpc_master_package devel}} +%if %{with build_all} +%{?with_hpc:%{hpc_master_package -L -l -N %PNAME -n lib%{PNAME}%{hpc_package_name_tail}}} +%{?with_hpc:%{hpc_master_package -L devel}} +%endif %prep %setup -q -n %{pname}-%{version} +%patch0 -p0 +%patch1 -p1 %if %{without hpc} cat > %{_sourcedir}/baselibs.conf <<EOF %{libname} @@ -225,137 +279,67 @@ %endif %build - -cd src -%define FLAGS %optflags -fPIC %{?with_hpc:-Dhypre_dgesvd=dgesvd_ -Dhypre_dlamch=dlamch_ -Dhypre_blas_lsame=hypre_lapack_lsame -Dhypre_blas_xerbla=hypre_lapack_xerbla } - -export CFLAGS="%{FLAGS}" -export CXXFLAGS="%{FLAGS}" -export LDFLAGS="-pie" - -%if %{without hpc} - +%if %{with build_all} + %if %{without hpc} %{?with_mpi: . %{my_bindir}/mpivars.sh} - -%configure \ - --prefix=%{my_prefix} \ - --with-timing \ - --without-openmp \ -%if %{with mpi} - --with-MPI \ - --with-MPI-include=%{my_incdir} \ - --with-MPI-lib-dirs=%{my_libdir} \ -%else - --without-MPI \ -%endif - --with-blas-lib=-lblas \ - --with-lapack \ - --with-lapack-lib="-llapack" \ - --with-mli \ - --with-fei \ - --with-superlu \ - %{?with_mpi: MPI_PREFIX=%%{mpiprefix} } - -%else + %else %hpc_setup module load openblas module load superlu -%if %{with mpi} -# set this here for now as 'module purge' sets CC -export CC=mpicc -export CXX=mpicxx -export F77=mpif77 -%endif - -%hpc_configure \ - --with-timing \ - --with-MPI \ - --with-MPI-include=%{my_incdir} \ - --with-MPI-lib-dirs=%{my_libdir} \ - --without-openmp \ - --with-blas-lib="-L$OPENBLAS_LIB -lopenblas" \ - --with-lapack-lib="-L$OPENBLAS_LIB -lopenblas" \ - --with-mli \ - --with-fei \ - --with-superlu \ - --with-superlu-include=$SUPERLU_INC \ - --with-superlu-lib=$SUPERLU_LIB + %endif -%endif +export LDFLAGS="-lm" + +cd src/ + %if %{without hpc} +%cmake \ + %else +%hpc_cmake \ + %endif + -DHYPRE_SHARED=ON \ + %if %{without mpi} + -DHYPRE_SEQUENTIAL=ON \ + %else + -DHYPRE_SEQUENTIAL=OFF \ + %endif + -DHYPRE_USING_HYPRE_BLAS=OFF \ + -DHYPRE_USING_HYPRE_LAPACK=OFF \ + -DCMAKE_SHARED_LINKER_FLAGS="-lm" \ -mkdir -p hypre/lib -pushd FEI_mv/femli -make %{?_smp_mflags} all -popd -make %{?_smp_mflags} all -cd .. +%make_jobs +%endif # build_all %install -%if %{without hpc} -%{?with_mpi: . %{my_bindir}/mpivars.sh} -%else -%{hpc_setup} -%if %{with mpi} -export CXX=mpicxx -%endif -%endif - +%if %{with install_doc} +install -m 644 -D docs/*pdf -t %{buildroot}%{_docdir}/%{package_name}/ +%fdupes -s src/examples +%endif +%if %{with build_all} +pushd . +cd src/ +%cmake_install + +# move libaries arround for mpi builds + %if %{without hpc} + %if %{with mpi} +mkdir -pv %{buildroot}%{my_libdir} +mv -v %{buildroot}/usr/%{_lib}/*.so* %{buildroot}%{my_libdir} +mv -v %{buildroot}/usr/include %{buildroot}%{my_incdir} + %endif + %endif -# %%makeinstall macro does not work with hypre -cd src -make install HYPRE_INSTALL_DIR=%{buildroot}%{my_prefix} \ - HYPRE_LIB_INSTALL=%{buildroot}%{my_libdir} \ - HYPRE_INC_INSTALL=%{buildroot}%{my_incdir}%{!?with_hpc:/%{pname}} -install -m644 hypre/lib/* %{buildroot}%{my_libdir} - -# install LLNL FEI headers -mkdir -p %{buildroot}%{my_incdir}/%{!?with_hpc:%{pname}/}FEI_mv -cp -r FEI_mv/fei-base %{buildroot}%{my_incdir}/%{!?with_hpc:%{pname}/}FEI_mv/. -cd .. - -# Fix wrong permissions -chmod 644 %{buildroot}%{my_incdir}/%{!?with_hpc:%{pname}/}*.h - -# This files are provided with babel - TODO -rm -f %{buildroot}%%{my_libdir}/libsidl* - -# shared libraries - -pushd %{buildroot}%{my_libdir} -LIBS="$(ls *.a|sed 's|\.a||'|sort)" -mkdir tmp; pushd tmp -for i in $LIBS; do - if [ "$i" != "libbHYPREClient-F" -a "$i" != "libbHYPREClient-CX" ] - then - ar x ../$i.a - ${CXX:-c++} -shared * -L.. $ADDLIB \ - -Wl,-soname,$i.so.%{somver} -o ../$i.so.%{sover} - ln -s $i.so.%sover ../$i.so.%{somver} - ln -s $i.so.%{somver} ../$i.so - rm -f * - ADDLIB="-lHYPRE" - fi -done -popd -rm -rf tmp -rm libHYPRE.a -popd - -%if 0%{?install_doc} -install -d %{buildroot}%{_docdir}/%{package_name} -cp -fR docs/* %{buildroot}%{_docdir}/%{package_name}/ -%endif + %if %{with hpc} +%{hpc_write_pkgconfig -n %{pname} -l %{PNAME}} -%if %{with hpc} %hpc_write_modules_files -#%Module1.0##################################################################### +#%%Module1.0##################################################################### proc ModulesHelp { } { puts stderr " " puts stderr "This module loads the hypre library built with the %{compiler_family} compiler" -puts stderr "toolchain and the %{mpi_family} MPI stack." +puts stderr "toolchain and the %{mpi_family}%{?mpi_vers} MPI stack." puts stderr " " puts stderr "Note that this build of hypre leverages the superlu and MKL libraries." puts stderr "Consequently, these packages are loaded automatically with this module." @@ -363,44 +347,76 @@ puts stderr "\nVersion %{version}\n" } -module-whatis "Name: %{pname} built with %{compiler_family} compiler and %{mpi_family} MPI" +module-whatis "Name: %{pname} built with %{compiler_family} compiler and %{mpi_family}%{?mpi_vers} MPI" +module-whatis "Description: %{SUMMARY}" module-whatis "Version: %{version}" module-whatis "Category: runtime library" module-whatis "%{url}" set version %{version} +depends-on openblas +depends-on superlu + prepend-path PATH %{hpc_bindir} +if {[file isdirectory %{hpc_includedir}]} { prepend-path INCLUDE %{hpc_includedir} + +%hpc_modulefile_add_pkgconfig_path +} prepend-path LD_LIBRARY_PATH %{hpc_libdir} setenv %{PNAME}_DIR %{hpc_prefix} setenv %{PNAME}_BIN %{hpc_bindir} +if {[file isdirectory %{hpc_includedir}]} { setenv %{PNAME}_INC %{hpc_includedir} +prepend-path CPATH %{hpc_includedir} +prepend-path C_INCLUDE_PATH %{hpc_includedir} +prepend-path CPLUS_INCLUDE_PATH %{hpc_includedir} + +} setenv %{PNAME}_LIB %{hpc_libdir} EOF -%endif + %endif %fdupes -s %{buildroot}%{my_prefix} +%endif # build_all +%if %{without hpc} && %{without mpi} %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig +%else +%post -n %{libname} +/sbin/ldconfig -N %{my_libdir} + +%postun -n %{libname} +/sbin/ldconfig -N %{my_libdir} +%{?with_hpc:%hpc_module_delete_if_default} +%endif +%if %{with build_all} %files -n %{libname} %{?hpc_dirs} %{?hpc_modules_files} %{my_libdir}/*.so.* %files devel +%if %{with hpc} %{?hpc_dirs} +%{hpc_pkgconfig_file} +%endif %license COPYING.LESSER COPYRIGHT %doc CHANGELOG README %{my_incdir}%{?!with_hpc:/%{pname}} %{my_libdir}/*.so +%endif # build_all -%if 0%{?install_doc} +%if %{with install_doc} %files doc %{_docdir}/%{package_name} + +%files examples +%doc src/examples %endif %changelog ++++++ hypre_CMakeLists.patch ++++++ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f766f7..1b339e7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,8 @@ project (hypre) # The version number. set (HYPRE_VERSION 2.15.1) +set (HYPRE_MAJOR 0) +set (HYPRE_MINOR 0.2.6) set (HYPRE_DATE 2018/10/19) set (HYPRE_TIME 00:00:00) set (HYPRE_BUGS [email protected]) @@ -775,19 +777,6 @@ else () set (BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE) endif () -# Set MPI compile flags -if (NOT HYPRE_SEQUENTIAL) - find_package (MPI) - if ((MPI_C_FOUND) AND (NOT CMAKE_C_COMPILER STREQUAL MPI_C_COMPILER)) - include_directories (${MPI_C_INCLUDE_PATH}) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS}") - endif () - if ((MPI_CXX_FOUND) AND (NOT CMAKE_CXX_COMPILER STREQUAL MPI_CXX_COMPILER)) - include_directories (${MPI_CXX_INCLUDE_PATH}) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}") - endif () -endif (NOT HYPRE_SEQUENTIAL) - # Set OpenMP compile flags if (HYPRE_USING_OPENMP) find_package (OpenMP) @@ -832,9 +821,25 @@ if (HYPRE_USING_FEI) endif () add_library (HYPRE ${HYPRE_SOURCES} ${FEI_LIBS}) +set_target_properties(HYPRE PROPERTIES VERSION ${HYPRE_MINOR} SOVERSION ${HYPRE_MAJOR}) + +# Set MPI compile flags +if (NOT HYPRE_SEQUENTIAL) + find_package (MPI) + include_directories(${MPI_INCLUDE_PATH}) + if (MPI_COMPILE_FLAGS) + set_target_properties(HYPRE PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") + endif() + if (MPI_LINK_FLAGS) + set_target_properties(HYPRE PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") + endif() + target_link_libraries(HYPRE ${MPI_C_LIBRARIES}) +endif (NOT HYPRE_SEQUENTIAL) + + -install (TARGETS HYPRE DESTINATION lib) -install (FILES ${HYPRE_HEADERS} DESTINATION include) +install (TARGETS HYPRE DESTINATION lib${LIB_SUFFIX}) +install (FILES ${HYPRE_HEADERS} DESTINATION include/hypre) # add_subdirectory (test EXCLUDE_FROM_ALL) ++++++ hypre_Makefile_examples.patch ++++++ --- src/examples/Makefile.orig 2019-02-13 14:10:08.298666931 +0100 +++ src/examples/Makefile 2019-02-13 14:10:26.674630317 +0100 @@ -27,7 +28,7 @@ LINKOPTS = $(COPTS) -LIBS = -L$(HYPRE_DIR)/lib -lHYPRE -lm +LIBS = -L$(HYPRE_LIB) -L$(SUPERLU_LIB) -lHYPRE -lm -lblas -llapack -lsuperlu LFLAGS = $(LINKOPTS) $(LIBS) -lstdc++ LFLAGS_B =\ -L${HYPRE_DIR}/lib\
