summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fd8e9b42fc12b8ca62fb3e56ba4ccc7cc7ac2abb (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
79
80
81
82
# Maintainer: Myles English <myles at rockhead.biz>
# Contributor: Feng Wang <wanng.fenng@gmail.com>
# Contributor: wangjiezhe <wangjiezhe AT yandex DOT com>

######################################################################
# CAVEAT LECTOR
######################################################################
#
# Make sure you have enough RAM to build this package.
# It consumes about 6GB RAM for me when building, even if I
# keep the src dir on the disk instead of a tmpfs!
#
# Keeping the srcdir and using ccache option for faster compilation
# the next time would be a good choice.
#
# "makepkg -i" is your friend.
#
######################################################################

pkgname=trilinos-git
_pkgname=Trilinos
pkgver=12.12.0.gd3b096f4f1
pkgrel=1
pkgdesc="An effort to develop algorithms and enabling technologies within an object-oriented software framework for the solution of large-scale, complex multi-physics engineering and scientific problems."
arch=('x86_64')
url="https://github.com/trilinos/Trilinos"
license=('LGPL3')
depends=('lapack' 'openmpi' 'python2' 'boost')
provides=('trilinos')
conflicts=('trilinos')
source=(git+${url}.git)
makedepends=('git' 'python2' 'python2-numpy' 'swig' 'gcc' 'gcc-fortran' 'openmpi' 'perl' 'blas' 'lapack' 'cmake' 'libmatio' 'netcdf')
# gcc-fortran gcc-fortran-multilib
md5sums=('SKIP')
options=('ccache')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  #printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  git describe --long | sed -e 's/root-of-trilinos-release-//' -e 's/branch-//' -e 's/^v//;s/-/./g'
}

build() {
  cd "$srcdir/${_pkgname}"

  find ${srcdir}/${_pkgname} -name "*" -type f -exec \
      sed -i 's#\(/usr/bin/env \|/usr/bin/\)python[2-3]*#\1python2#' {} \;

  [[ -e build ]] && rm -rf build
  mkdir build
  cd build

  cmake .. \
      -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
      -DTrilinos_ENABLE_FEI=OFF \
      -DTrilinos_ENABLE_STKClassic=OFF \
      -DTrilinos_ENABLE_SEACAS=ON     \
      -DTrilinos_ENABLE_Sundance=OFF \
      -DTrilinos_ENABLE_TESTS=OFF \
      -DTrilinos_ENABLE_OpenMP:BOOL=ON \
      -DTPL_ENABLE_MPI:BOOL=ON \
      -DTrilinos_ENABLE_PyTrilinos:BOOL=ON \
      -DPyTrilinos_DOCSTRINGS:BOOL=OFF \
      -DPYTHON_EXECUTABLE:PATH=/usr/bin/python2 \
      -DCMAKE_INSTALL_PREFIX:PATH=/opt/trilinos \
      -DTPL_ENABLE_Netcdf=ON          \
      -DTPL_ENABLE_QT=OFF              \
      -DTPL_ENABLE_GLM=OFF              \
      -DBUILD_SHARED_LIBS:BOOL=ON \
      $EXTRA_ARGS

  make
}

package() {
    cd $srcdir/${_pkgname}/build
    make install DESTDIR=$pkgdir

    mkdir -p "${pkgdir}/etc/profile.d"
    echo "export TRILINOS_DIR=/opt/trilinos" > "${pkgdir}/etc/profile.d/trilinos.sh"
    chmod +x "${pkgdir}/etc/profile.d/trilinos.sh"
}