forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fftw3.sh
52 lines (48 loc) · 1.55 KB
/
fftw3.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
package: FFTW3
version: "%(tag_basename)s"
tag: v3.3.9
source: https://github.com/alisw/fftw3
prefer_system: (?!slc5.*)
build_requires:
- alibuild-recipe-tools
- CMake
- "GCC-Toolchain:(?!osx)"
---
#!/bin/bash -e
export FFTW3_WITH_AVX # use AVX with float or double. Unset automatically for long double and quad
if [[ $FFTW3_DOUBLE == "ON" ]]; then # ensure only one option is set and AVX is disabled if necessary
FFTW3_FLOAT="OFF"
FFTW3_LONG_DOUBLE="OFF"
elif [[ $FFTW3_LONG_DOUBLE == "ON" ]]; then
unset FFTW3_WITH_AVX
FFTW3_FLOAT="OFF"
FFTW3_DOUBLE="OFF"
else # keep FLOAT default option as it was
FFTW3_FLOAT="ON"
FFTW3_DOUBLE="OFF"
FFTW3_LONG_DOUBLE="OFF"
fi
case $ARCHITECTURE in
osx_arm64)
cmake $SOURCEDIR \
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALLROOT}" \
-DCMAKE_INSTALL_LIBDIR:PATH="lib" \
-DENABLE_LONG_DOUBLE=${FFTW3_LONG_DOUBLE-OFF} \
-DENABLE_FLOAT=${FFTW3_FLOAT-OFF}
;;
*)
cmake $SOURCEDIR \
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALLROOT}" \
-DCMAKE_INSTALL_LIBDIR:PATH="lib" \
-DENABLE_LONG_DOUBLE=${FFTW3_LONG_DOUBLE-OFF} \
-DENABLE_FLOAT=${FFTW3_FLOAT-OFF} \
${FFTW3_WITH_AVX:+-DENABLE_AVX=ON}
;;
esac
make ${JOBS+-j $JOBS}
make install
#Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
alibuild-generate-module --bin --lib > $MODULEFILE