summaryrefslogtreecommitdiff
path: root/mpich/PKGBUILD
blob: 337410afc377fe233bc8635efb9416a47ae60f26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Jed Brown <jed@59A2.org>
# Contributor: George Eleftheriou <eleftg>

pkgname=mpich
pkgver=3.4.1
pkgrel=1
pkgdesc="An improved implementation of the Message Passing Interface."
url="https://mpich.org"
arch=('i686' 'pentium4' 'x86_64')
license=("custom")
replaces=(mpich2)
_pinned_dependencies=(
  'gcc-libs=10.2.0'
  'glibc>=2.31'
  'libgfortran.so=5'
  'libudev.so=1'
  'libxml2=2.9.10'
)
depends=('openssh' 'numactl' 'pciutils' "${_pinned_dependencies[@]}")
makedepends=('texlive-core' 'sowing')
optdepends=("java-environment")
install="${pkgname}.install"
source=("https://www.mpich.org/static/downloads/${pkgver}/${pkgname}-${pkgver}.tar.gz"
	"mpich.profile")
sha512sums=('61aa161b14bd501320e45e0598ea4f125a704383e4998bf1773ba8b1ce06fb73204bad8f7a5fc147b1cef97e6420cdb150856f6ab03db4dddfe87f02edd3b8d2'
            '4825e4522fc22d45f10b3761295aa38b3dd978830abf0f258e0df571c9d5b526cdafa661f7662d575801945d62f0812cba86c5acf3eb502cdf5df4412e74409c')
options=('!libtool')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # CFLAGS etc are normally written into the wrapper compilers.  This
  # gives surprising results, e.g. when the user wants to compile their
  # program without optimization.
  export MPICHLIB_CFLAGS="${CFLAGS}";      unset CFLAGS
  export MPICHLIB_CXXFLAGS="${CXXFLAGS}";  unset CXXFLAGS
  export MPICHLIB_CPPFLAGS="${CPPFLAGS}";  unset CPPFLAGS
  export MPICHLIB_FFLAGS="${FFLAGS}";      unset FFLAGS
  export MPICHLIB_FCFLAGS="${FCFLAGS}";    unset FCFLAGS
  export MPICHLIB_LDFLAGS="${LDFLAGS}";    unset LDFLAGS

  mkdir -p build
  cd build

  ../configure --prefix=/usr \
               --with-device=ch3:nemesis \
               --enable-error-checking=runtime \
               --enable-error-messages=all \
               --enable-g=meminit \
               CC=gcc CXX=g++ FC=gfortran \
               FFLAGS=-fallow-argument-mismatch \
               FCFLAGS=-fallow-argument-mismatch

  make
  make mandoc
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}/build

  make check
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}/build"
  make DESTDIR="${pkgdir}" install

  ln -sf mpiexec.hydra "${pkgdir}/usr/bin/mpiexec"
  ln -sf mpiexec "${pkgdir}/usr/bin/mpirun"
  ln -sf mpiexec.hydra "${pkgdir}/usr/bin/mpirun.hydra"

  install -D -m644 "${srcdir}/${pkgname}-${pkgver}/COPYRIGHT" "${pkgdir}/usr/share/licenses/mpich/license.txt"
  install -D -m755 "${srcdir}/${pkgname}.profile" "${pkgdir}/etc/profile.d/mpich.sh"

  mkdir -p "${pkgdir}/etc/ld.so.conf.d"
  echo /opt/mpich/lib > "${pkgdir}/etc/ld.so.conf.d/mpich.conf"
}