Package init

This commit is contained in:
dogsheng 2019-12-14 18:58:13 +08:00
parent bc0edefa5d
commit f4cbb3795e
9 changed files with 275 additions and 75 deletions

View File

@ -0,0 +1,13 @@
diff --git mpich-3.2/./src/binding/cxx/mpicxx.h.in~ mpich-3.2/./src/binding/cxx/mpicxx.h.in
index 375c081e0e..24f1d6c2cc 100644
--- mpich-3.2/./src/binding/cxx/mpicxx.h.in~
+++ mpich-3.2/./src/binding/cxx/mpicxx.h.in
@@ -17,7 +17,7 @@
// between 3.2.3 and 3.4.3 (!!) Normally such changes
// should only occur at major releases (e.g., version 3 to 4)
#ifdef __GNUC__
-# if __GNUC__ >= @GNUCXX_VERSION@
+# if __GNUC__ >= @GNUCXX_VERSION@ && @GNUCXX_VERSION@ == 3
# if __GNUC_MINOR__ > 2 && @GNUCXX_MINORVERSION@ == 2
# error 'Please use the same version of GCC and g++ for compiling MPICH and user MPI programs'
# endif

View File

@ -1,36 +0,0 @@
# mpich
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,39 +0,0 @@
# mpich
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

BIN
mpich-3.2.1.tar.gz Normal file

Binary file not shown.

33
mpich-modules.patch Normal file
View File

@ -0,0 +1,33 @@
--- mpich-3.2.1/src/packaging/envmods/mpich.module.in.orig 2017-11-11 03:19:44.000000000 +0100
+++ mpich-3.2.1/src/packaging/envmods/mpich.module.in 2018-04-04 14:14:16.553160669 +0200
@@ -3,12 +3,23 @@
# MPICH module for use with 'environment-modules' package:
#
+# Only allow one mpi module to be loaded at a time
+conflict mpi
+
# Define prefix so PATH and MANPATH can be updated.
-setenv prefix @prefix@
-setenv exec_prefix @exec_prefix@
+setenv MPI_BIN @LIBDIR@/bin
+setenv MPI_SYSCONFIG @sysconfdir@/@MPINAME@-@ARCH@
+setenv MPI_FORTRAN_MOD_DIR @fortranmoddir@/@MPINAME@
+setenv MPI_INCLUDE @includedir@
+setenv MPI_LIB @libdir@
+setenv MPI_MAN @mandir@
+setenv MPI_PYTHON_SITEARCH @py2sitearch@/@MPINAME@
+setenv MPI_PYTHON2_SITEARCH @py2sitearch@/@MPINAME@
+setenv MPI_PYTHON3_SITEARCH @py3sitearch@/@MPINAME@
+setenv MPI_COMPILER @MPINAME@-@ARCH@
+setenv MPI_SUFFIX _@MPINAME@
+setenv MPI_HOME @LIBDIR@
prepend-path PATH @bindir@
-prepend-path MANPATH @mandir@
-
-# Undefine prefix and exec_prefix which are too generic environment variables.
-unsetenv prefix
-unsetenv exec_prefix
+prepend-path LD_LIBRARY_PATH @libdir@
+prepend-path MANPATH :@mandir@
+prepend-path PKG_CONFIG_PATH @LIBDIR@/lib/pkgconfig

7
mpich.macros Normal file
View File

@ -0,0 +1,7 @@
%_mpich_load \
. /etc/profile.d/modules.sh; \
module load mpi/mpich-%{_arch}; \
export CFLAGS="$CFLAGS %{optflags}";
%_mpich_unload \
. /etc/profile.d/modules.sh; \
module unload mpi/mpich-%{_arch};

1
mpich.pth.py2 Normal file
View File

@ -0,0 +1 @@
import sys, os; s = os.getenv('MPI_PYTHON2_SITEARCH'); s and (s in sys.path or sys.path.append(s))

1
mpich.pth.py3 Normal file
View File

@ -0,0 +1 @@
import sys, os; s = os.getenv('MPI_PYTHON3_SITEARCH'); s and (s in sys.path or sys.path.append(s))

220
mpich.spec Normal file
View File

@ -0,0 +1,220 @@
Summary: A high-performance implementation of MPI
Name: mpich
Version: 3.2.1
Release: 9
License: MIT
URL: http://www.mpich.org/
Source0: http://www.mpich.org/static/downloads/%{version}/mpich-%{version}.tar.gz
Source1: mpich.macros
Source2: mpich.pth.py2
Source3: mpich.pth.py3
Patch0: mpich-modules.patch
Patch3: 0003-soften-version-check.patch
BuildRequires: gcc gcc-c++ gcc-gfortran hwloc-devel >= 1.8 valgrind-devel
BuildRequires: python2-devel python3-devel rpm-mpi-hooks automake
Provides: mpi
Provides: mpich2 = %{version}
Obsoletes: mpich2 < 3.0
Requires: environment(modules)
%description
MPICH is a high performance and widely portable implementation
of the Message Passing Interface (MPI) standard.
%package autoload
Summary: Load mpich automatically into profile
Requires: mpich = %{version}-%{release}
Provides: mpich2-autoload = 3.0.1
Obsoletes: mpich2-autoload < 3.0
%description autoload
This package contains profile files that make mpich automatically loaded.
%package devel
Summary: Development files for mpich
Requires: mpich = %{version}-%{release} pkgconfig gcc-gfortran rpm-mpi-hooks
Provides: mpich-devel-static = %{version}-%{release}
Provides: mpich2-devel = 3.0.1
Obsoletes: mpich2-devel < 3.0
%description devel
Contains development headers and libraries for mpich.
%package help
Summary: Documentations and examples for mpich
BuildArch: noarch
Requires: mpich-devel = %{version}-%{release}
Provides: mpich2-doc = 3.0.1
Provides: mpich-doc = %{version}-%{release}
Obsoletes: mpich2-doc < 3.0
Obsoletes: mpich-doc < %{version}-%{release}
%description help
Contains documentations, examples and man-pages for mpich.
%package -n python2-mpich
Summary: mpich support for Python 2
%description -n python2-mpich
mpich support for Python 2.
%package -n python3-mpich
Summary: mpich support for Python 3
%description -n python3-mpich
mpich support for Python 3.
%{!?opt_cc: %global opt_cc gcc}
%{!?opt_fc: %global opt_fc gfortran}
%{!?opt_f77: %global opt_f77 gfortran}
%{!?opt_cc_cflags: %global opt_cc_cflags %{optflags}}
%{!?opt_fc_fflags: %global opt_fc_fflags %{optflags}}
%{!?opt_f77_fflags: %global opt_f77_fflags %{optflags}}
%ifarch aarch64
%global m_option ""
%else
%global m_option -m64
%endif
%global selected_channels ch3:nemesis
%global XFLAGS -fPIC
%prep
%autosetup -p1
%build
%configure \
--enable-sharedlibs=gcc \
--enable-shared \
--enable-static=no \
--enable-lib-depend \
--disable-rpath \
--disable-silent-rules \
--enable-fc \
--with-device=%{selected_channels} \
--with-pm=hydra:gforker \
--includedir=%{_includedir}/mpich-%{_arch} \
--bindir=%{_libdir}/mpich/bin \
--libdir=%{_libdir}/mpich/lib \
--datadir=%{_datadir}/mpich \
--mandir=%{_mandir}/mpich-%{_arch} \
--docdir=%{_datadir}/mpich/doc \
--htmldir=%{_datadir}/mpich/doc \
--with-hwloc-prefix=system \
FC=%{opt_fc} \
F77=%{opt_f77} \
CFLAGS="%{m_option} -O2 %{?XFLAGS}" \
CXXFLAGS="%{m_option} -O2 %{?XFLAGS}" \
FCFLAGS="%{m_option} -O2 %{?XFLAGS}" \
FFLAGS="%{m_option} -O2 %{?XFLAGS}" \
LDFLAGS='-Wl,-z,noexecstack' \
MPICHLIB_CFLAGS="%{?opt_cc_cflags}" \
MPICHLIB_CXXFLAGS="%{optflags}" \
MPICHLIB_FCFLAGS="%{?opt_fc_fflags}" \
MPICHLIB_FFLAGS="%{?opt_f77_fflags}"
# MPICHLIB_LDFLAGS='-Wl,-z,noexecstack' \
# MPICH_MPICC_FLAGS="%{m_option} -O2 %{?XFLAGS}" \
# MPICH_MPICXX_FLAGS="%{m_option} -O2 %{?XFLAGS}" \
# MPICH_MPIFC_FLAGS="%{m_option} -O2 %{?XFLAGS}" \
# MPICH_MPIF77_FLAGS="%{m_option} -O2 %{?XFLAGS}"
# --with-openpa-prefix=embedded \
# FCFLAGS="%{?opt_fc_fflags} -I%{_fmoddir}/mpich %{?XFLAGS}" \
sed -r -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -r -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
sed -i -e 's| -shared | -Wl,--as-needed\0|g' libtool
%make_build V=1
%install
%make_install
mkdir -p %{buildroot}%{_fmoddir}/mpich
mv %{buildroot}%{_includedir}/mpich-*/*.mod %{buildroot}%{_fmoddir}/mpich/
sed -r -i 's|^modincdir=.*|modincdir=%{_fmoddir}/mpich|' %{buildroot}%{_libdir}/mpich/bin/mpifort
mkdir -p %{buildroot}%{_sysconfdir}/modulefiles/mpi
sed -r 's|%{_bindir}|%{_libdir}/mpich/bin|;
s|@LIBDIR@|%{_libdir}/mpich|;
s|@MPINAME@|mpich|;
s|@py2sitearch@|%{python2_sitearch}|;
s|@py3sitearch@|%{python3_sitearch}|;
s|@ARCH@|%{_arch}|;
s|@fortranmoddir@|%{_fmoddir}|;
' \
<src/packaging/envmods/mpich.module \
>%{buildroot}%{_sysconfdir}/modulefiles/mpi/mpich-%{_arch}
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
cat >%{buildroot}%{_sysconfdir}/profile.d/mpich-%{_arch}.sh <<EOF
module load mpi/mpich-%{_arch}
EOF
cp -p %{buildroot}%{_sysconfdir}/profile.d/mpich-%{_arch}.{sh,csh}
install -pDm0644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.mpich
mkdir -p %{buildroot}%{python2_sitearch}/mpich
install -pDm0644 %{SOURCE2} %{buildroot}%{python2_sitearch}/mpich.pth
mkdir -p %{buildroot}%{python3_sitearch}/mpich
install -pDm0644 %{SOURCE3} %{buildroot}%{python3_sitearch}/mpich.pth
find %{buildroot} -type f -name "*.la" -delete
%check
make check V=1
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%license COPYRIGHT
%doc CHANGES README README.envvar RELEASE_NOTES
%dir %{_libdir}/mpich
%dir %{_libdir}/mpich/lib
%dir %{_libdir}/mpich/bin
%{_libdir}/mpich/lib/*.so.*
%{_libdir}/mpich/bin/hydra*
%{_libdir}/mpich/bin/mpichversion
%{_libdir}/mpich/bin/mpiexec*
%{_libdir}/mpich/bin/mpirun
%{_libdir}/mpich/bin/mpivars
%{_libdir}/mpich/bin/parkill
%{_sysconfdir}/modulefiles/mpi/
%files autoload
%{_sysconfdir}/profile.d/mpich-%{_arch}.*
%files devel
%{_includedir}/mpich-%{_arch}/
%{_libdir}/mpich/lib/pkgconfig/
%{_libdir}/mpich/lib/*.so
%{_libdir}/mpich/bin/mpicc
%{_libdir}/mpich/bin/mpic++
%{_libdir}/mpich/bin/mpicxx
%{_libdir}/mpich/bin/mpif77
%{_libdir}/mpich/bin/mpif90
%{_libdir}/mpich/bin/mpifort
%{_fmoddir}/mpich/
%{_rpmconfigdir}/macros.d/macros.mpich
%files help
%dir %{_datadir}/mpich
%{_datadir}/mpich/doc/
%dir %{_mandir}/mpich-%{_arch}
%{_mandir}/mpich-%{_arch}/man1/
%{_mandir}/mpich-%{_arch}/man3/
%files -n python2-mpich
%dir %{python2_sitearch}/mpich
%{python2_sitearch}/mpich.pth
%files -n python3-mpich
%dir %{python3_sitearch}/mpich
%{python3_sitearch}/mpich.pth
%changelog
* Thu Nov 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.2.1-9
- Package init