-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeskow_install_fftw.sh
executable file
·107 lines (88 loc) · 2.18 KB
/
beskow_install_fftw.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash -l
source beskow_env.sh
# Customizable variables
# ----------------------
pkgname='fftw'
# FFTW version
pkgver=3.3.7
# Directory in which the source tarball will be downloaded and extracted
srcdir=$srcdir
# Directory to which the compiled FFTW library will be installed
pkgdir="$pkgdir/${pkgname}-${pkgver}"
# Should be no reason to change anything below
# --------------------------------------------
download() {
mkdir -p ${srcdir}
cd ${srcdir}
if [ ! -f ${pkgname}-${pkgver}.tar.gz ]; then
wget http://www.fftw.org/${pkgname}-${pkgver}.tar.gz
fi
echo "Extracting FFTW tarball..."
tar xzf $pkgname-$pkgver.tar.gz
}
clean() {
rm -rf ${pkgdir}
if [[ "$1" == "delete" ]]; then
echo "rm -rf ..."
rm -rf ${srcdir}/${pkgname}-${pkgver}-double
rm -rf ${srcdir}/${pkgname}-${pkgver}-single
else
echo "$MAKE -i clean"
cd ${srcdir}/${pkgname}-${pkgver}-double
$MAKE -i clean
cd ${srcdir}/${pkgname}-${pkgver}-single
$MAKE -i clean
fi
}
build() {
cd ${srcdir}
cp -an ${pkgname}-${pkgver} ${pkgname}-${pkgver}-double
cp -an ${pkgname}-${pkgver} ${pkgname}-${pkgver}-single
echo $CFLAGS $LDFLAGS
echo "PWD=$PWD"
CONFIGURE="$CONFIGURE
F77=$FC CC=$CC MPICC=$MPICC \
--prefix=${pkgdir} \
--enable-shared \
--enable-threads \
--enable-openmp \
--enable-mpi "
echo $CONFIGURE
echo $MAKE
set -e
# build double precision
cd ${srcdir}/${pkgname}-${pkgver}-double
$CONFIGURE --enable-sse2 --enable-avx --enable-avx2
$MAKE
# build & install single precision
cd ${srcdir}/${pkgname}-${pkgver}-single
$CONFIGURE --enable-float --enable-sse2 --enable-avx --enable-avx2
$MAKE
set +e
}
check() {
cd ${srcdir}/${pkgname}-${pkgver}-double
$MAKE check
cd ${srcdir}/${pkgname}-${pkgver}-single
$MAKE check
}
package() {
set -e
cd ${srcdir}/${pkgname}-${pkgver}-double
$MAKE install
cd ${srcdir}/${pkgname}-${pkgver}-single
$MAKE install
set +e
cd ${pkgdir}/..
stow -v $pkgname-$pkgver
}
# Execute the functions above
# ---------------------------
if [ ! -d ${srcdir}/${pkgname}-${pkgver} ]
then
download
fi
clean delete
build
# check
package