-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (91 loc) · 4.17 KB
/
cmake-fftw.yml
File metadata and controls
95 lines (91 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
name: Find FFTW
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: install
run: sudo apt update && sudo apt install build-essential ninja-build cmake
- name: fftw-download
run: |
wget https://www.fftw.org/fftw-3.3.10.tar.gz && tar -xf fftw-3.3.10.tar.gz
- name: copy-fftw
run: |
cp -r fftw-3.3.10 fftw-3.3.10-shared
cp -r fftw-3.3.10 fftw-3.3.10-global
- name: configure-fftw-local
working-directory: ./fftw-3.3.10
run: |
./configure --prefix=`realpath ../fftw-install` && make && make install
# remaining steps invoke CMake in various ways to test all installation pathways
# they all run even if the previous ones fail
- name: run CMake (local, with FFTW3_INCLUDE_DIR)
run: |
cmake -S . -B cmake-build-inc -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFFTW_CPP_BUILD_TESTS=ON -DFFTW3_INCLUDE_DIR=`realpath ./fftw-install/include` | tee -a cmake-output.log
cmake --build cmake-build-inc
- name: run CMake (local, with FFTW3_LIBRARY_DIR)
if: '!cancelled()'
run: |
cmake -S . -B cmake-build-dir -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFFTW_CPP_BUILD_TESTS=ON -DFFTW3_LIBRARY_DIR=`realpath ./fftw-install/lib` | tee -a cmake-output.log
cmake --build cmake-build-dir
- name: run CMake (local, with FFTW3_LIBRARY)
if: '!cancelled()'
run: |
cmake -S . -B cmake-build-lib -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFFTW_CPP_BUILD_TESTS=ON -DFFTW3_LIBRARY=`realpath ./fftw-install/lib/libfftw3.a` | tee -a cmake-output.log
cmake --build cmake-build-lib
- name: run CMake (local, with lib & include path)
if: '!cancelled()'
run: |
cmake -S . -B cmake-build-path -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFFTW_CPP_BUILD_TESTS=ON -DCMAKE_LIBRARY_PATH=`realpath ./fftw-install/lib` -DCMAKE_INCLUDE_PATH=`realpath ./fftw-install/include` | tee -a cmake-output.log
cmake --build cmake-build-path
- name: run CMake (local, with prefix path)
if: '!cancelled()'
run: |
cmake -S . -B cmake-build-prefix -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFFTW_CPP_BUILD_TESTS=ON -DCMAKE_PREFIX_PATH=`realpath ./fftw-install` | tee -a cmake-output.log
cmake --build cmake-build-prefix
- name: check static library was found
run: |
test $(grep "Found static FFTW3 library" cmake-output.log | wc -l) -eq 5
# shared library
- name: configure-fftw-local-shared
working-directory: ./fftw-3.3.10-shared
run: |
./configure --prefix=`realpath ../fftw-install-shared` --enable-shared && make && make install
- name: run CMake (local, with shared lib & prefix)
if: '!cancelled()'
run: |
cmake -S . -B cmake-build-shared -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFFTW_CPP_BUILD_TESTS=ON -DCMAKE_PREFIX_PATH=`realpath ./fftw-install-shared` | tee cmake-output.log
cmake --build cmake-build-shared
- name: check static library was found
run: |
test $(grep "Found shared FFTW3 library" cmake-output.log | wc -l) -eq 1
# global installation
- name: configure-fftw-global
working-directory: ./fftw-3.3.10-global
if: '!cancelled()'
run: |
./configure && make && sudo make install
- name: run CMake (global)
if: '!cancelled()'
run: |
cmake -S . -B cmake-build-global -G Ninja -DCMAKE_BUILD_TYPE=Debug -DFFTW_CPP_BUILD_TESTS=ON | tee cmake-output.log
cmake --build cmake-build-global
- name: check static library was found
run: |
test $(grep "Found static FFTW3 library" cmake-output.log | wc -l) -eq 1
# Run to make sure the executables are fine
- name: run unit tests
working-directory: ./cmake-build-global
run: |
ctest --verbose
- name: run unit tests (shared)
working-directory: ./cmake-build-shared
run: |
ctest --verbose