Accepting request 673166 from home:eeich:branches:science

- Simpify naming scheme.
- Fix more dependencies.
- Rename package: test -> examples.
- Create HPC master package for doc and examples.
- Fix shared library builds.
- Build example binaries against shared libs for all builds.
- Add Makefiles-Serialize-libseq-libplat-mommond_mod-for-parallel-builds.patch:
  make sure builds are serialized for 'make -j <n>'

OBS-URL: https://build.opensuse.org/request/show/673166
OBS-URL: https://build.opensuse.org/package/show/science/mumps?expand=0&rev=12
This commit is contained in:
Egbert Eich 2019-02-10 18:24:35 +00:00 committed by Git OBS Bridge
parent 1d9b40859e
commit aeef0aa46c
3 changed files with 185 additions and 70 deletions

View File

@ -0,0 +1,92 @@
From: Egbert Eich <eich@suse.com>
Date: Sun Feb 10 17:16:51 2019 +0100
Subject: Makefiles: Serialize libseq, libplat, mommond_mod for parallel builds
Patch-mainline: Not yet
Git-commit: d8e18ae193f2fd67761c8226a3ad9bcf80d4230c
References:
Signed-off-by: Egbert Eich <eich@suse.com>
---
Makefile | 17 ++++++++++-------
src/Makefile | 10 ++++++----
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 4636e85..489753b 100644
--- a/Makefile
+++ b/Makefile
@@ -9,18 +9,18 @@ default: dexamples
.PHONY: default alllib all c z s d \
sexamples dexamples cexamples zexamples multi_example \
- mumps_lib requiredobj libseqneeded clean
+ mumps_lib common requiredobj libseqneeded clean
alllib: c z s d
all: cexamples zexamples sexamples dexamples multi_example
-c:
+c: requiredobj
$(MAKE) ARITH=c mumps_lib
-z:
+z: requiredobj
$(MAKE) ARITH=z mumps_lib
-s:
+s: requiredobj
$(MAKE) ARITH=s mumps_lib
-d:
+d: requiredobj
$(MAKE) ARITH=d mumps_lib
@@ -36,7 +36,10 @@ Makefile.inc:
include Makefile.inc
-mumps_lib: requiredobj
+common:
+ (cd src ; $(MAKE) common)
+
+mumps_lib:
(cd src ; $(MAKE) $(ARITH))
cexamples: c
@@ -54,7 +57,7 @@ dexamples: d
multi_example: s d c z
(cd examples ; $(MAKE) multi)
-requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT)
+requiredobj: Makefile.inc $(LIBSEQNEEDED) $(libdir)/libpord$(PLAT)$(LIBEXT) common
# dummy MPI library (sequential version)
diff --git a/src/Makefile b/src/Makefile
index 88fc032..5a3c6e2 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -12,13 +12,13 @@ default: d
.PHONY: default s d c z mumps_lib clean
-s:
+s: common
$(MAKE) ARITH=s mumps_lib
-d:
+d: common
$(MAKE) ARITH=d mumps_lib
-c:
+c: common
$(MAKE) ARITH=c mumps_lib
-z:
+z: common
$(MAKE) ARITH=z mumps_lib
include $(topdir)/Makefile.inc
@@ -74,6 +74,8 @@ OBJS_COMMON_OTHER = \
mumps_thread.o \
mumps_save_restore_C.o
+common: $(OBJS_COMMON_MOD)
+
OBJS_MOD = \
$(ARITH)ana_aux_par.o \
$(ARITH)ana_lr.o\

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sat Feb 9 13:40:09 UTC 2019 - eich@suse.com
- Simpify naming scheme.
- Fix more dependencies.
- Rename package: test -> examples.
- Create HPC master package for doc and examples.
- Fix shared library builds.
- Build example binaries against shared libs for all builds.
- Add Makefiles-Serialize-libseq-libplat-mommond_mod-for-parallel-builds.patch:
make sure builds are serialized for 'make -j <n>'
-------------------------------------------------------------------
Fri Feb 8 12:03:01 UTC 2019 - eich@suse.com

View File

@ -183,21 +183,21 @@ ExclusiveArch: do_not_build
%define my_incdir %{my_prefix}/include/
%define my_datadir %{my_prefix}/share/
%endif
%define package_name mumps%{?scotch:-%{scotch}}%{?my_suffix}
%define libname(l:s:) %{pname}%{-l*}%{-s*}%{?my_suffix}
%define package_name %{pname}%{?scotch:-%{scotch}}%{?my_suffix}
%define libname lib%{pname}%{?scotch:-%{scotch}}%{?so_ver}%{?my_suffix}
%else
%{!?compiler_family:%global compiler_family gnu}
%{?mpi_family:%{bcond_without mpi}}%{!?mpi_family:%{bcond_with mpi}}
%{?with_mpi:%{!?mpi_family:%global mpi_family openmpi}}
%{?hpc_init:%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 -c %compiler_family %{?c_f_ver:-v %{c_f_ver}} %{?with_mpi:-m {%mpi_family}} %{?mpi_ver:-V %{mpi_ver}} %{?scotch:-e %{scotch}}}
%define my_suffix -%{mpi_family}%{?mpi_ver}
%define my_prefix %{hpc_prefix}
%define my_bindir %{hpc_bindir}
%define my_libdir %{hpc_libdir}
%define my_incdir %{hpc_includedir}
%define my_datadir %{hpc_datadir}
%define package_name %{hpc_package_name %{_ver}}
%define libname(l:s:) %{pname}%{-l*}-%{_ver}%{hpc_package_name_tail %{?_vers}}
%define package_name %{hpc_package_name %{?_ver}}
%define libname lib%{package_name}
%endif
Summary: A MUltifrontal Massively Parallel Sparse direct Solver
@ -209,6 +209,7 @@ Release: 0
Url: http://mumps.enseeiht.fr/
Source0: http://mumps.enseeiht.fr/MUMPS_%{version}.tar.gz#/%{pname}-%{version}.tar.bz2
Source1: Makefile.inc
Patch1: Makefiles-Serialize-libseq-libplat-mommond_mod-for-parallel-builds.patch
%if %{without hpc}
BuildRequires: gcc-fortran
BuildRequires: scotch-devel
@ -243,7 +244,7 @@ operate on distributed matrices e.g. over a cluster. It has Fortran and
C interfaces, and can interface with ordering tools such as Scotch.
%package -n lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}}
%package -n %{libname}
Summary: A MUltifrontal Massively Parallel Sparse direct Solver
Group: System/Libraries
%if %{without hpc}
@ -253,7 +254,7 @@ Requires: libscalapack2-%{compiler_family}-%{mpi_family}%{?mpi_ver}-hpc
%hpc_requires
%endif
%description -n lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}}
%description -n %{libname}
MUMPS implements a direct solver for large sparse linear systems, with a
particular focus on symmetric positive definite matrices. It can
operate on distributed matrices e.g. over a cluster. It has Fortran and
@ -298,10 +299,10 @@ This package contains the sequential library%{?scotch: with Scotch support enabl
This package contains the parallel library%{?with_mpi: with %{mpi_family}}%{?scotch: with Scotch support enabled}.
%endif
%package -n %{libname %{?scotch:-l -%{scotch}}}-devel
%package devel
Summary: Files needed for developing mumps based applications
Group: Development/Libraries/Other
Requires: lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}} = %version
Requires: %{libname} = %version
%if %{without hpc}
%if %{with mpi} || %{with scotch}
Requires: mumps-devel = %{version}
@ -324,7 +325,7 @@ Requires: libscalapack2-%{compiler_family}-%{mpi_family}%{?mpi_ver}-hpc-devel
Requires: libblacs2-%{compiler_family}-%{mpi_family}%{?mpi_ver}-hpc-devel
%endif
%description -n %{libname %{?scotch:-l -%{scotch}}}-devel
%description devel
MUMPS implements a direct solver for large sparse linear systems, with a
particular focus on symmetric positive definite matrices. It can
operate on distributed matrices e.g. over a cluster. It has Fortran and
@ -332,13 +333,13 @@ C interfaces, and can interface with ordering tools such as Scotch.
Headers and development files for %{package_name}.
%package -n %{libname %{?scotch:-l -%{scotch}}}-devel-static
%package devel-static
Summary: Files needed for developing mumps based applications
Group: Development/Libraries/Other
Requires: %{libname %{?scotch:-l -%{scotch}}}-devel
Requires: %{package_name}-devel
%{?with_mpi:Recommends: %{name}-%{so_ver}-compat-static = %{version}}
%description -n %{libname %{?scotch:-l -%{scotch}}}-devel-static
%description devel-static
MUMPS implements a direct solver for large sparse linear systems, with a
particular focus on symmetric positive definite matrices. It can
operate on distributed matrices e.g. over a cluster. It has Fortran and
@ -360,12 +361,12 @@ C interfaces, and can interface with ordering tools such as Scotch.
This package provides links to the static serial libraries from the MPI
library directory MUMPS built for %{mpi_family}%{?mpi_ver}.
%if %{without scotch}
%package test
%package examples
Summary: Simple test programs and examples for mumps
Group: System/Libraries
Requires: %{libname} = version
%description test
%description examples
MUMPS implements a direct solver for large sparse linear systems, with a
particular focus on symmetric positive definite matrices. It can
operate on distributed matrices e.g. over a cluster. It has Fortran and
@ -373,15 +374,17 @@ C interfaces, and can interface with ordering tools such as Scotch.
This packages contains some test and examples programs for mumps. In addition,
matlab and scilab extensions are provided in /usr/share/doc/packages/mumps.
%endif #scotch
%if %{with hpc}
%{hpc_master_package -l -L}
%{hpc_master_package -L devel}
%{hpc_master_package -L test}
%{hpc_master_package doc}
%endif
%prep
%setup -q -n %{PNAME}_%{version}
%patch1 -p1
%build
export SUSE_ASNEEDED=0
@ -425,8 +428,8 @@ module load openblas scalapack
%define F_L mpif77
%define SCALAP -lscalapack -lblacs
%define MUMPS_MPI %{mpi_family}
%define MUMPS_LIBF77 -L%{my_libdir} %{?mumps_f77_mpilibs}
%define INCPAR -I%{my_incdir}/
%define MUMPS_LIBF77 %{!?with_hpc:-L%{my_libdir}} %{?mumps_f77_mpilibs}
%define INCPAR %{!?with_hpc:-I%{my_incdir}}
%define LIBPAR %{SCALAP} %{MUMPS_LIBF77}
%define INCS \\\$(INCPAR)
%define LIBS \\\$(LIBPAR)
@ -441,47 +444,61 @@ module load openblas scalapack
%endif # mpi
cp -f %{S:1} Makefile.inc
make \
%{?C_C:CC="%C_C"} \
%{?F_C:FC="%F_C"} \
%{?F_L:FL="%F_L"} \
%{?SCALAP:SCALAP="%SCALAP"} \
%{?MUMPS_MPI:MUMPS_MPI="%MUMPS_MPI"} \
%{?INCPAR:INCPAR="%INCPAR"} \
%{?LIBPAR:LIBPAR="%LIBPAR"} \
%{?LIBBLAS:LIBBLAS="%LIBBLAS"} \
%{?INCS:INCS="%INCS"} \
%{?LIBS:LIBS="%LIBS"} \
%{?LIBSEQNEEDED:LIBSEQNEEDED="%LIBSEQNEEDED"} \
%{?LSCOTCH:LSCOTCH="%LSCOTCH"} \
%{?ISCOTCH:ISCOTCH="%ISCOTCH"} \
%{?ORDERINGSF:ORDERINGSF="%ORDERINGSF"} \
%{?PLAT:PLAT="%PLAT"} \
OPTC="$RPM_OPT_FLAGS -fPIC" \
all
echo \
"%{?C_C:CC=%C_C}
%{?F_C:FC=%F_C}
%{?F_L:FL=%F_L}
%{?SCALAP:SCALAP=%SCALAP}
%{?MUMPS_MPI:MUMPS_MPI=%MUMPS_MPI}
%{?INCPAR:INCPAR=%INCPAR}
%{?LIBPAR:LIBPAR=%LIBPAR}
%{?LIBBLAS:LIBBLAS=%LIBBLAS}
%{?INCS:INCS=%INCS}
%{?LIBS:LIBS=%LIBS}
%{?LIBSEQNEEDED:LIBSEQNEEDED=%LIBSEQNEEDED}
%{?LSCOTCH:LSCOTCH=%LSCOTCH}
%{?ISCOTCH:ISCOTCH=%ISCOTCH}
%{?ORDERINGSF:ORDERINGSF=%ORDERINGSF}
%{?PLAT:PLAT=%PLAT}
OPTC=$RPM_OPT_FLAGS -fPIC
OPTF=\$(OPTC)" >> Makefile.inc
make %{?_smp_mflags} alllib
%{!?with_mpi:cp -P libseq/libmpiseq*.a lib/}
cd lib
mkdir lib/tmp; cd lib/tmp;
%define LORDERINGS -lpord%{?PLAT} %{?scotch:-l%{scotch}}
%if %{without mpi}
%F_C -shared libmpiseq%{?PLAT}.a -Wl,-soname,libmpiseq%{?PLAT}.so.%{version} -o libmpiseq%{?PLAT}.so.%{version}
ln -s libmpiseq%{?PLAT}.so.%{version} libmpiseq%{?PLAT}.so
rm -f *.o; ar -x ../libmpiseq%{?PLAT}.a
%F_C -shared *.o -Wl,-soname,libmpiseq%{?PLAT}.so.%{version} -o ../libmpiseq%{?PLAT}.so.%{version}
ln -s libmpiseq%{?PLAT}.so.%{version} ../libmpiseq%{?PLAT}.so
%endif
%C_C -shared libpord%{?PLAT}.a -Wl,-soname,libpord%{?PLAT}.so.%{version} -o libpord%{?PLAT}.so.%{version}
ln -s libpord%{?PLAT}.so.%{version} libpord%{?PLAT}.so
%F_C -shared libmumps_common%{?PLAT}.a -Wl,-soname,libmumps_common$%{?PLAT}.so.%{version} -L. %{LORDERINGS} \
-lpthread %{MUMPS_LIBF77} -o libmumps_common%{?PLAT}.so.%{version}
ln -s libmumps_common%{?PLAT}.so.%{version} libmumps_common%{?PLAT}.so
rm -f *.o; ar -x ../libpord%{?PLAT}.a
%C_C -shared *.o -Wl,-soname,libpord%{?PLAT}.so.%{version} -o ../libpord%{?PLAT}.so.%{version}
ln -s libpord%{?PLAT}.so.%{version} ../libpord%{?PLAT}.so
rm -f *.o; ar -x ../libmumps_common%{?PLAT}.a
%F_C -shared *.o -Wl,-soname,libmumps_common$%{?PLAT}.so.%{version} -L.. %{LORDERINGS} \
-lpthread %{MUMPS_LIBF77} -o ../libmumps_common%{?PLAT}.so.%{version}
ln -s libmumps_common%{?PLAT}.so.%{version} ../libmumps_common%{?PLAT}.so
for ARITH in c d s z ; do
%F_C -shared lib${ARITH}mumps%{?PLAT}.a -Wl,-soname,lib${ARITH}mumps%{?PLAT}.so.%{version} -L. -lmumps_common%{?PLAT} \
%{LORDERINGS} %{MUMPS_LIBF77} %{LIBBLAS} %{?SCALAP} -o lib${ARITH}mumps%{?PLAT}.so.%{version}
ln -s lib${ARITH}mumps%{?PLAT}.so.%{version} lib${ARITH}mumps%{?PLAT}.so
rm -f *.o; ar -x ../lib${ARITH}mumps%{?PLAT}.a
%F_C -shared *.o -Wl,-soname,lib${ARITH}mumps%{?PLAT}.so.%{version} -L.. -lmumps_common%{?PLAT} \
%{LORDERINGS} %{MUMPS_LIBF77} %{LIBBLAS} %{?SCALAP} -o ../lib${ARITH}mumps%{?PLAT}.so.%{version}
ln -s lib${ARITH}mumps%{?PLAT}.so.%{version} ../lib${ARITH}mumps%{?PLAT}.so
done
cd -
rm -rf lib/tmp/
# build test programs
%{!?with_scotch:make -C examples %{?PLAT:PLAT="%PLAT"} all}
make -C examples clean
echo \
"LPORD=-L\$(LPORDDIR) -lpord\$(PLAT)
LIBEXT=.so" >> Makefile.inc
make -C examples \
OPTL="-pie -L../lib" all
# Make sure the user can build these later on
echo "OPTL=-pie -L%{my_libdir}" >> Makefile.inc
%install
mkdir -p %{buildroot}%{my_bindir}
@ -497,10 +514,10 @@ install -m 644 include/* %{buildroot}%{_includedir}/mumps
install -m 644 libseq/*.h %{buildroot}%{_includedir}/mumps
install -m 644 PORD/include/* %{buildroot}%{_includedir}/pord
%endif
%if %{with mpi}
install -m 755 examples/*simpletest %{buildroot}%{my_bindir}
install -m 755 examples/c_example %{buildroot}%{my_bindir}
%if %{with mpi}
%if %{without hpc}
# we make a symlink to the serial lib in the parallel lib prefix
# because some scientific packages don't manage different directories
@ -556,22 +573,18 @@ EOF
# Don't want binaries in docdir
rm -rf examples/*.o examples/*simpletest examples/c_example examples/multiple_arithmetics_example
%if %{without mpi} || %{with scotch}
rm -rf %{buildroot}/%{my_bindir}
%endif
%if !%{with mpi}
%post -n lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}} -p /sbin/ldconfig
%postun -n lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}} -p /sbin/ldconfig
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%else
%post -n lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}}
%post -n %{libname}
/sbin/ldconfig -N %{my_libdir}
%postun -n lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}}
%postun -n %{libname}
/sbin/ldconfig -N %{my_libdir}
%{?with_hpc:%{hpc_module_delete_if_default}}
%endif
%files -n lib%{libname -s %{so_ver} %{?scotch:-l -%{scotch}}}
%files -n %{libname}
%if %{with hpc}
%{hpc_dirs}
%{hpc_modules_files}
@ -597,19 +610,14 @@ rm -rf %{buildroot}/%{my_bindir}
%endif # scotch
%endif # mpi && !hpc
%if %{with hpc} || ( %{without mpi} && %{without scotch} )
%files doc
%doc doc SCILAB MATLAB
%endif
%files -n %{libname %{?scotch:-l -%{scotch}}}-devel
%files devel
%if %{without scotch} && %{without mpi}
%{my_incdir}/mumps
%{my_incdir}/pord
%endif
%{my_libdir}/*.so
%files -n %{libname %{?scotch:-l -%{scotch}}}-devel-static
%files devel-static
%{?with_mpi:%exclude %{my_libdir}/*%{!?scotch:_seq}%{?scotch:_scotch}.a}
%{my_libdir}/*.a
@ -618,10 +626,13 @@ rm -rf %{buildroot}/%{my_bindir}
%{my_libdir}/*%{!?scotch:_seq}%{?scotch:_scotch}.a
%endif
%if %{with mpi} && %{without scotch}
%files test
%doc examples
%{my_bindir}%{!?with_hpc:/*}
%if %{with hpc} || ( %{without mpi} && %{without scotch} )
%files doc
%doc doc SCILAB MATLAB
%endif
%files examples
%doc Makefile.inc examples
%{my_bindir}%{!?with_hpc:/*}
%changelog