Hello community, here is the log from the commit of package mpich for openSUSE:Factory checked in at 2017-11-03 16:26:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mpich (Old) and /work/SRC/openSUSE:Factory/.mpich.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "mpich" Fri Nov 3 16:26:43 2017 rev:4 rq:538288 version:3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/mpich/mpich.changes 2017-09-12 19:57:56.537586141 +0200 +++ /work/SRC/openSUSE:Factory/.mpich.new/mpich.changes 2017-11-03 16:27:53.461570209 +0100 @@ -1,0 +2,5 @@ +Thu Oct 26 09:21:56 UTC 2017 - nmoreychaisemartin@suse.com + +- Add HPC specific build targets using environment modules (Fate#323977). + +------------------------------------------------------------------- New: ---- macros.hpc-mpich ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mpich.spec ++++++ --- /var/tmp/diff_new_pack.fxaP0r/_old 2017-11-03 16:27:54.309539346 +0100 +++ /var/tmp/diff_new_pack.fxaP0r/_new 2017-11-03 16:27:54.313539201 +0100 @@ -18,38 +18,117 @@ %global flavor @BUILD_FLAVOR@%nil -%if "%{flavor}" != "" -%define pack_suff -%{flavor} -%else -%define pack_suff %{nil} +# Static libraries are disabled by default +# for non HPC builds +# To enable them, simply uncomment: +# % define build_static_devel 1 + +%define pname mpich +%define vers 3.2 +%define _vers 3_2 + +%if "%{flavor}" == "" +ExclusiveArch: do_not_build +%{bcond_with hpc} +%endif + +%if "%{flavor}" == "standard" +%define build_flavor verbs +%{bcond_with hpc} +%endif +%if "%{flavor}" == "testsuite" +%define build_flavor verbs +%define testsuite 1 +%{bcond_with hpc} %endif -%if "%flavor" == "testsuite" +%if "%{flavor}" == "ofi" +%define build_flavor ofi +%{bcond_with hpc} +%endif +%if "%{flavor}" == "ofi-testsuite" +%define build_flavor ofi +%define testsuite 1 +%{bcond_with hpc} +%endif + +%if "%flavor" == "gnu-hpc" +%define compiler_family gnu +%undefine c_f_ver +%define build_flavor verbs +%define build_static_devel 1 +%{bcond_without hpc} +%endif +%if "%flavor" == "gnu-hpc-testsuite" +%define compiler_family gnu +%undefine c_f_ver %define testsuite 1 +%define build_flavor verbs +%{bcond_without hpc} %endif -%define module_name mpich%{pack_suff} -%define _prefix /usr/%_lib/mpi/gcc/%{module_name} -%define _libexecdir %{_prefix}/%{_lib} +%if "%flavor" == "gnu-hpc-ofi" +%define compiler_family gnu +%undefine c_f_ver +%define build_flavor ofi +%define build_static_devel 1 +%{bcond_without hpc} +%endif +%if "%flavor" == "gnu-hpc-ofi-testsuite" +%define compiler_family gnu +%undefine c_f_ver +%define testsuite 1 +%define build_flavor ofi +%{bcond_without hpc} +%endif + +%if "%{build_flavor}" != "verbs" +%define pack_suff %{?build_flavor:-%{build_flavor}} +%endif + +%if %{without hpc} +%define module_name mpich%{?pack_suff} +%define p_prefix /usr/%_lib/mpi/gcc/%{module_name} +%define p_bindir %{p_prefix}/bin +%define p_datadir %{p_prefix}/share +%define p_includedir %{p_prefix}/include +%define p_mandir %{p_datadir}/man +%define p_libdir %{p_prefix}/%{_lib} +%define p_libexecdir %{p_prefix}/%{_lib} %define _moduledir /usr/share/modules/gnu-%{module_name} +%define package_name %{pname}%{?pack_suff} +%else +%{hpc_init -M -c %compiler_family %{?c_f_ver:-v %{c_f_ver}} -m mpich %{?pack_suff:-e %{build_flavor}} %{?mpi_f_ver:-V %{mpi_f_ver}}} +%define p_prefix %{hpc_prefix} +%define p_bindir %{hpc_bindir} +%define p_datadir %{hpc_datadir} +%define p_includedir %{hpc_includedir} +%define p_mandir %{hpc_mandir} +%define p_libdir %{hpc_libdir} +%define p_libexecdir %{hpc_libexecdir} +%define package_name %{pname}%{?pack_suff}_%{_vers}-%{compiler_family}%{?c_f_ver}-hpc + +%global hpc_mpich_dep_version %(VER=%{?m_f_ver}; echo -n ${VER}) +%global hpc_mpich_dir mvapich +%global hpc_mpich_pack_version %{hpc_mpich_dep_version} +%endif -Name: mpich%{pack_suff} -Version: 3.2 +Name: %{package_name}%{?testsuite:-testsuite} +Version: %{vers} Release: 0 Summary: High-performance and widely portable implementation of MPI License: MIT Group: Development/Libraries/Parallel Url: http://www.mpich.org/ -Source0: http://www.mpich.org/static/downloads/%{version}/mpich-%{version}.tar.gz +Source0: http://www.mpich.org/static/downloads/%{version}/mpich-%{vers}.tar.gz Source1: mpivars.sh Source2: mpivars.csh +Source3: macros.hpc-mpich Source100: _multibuild BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: Modules BuildRequires: fdupes -BuildRequires: gcc-c++ -BuildRequires: gcc-fortran BuildRequires: hwloc-devel >= 1.6 BuildRequires: libtool BuildRequires: pkg-config @@ -72,11 +151,25 @@ %if "%{flavor}" == "ofi" BuildRequires: libfabric-devel %endif + Provides: mpi -Requires: environment-modules +%if %{without hpc} +BuildRequires: Modules +BuildRequires: gcc-c++ +BuildRequires: gcc-fortran BuildRequires: mpi-selector Requires: mpi-selector Requires(preun): mpi-selector +%else +BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel +BuildRequires: lua-lmod +BuildRequires: suse-hpc +Requires: lua-lmod +%endif + +%if 0%{?testsuite} +BuildRequires: %package_name = %{version} +%endif %description MPICH is a high performance and widely portable implementation of the Message @@ -95,33 +188,87 @@ %if 0%{!?testsuite:1} %package devel -Summary: A Portable Implementation of MPI +Summary: SDK for MPICH %{?with_hpc:HPC} version %{version} Group: Development/Libraries/Parallel Requires: %{name} = %{version} -Requires: gcc-fortran -Requires: pkg-config +%if %{without hpc} +Requires: libstdc++-devel +%else +%hpc_requires_devel +%endif +Requires: %{name} = %{version} %description devel MPICH is a freely available, portable implementation of MPI, the Standard for message-passing libraries. This package contains manpages, headers and libraries needed for developing MPI applications. +This RPM contains all the wrappers necessary to compile, link, and run +Open MPI jobs. + +%if %{with hpc} +%package macros-devel +Summary: HPC Macros for MPICH version %{version} +Group: Development/Libraries/Parallel +Requires: %{name}-devel = %{version} +Provides: %{pname}-hpc-macros-devel = %{version} +Conflicts: otherproviders(%{pname}-hpc-macros-devel) + +%description macros-devel +HPC Macros for building RPM packages for MPICH version %{version}. +%endif + +%if 0%{?build_static_devel} %package devel-static -Summary: OSU MVAPICH2 MPI package - static libraries +Summary: Static libraries for MPICH %{?with_hpc:HPC} version %{version} Group: Development/Libraries/Parallel Requires: %{name}-devel = %{version} %description devel-static -This is an MPI-3 implementation which includes all MPI-1 and MPI-2 features. It -is based on MPICH2 and MVICH. This package contains the static libraries +MPICH is a freely available, portable implementation of MPI, the +Standard for message-passing libraries. This package contains manpages, +headers and libraries needed for developing MPI applications. + +This RPM contains the static library files, which are packaged separately from +the dynamic library and headers. +%endif + +%if %{with hpc} +%{hpc_master_package -L -a} +%{hpc_master_package -a devel} +%{hpc_master_package macros-devel} +%{hpc_master_package -a devel-static} +%endif # ?with_hpc %endif # ! testsuite %prep +echo FLAVOR %{flavor} +%if %{with hpc} +echo with HPC +%endif +%if %{without hpc} +echo without HPC +%endif %setup -q -n mpich-%{version}%{?rc_ver} %build +%{?with_hpc:%hpc_debug} +%if %{with hpc} +%{hpc_setup} +%{hpc_configure} \ +%else %configure \ + --prefix=%{p_prefix} \ + --exec-prefix=%{p_prefix} \ + --datadir=%{p_datadir} \ + --bindir=%{p_bindir} \ + --includedir=%{p_includedir} \ + --libdir=%{p_libdir} \ + --libexecdir=%{p_libexecdir} \ + --mandir=%{p_mandir} \ +%endif + --docdir=%{_datadir}/doc/%{name} \ --disable-rpath \ --disable-wrapper-rpath \ %if "%{flavor}" == "ofi" @@ -136,8 +283,34 @@ %install make DESTDIR=%{buildroot} install -sed -e 's,prefix,%_prefix,g' -e 's,libdir,%{_libdir},g' %{S:1} > %{buildroot}%{_bindir}/mpivars.sh -sed -e 's,prefix,%_prefix,g' -e 's,libdir,%{_libdir},g' %{S:2} > %{buildroot}%{_bindir}/mpivars.csh + +# sanitize .la files +list="$(find %{buildroot} -name "*.la" -printf "%%h\n" | sort | uniq)" +for dir in ${list} +do + deps="${deps} -L${dir##%{buildroot}}" +done +for dir in ${list} +do +%if !0%{?build_static_devel} + rm -f ${dir}/*.la +%else + for file in ${dir}/*.la + do + sed -i -e "s@ [^[:space:]]*home[^[:space:]\']*@${deps}@" \ + -e "s@ [^[:space:]]*home[^[:space:]\']*@@g" \ + -e "s@-L.*.libs @@g" ${file} + done +%endif +done +# sanitize .la files +%if !0%{?build_static_devel} +find %{buildroot} -name "*.a" -delete +%endif + +%fdupes %{buildroot}%{p_mandir} +%fdupes %{buildroot}%{p_datadir} +%fdupes %{buildroot}%{p_libdir}/pkgconfig %if 0%{?testsuite} # Remove everything from testsuite package @@ -148,6 +321,13 @@ make check %else + +%if %{without hpc} +# make and install mpivars files +install -m 0755 -d %{buildroot}%{_bindir} +sed -e 's,prefix,%p_prefix,g' -e 's,libdir,%{p_libdir},g' %{S:1} > %{buildroot}%{p_bindir}/mpivars.sh +sed -e 's,prefix,%p_prefix,g' -e 's,libdir,%{p_libdir},g' %{S:2} > %{buildroot}%{p_bindir}/mpivars.csh + mkdir -p %{buildroot}%{_moduledir} cat << EOF > %{buildroot}%{_moduledir}/%{version} @@ -158,12 +338,12 @@ } module-whatis "Loads the gnu mpich %{version} Environment." -conflict mpich -prepend-path PATH %{_bindir} -prepend-path INCLUDE %{_includedir} -prepend-path INCLUDE %{_libdir} -prepend-path MANPATH %{_mandir} -prepend-path LD_LIBRARY_PATH %{_libdir} +conflict gnu-mpich +prepend-path PATH %{%p_bindir} +prepend-path INCLUDE %{p_includedir} +prepend-path INCLUDE %{p_libdir} +prepend-path MANPATH %{p_mandir} +prepend-path LD_LIBRARY_PATH %{p_libdir} EOF @@ -172,57 +352,112 @@ set ModulesVersion "%{version}" EOF +%else # with hpc + +install -d -m 755 %{buildroot}%{_sysconfdir}/rpm +cp %{S:3} %{buildroot}%{_sysconfdir}/rpm + +%hpc_write_modules_files +#%%Module1.0##################################################################### + +proc ModulesHelp { } { + +puts stderr " " +puts stderr "This module loads the %{pname} library built with the %{compiler_family} toolchain." +puts stderr "\nVersion %{version}\n" + +} +module-whatis "Name: %{pname} built with %{compiler_family} toolchain" +module-whatis "Version: %{version}" +module-whatis "Category: runtime library" +module-whatis "Description: %{summary}" +module-whatis "URL: %{url}" + +set version %{version} + +prepend-path PATH %{hpc_prefix}/bin +prepend-path MANPATH %{hpc_prefix}/man +prepend-path LD_LIBRARY_PATH %{hpc_prefix}/%_lib +prepend-path MODULEPATH %{hpc_modulepath} +prepend-path MPI_DIR %{hpc_prefix} +%{hpc_modulefile_add_pkgconfig_path} + +family "MPI" +EOF +cat <<EOF > %{buildroot}/%{p_bindir}/mpivars.sh +module load %{hpc_compiler_family}/%{hpc_cf_full_version} %{hpc_mpi_family}%{?pack_suff}/%{version} +EOF +ln -s mpivars.sh %{buildroot}/%{p_bindir}/mpivars.csh + +%endif # with hpc find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' %fdupes -s %{buildroot} %post +/sbin/ldconfig +%if %{without hpc} /usr/bin/mpi-selector \ - --register %{name}-%{version} \ - --source-dir %{_bindir} \ + --register %{name}%{?pack_suff}-%{version} \ + --source-dir %{p_bindir} \ --yes -/sbin/ldconfig - -%preun -/usr/bin/mpi-selector --unregister %{name}-%{version} --yes || \ - /bin/true > /dev/null 2> /dev/null +%endif -%postun -p /sbin/ldconfig +%postun +/sbin/ldconfig +%if %{without hpc} +/usr/bin/mpi-selector --unregister %{name}%{?pack_suff}-%{version} --yes --silent +%else +%hpc_module_delete_if_default +%endif %files %defattr(-,root,root) %doc CHANGES COPYRIGHT README README.envvar RELEASE_NOTES -%doc %{_datadir}/doc +%if %{without hpc} %dir /usr/%_lib/mpi %dir /usr/%_lib/mpi/gcc -%dir %{_prefix} -%dir %{_bindir} -%dir %{_datadir} -%dir %{_includedir} %dir /usr/share/modules %dir %{_moduledir} -%dir %{_mandir} -%dir %{_mandir}/man1 -%dir %{_mandir}/man3 -%dir %{_libdir} -%{_bindir}/* %{_moduledir} -%{_mandir}/man1/* -%{_libdir}/*.so.* +%else +%hpc_mpi_dirs +%hpc_modules_files +%endif +%doc %{_datadir}/doc +%dir %{p_prefix} +%dir %{p_bindir} +%dir %{p_datadir} +%dir %{p_includedir} +%dir %{p_mandir} +%dir %{p_mandir}/man1 +%dir %{p_mandir}/man3 +%dir %{p_libdir} +%{p_bindir}/* +%{p_mandir}/man1/* +%{p_libdir}/*.so.* %files devel %defattr(-,root,root) -%dir %{_libdir}/pkgconfig -%{_mandir}/man3/* -%{_includedir} -%{_libdir}/*.so -%{_libdir}/pkgconfig/mpich.pc -%{_libdir}/pkgconfig/openpa.pc +%dir %{p_libdir}/pkgconfig +%{p_mandir}/man3/* +%{p_includedir} +%{p_libdir}/*.so +%{p_libdir}/pkgconfig/mpich.pc +%{p_libdir}/pkgconfig/openpa.pc +%if 0%{?build_static_devel} %files devel-static %defattr(-,root,root) -%{_libdir}/*.a +%{p_libdir}/*.a +%endif + +%if %{with hpc} +%files macros-devel +%defattr(-,root,root) +%config %{_sysconfdir}/rpm/macros.hpc-mpich +%endif # with hpc %endif # !testsuite ++++++ _multibuild ++++++ --- /var/tmp/diff_new_pack.fxaP0r/_old 2017-11-03 16:27:54.357537599 +0100 +++ /var/tmp/diff_new_pack.fxaP0r/_new 2017-11-03 16:27:54.357537599 +0100 @@ -1,4 +1,10 @@ <multibuild> + <package>standard</package> <package>testsuite</package> <package>ofi</package> + <package>ofi-testsuite</package> + <package>gnu-hpc</package> + <package>gnu-hpc-testsuite</package> + <package>gnu-hpc-ofi</package> + <package>gnu-hpc-ofi-testsuite</package> </multibuild> ++++++ macros.hpc-mpich ++++++ # # mpich # %hpc_mpich_init(V:) \ %{-V: %define _mf_ver %{-V*}} \ %{expand: %%global hpc_mpich_dep_version %%{?_mf_ver}%%{!?_mf_ver:3}} \ %{expand: %%global hpc_mpich_dir mpich%{hpc_mpich_dep_version}} \ %{expand: %%global hpc_mpich_pack_version %{hpc_mpich_dep_version}} # We may have to add a version here. %hpc_setup_mpich \ module load mpich %hpc_mpich_requires_devel \ Requires: mpich%{hpc_mpich_dep_version}-%{compiler_family}%{hpc_cf_pack_version}-hpc-devel