-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeskow_install_pfft.sh
executable file
·86 lines (73 loc) · 1.88 KB
/
beskow_install_pfft.sh
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
83
84
85
86
#!/bin/bash -l
source beskow_env.sh
# FFTW
# ----
# FFTW == 3.3.4 requires patching, whereas 3.3.5 and later versions should work
# as it is. See: https://github.com/mpip/pfft#install
# You can use the same fftw directory that for p3dfft
# fftwdir=$(dirname $pkgdir)
# Alternatively, set fftwdir as an empty string and mention fftw include and
# library directories seperately below
fftwinc=$FFTW_INC
fftwlib=$FFTW_DIR
# Customizable variables
# ----------------------
pkgname='pfft'
# PFFT version
pkgver="1.0.8-alpha"
# Directory in which the source git repository will be downloaded
srcdir="$srcdir"
# Directory to which the compiled pfft library will be installed
pkgdir="$pkgdir/${pkgname}-${pkgver}"
# Should be no reason to change anything below
# --------------------------------------------
git_clone() {
git clone https://github.com/mpip/pfft.git ${srcdir}/${pkgname}-${pkgver} --depth=10
}
download() {
mkdir -p ${srcdir}
cd ${srcdir}
if [ ! -f ${pkgname}-${pkgver}.tar.gz ]; then
wget http://www.tu-chemnitz.de/~potts/workgroup/pippig/software/${pkgname}-${pkgver}.tar.gz
fi
tar vxzf ${pkgname}-${pkgver}.tar.gz
}
clean() {
rm -rf ${srcdir}/${pkgname}-${pkgver}
rm -rf ${pkgdir}
}
build() {
cd ${srcdir}/${pkgname}-${pkgver}
export LANG=C
./bootstrap.sh
CONFIGURE="$CONFIGURE
--prefix=${pkgdir} \
CC=${CC} FC=${FC} MPICC=${CC} MPIFC=${FC} "
if [ -n "$fftwdir" ]; then
CONFIGURE+="--with-fftw3=${fftwdir}"
else
CONFIGURE+="CPPFLAGS=-I${fftwinc} LDFLAGS=-L${fftwlib}"
fi
echo ${CONFIGURE}
${CONFIGURE}
${MAKE}
}
package() {
set -e
cd ${srcdir}/${pkgname}-${pkgver}
$MAKE install
set +e
cd ${pkgdir}/..
stow -v $pkgname-$pkgver
}
# Execute the functions above
# ---------------------------
clean
if [ ! -d ${srcdir}/${pkgname}-${pkgver} ]
then
## Use any one of the following
git_clone
# download
fi
build
package