Repository navigation
137 lines (124 loc) · 5.48 KB
/
Copy pathbuild.yml
File metadata and controls
137 lines (124 loc) · 5.48 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
135
136
137
name: C/C++ CI
on:
push:
branches: [master]
pull_request:
defaults:
run:
shell: bash -el {0}
jobs:
build:
name: Build and test (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: GCC 14 release
os: ubuntu-24.04
compiler: gcc
configure_debug: --disable-debug
std_mdspan: 0
- name: GCC 14 debug
os: ubuntu-24.04
compiler: gcc
configure_debug: --enable-debug
std_mdspan: 0
- name: Apple Clang release
os: macos-15
compiler: apple-clang
configure_debug: --disable-debug
std_mdspan: 1
steps:
- name: Check out sources
uses: actions/checkout@v7
- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v4
with:
miniconda-version: latest
environment-file: conda-build-env.yml
activate-environment: intarna-build-env
- name: Install and select GCC 14
if: matrix.compiler == 'gcc'
run: |
sudo apt-get update
sudo apt-get install --yes gcc-14 g++-14
echo "CC=gcc-14" >> "$GITHUB_ENV"
echo "CXX=g++-14" >> "$GITHUB_ENV"
echo "LDFLAGS=-L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib" >> "$GITHUB_ENV"
- name: Verify GCC 14
if: matrix.compiler == 'gcc'
run: |
"$CC" --version
"$CXX" --version
test "$("$CC" -dumpfullversion | cut -d. -f1)" = 14
test "$("$CXX" -dumpfullversion | cut -d. -f1)" = 14
- name: Set up Apple Clang with OpenMP
if: matrix.compiler == 'apple-clang'
run: |
brew install libomp
libomp_prefix="$(brew --prefix libomp)"
echo "CC=/usr/bin/clang" >> "$GITHUB_ENV"
echo "CXX=/usr/bin/clang++" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I${libomp_prefix}/include" >> "$GITHUB_ENV"
echo "CXXFLAGS=-Xpreprocessor -fopenmp" >> "$GITHUB_ENV"
echo "LDFLAGS=-L${libomp_prefix}/lib -Wl,-rpath,${libomp_prefix}/lib -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib" >> "$GITHUB_ENV"
echo "LIBS=-lomp" >> "$GITHUB_ENV"
vrna_libs="$(pkg-config --libs RNAlib2)"
vrna_libs="${vrna_libs//-Wl,-fno-lto/}"
echo "VRNA_LIBS=${vrna_libs}" >> "$GITHUB_ENV"
- name: Verify Apple Clang
if: matrix.compiler == 'apple-clang'
run: |
"$CC" --version
"$CXX" --version
"$CXX" --version | grep -q "Apple clang"
- name: Bootstrap and configure
run: |
bash autotools-init.sh
automake --warnings=portability,error
./configure \
--prefix="$RUNNER_TEMP/intarna-install" \
--with-vrna="$CONDA_PREFIX" \
--with-boost="$CONDA_PREFIX" \
--with-boost-libdir="$CONDA_PREFIX/lib" \
--with-zlib="$CONDA_PREFIX" \
${{ matrix.configure_debug }}
grep -Eq '^CXX = .* -std=c\+\+23([[:space:]]|$)' Makefile
grep -q '^#define INTARNA_MULITHREADING 1' src/config.h
grep -q '^#define INTARNA_USE_STD_MDSPAN ${{ matrix.std_mdspan }}$' src/config.h
grep -q '^#define INTARNA_USE_STD_MDSPAN ${{ matrix.std_mdspan }}$' src/IntaRNA/intarna_config.h
- name: Build, install, and run full test suite
run: |
make -j 2
make install
make tests -j 2
python3 -m pip install -r python/requirements-output-tools.txt
PATH="$RUNNER_TEMP/intarna-install/bin:$PATH" make -C python check-python-tools
"$RUNNER_TEMP/intarna-install/bin/IntaRNA" -h
- name: Compile every installed public header independently
run: |
header_probe="$RUNNER_TEMP/intarna-header-probe.cpp"
for header in "$RUNNER_TEMP/intarna-install/include/IntaRNA/"*.h; do
printf '#include <IntaRNA/%s>\nint main() { return 0; }\n' "$(basename "$header")" > "$header_probe"
"$CXX" -std=c++23 ${CPPFLAGS:-} ${CXXFLAGS:-} \
-I"$RUNNER_TEMP/intarna-install/include" \
-I"$CONDA_PREFIX/include" \
-fsyntax-only "$header_probe"
done
- name: Compile and link an installed pkg-config consumer
run: |
consumer="$RUNNER_TEMP/intarna-consumer.cpp"
printf '#include <IntaRNA/RnaSequence.h>\n#include <IntaRNA/Matrix.h>\nint main() { IntaRNA::RnaSequence rna("test", "ACGU"); IntaRNA::Matrix<int> matrix(2, 3); matrix(1, 2) = 42; return rna.size() == 4 && matrix(1, 2) == 42 ? 0 : 1; }\n' > "$consumer"
test -f "$RUNNER_TEMP/intarna-install/include/IntaRNA/mdspan/LICENSE"
test -f "$RUNNER_TEMP/intarna-install/include/IntaRNA/experimental/LICENSE"
export PKG_CONFIG_PATH="$RUNNER_TEMP/intarna-install/lib/pkgconfig"
"$CXX" -std=c++23 ${CPPFLAGS:-} ${CXXFLAGS:-} "$consumer" \
${LDFLAGS:-} $(pkg-config --cflags --libs IntaRNA) \
-o "$RUNNER_TEMP/intarna-consumer"
"$RUNNER_TEMP/intarna-consumer"
"$CXX" -std=c++23 ${CPPFLAGS:-} ${CXXFLAGS:-} doc/seeded-probabilities-example.cpp \
${LDFLAGS:-} $(pkg-config --cflags --libs IntaRNA) \
-o "$RUNNER_TEMP/intarna-probabilities-consumer"
"$RUNNER_TEMP/intarna-probabilities-consumer" > "$RUNNER_TEMP/intarna-pair-probabilities.csv"
grep -q '^bpProb;' "$RUNNER_TEMP/intarna-pair-probabilities.csv"