forked from egpbos/findFFTW
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (116 loc) · 4.17 KB
/
Copy pathtest.yml
File metadata and controls
134 lines (116 loc) · 4.17 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Test findFFTW
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
test-apt:
name: Test apt install
runs-on: ubuntu-latest
env:
fftw_components: "DOUBLE_LIB;FLOAT_LIB;LONGDOUBLE_LIB;DOUBLE_THREADS_LIB;FLOAT_THREADS_LIB;LONGDOUBLE_THREADS_LIB;DOUBLE_OPENMP_LIB;FLOAT_OPENMP_LIB;LONGDOUBLE_OPENMP_LIB"
steps:
- uses: actions/checkout@v6
- name: Install FFTW
run: sudo apt-get install -y libfftw3-dev
- name: Configure test
run: |
cmake -S test -B build \
-DFFTW_TEST_COMPONENTS="${fftw_components}"
- name: Configure test with version 3
run: |
cmake -S test -B build \
-DFFTW_TEST_COMPONENTS="${fftw_components}" \
-DFFTW_TEST_VERSION=3
- name: Configure test with invalid version
run: |
set +e
cmake -S test -B build_version_fail -DFFTW_TEST_VERSION=999.99.9 2>/dev/null
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "PASS: find_package correctly rejected version 999.99.9"
else
echo "FAIL: find_package should have rejected version 999.99.9 but succeeded"
exit 1
fi
test-source:
name: Test source install
runs-on: ubuntu-latest
env:
fftw_components: "DOUBLE_LIB;DOUBLE_THREADS_LIB;DOUBLE_OPENMP_LIB;FLOAT_LIB;FLOAT_THREADS_LIB;FLOAT_OPENMP_LIB;LONGDOUBLE_LIB;LONGDOUBLE_THREADS_LIB;LONGDOUBLE_OPENMP_LIB"
steps:
- uses: actions/checkout@v6
- name: Cache FFTW build
id: cache-fftw
uses: actions/cache@v5
with:
path: ~/fftw_install
key: fftw-3.3.10-${{ runner.os }}-double-float-longdouble-threads-openmp
- name: Build FFTW from source tarball
if: steps.cache-fftw.outputs.cache-hit != 'true'
run: |
mkdir -p ~/fftw_build ~/fftw_install
cd ~/fftw_build
wget -q https://www.fftw.org/fftw-3.3.10.tar.gz
tar -xzf fftw-3.3.10.tar.gz
FFTW_SRC="$HOME/fftw_build/fftw-3.3.10"
FFTW_INSTALL="$HOME/fftw_install"
COMMON_FLAGS="--prefix=$FFTW_INSTALL --enable-shared --enable-threads --enable-openmp"
# Double precision (default)
mkdir build_double && cd build_double
$FFTW_SRC/configure $COMMON_FLAGS
make -j$(nproc)
make install
cd ..
# Single (float) precision
mkdir build_float && cd build_float
$FFTW_SRC/configure $COMMON_FLAGS --enable-float
make -j$(nproc)
make install
cd ..
# Long double precision
mkdir build_longdouble && cd build_longdouble
$FFTW_SRC/configure $COMMON_FLAGS --enable-long-double
make -j$(nproc)
make install
cd ..
- name: Configure test
run: |
cmake -S test -B build \
-DFFTW_ROOT="$HOME/fftw_install" \
-DFFTW_TEST_COMPONENTS="${fftw_components}"
- name: Configure test with version 3
run: |
cmake -S test -B build \
-DFFTW_ROOT="$HOME/fftw_install" \
-DFFTW_TEST_COMPONENTS="${fftw_components}" \
-DFFTW_TEST_VERSION=3
test-conda:
name: Test conda-forge install
runs-on: ubuntu-latest
env:
fftw_components: "DOUBLE_LIB;FLOAT_LIB;LONGDOUBLE_LIB;DOUBLE_THREADS_LIB;FLOAT_THREADS_LIB;LONGDOUBLE_THREADS_LIB"
steps:
- uses: actions/checkout@v6
- name: Install FFTW with conda-forge (micromamba)
uses: mamba-org/setup-micromamba@v3
with:
environment-name: fftw-test
create-args: conda-forge::fftw
init-shell: bash
post-cleanup: none
- name: Configure test
shell: micromamba-shell {0}
run: |
cmake -S test -B build \
-DFFTW_ROOT="$CONDA_PREFIX" \
-DFFTW_TEST_COMPONENTS="${fftw_components}"
- name: Configure test with version 3
shell: micromamba-shell {0}
run: |
cmake -S test -B build \
-DFFTW_ROOT="$CONDA_PREFIX" \
-DFFTW_TEST_COMPONENTS="${fftw_components}" \
-DFFTW_TEST_VERSION=3