Skip to content

Commit b6889a4

Browse files
author
Michael McLeod
committed
Merge branch 'development' into mm_onnx_testing
2 parents a8026ce + 0a92448 commit b6889a4

File tree

11 files changed

+150
-394
lines changed

11 files changed

+150
-394
lines changed

.github/workflows/cmake.yml

Lines changed: 78 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ env:
1717
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1818
BUILD_TYPE: Release
1919
OMP_NUM_THREADS: 2
20-
CONAN_PRINT_RUN_COMMANDS: 1
21-
CONAN_CPU_COUNT: 2
22-
CONAN_SKIP_BROKEN_SYMLINKS_CHECK: 'True'
2320

2421
jobs:
2522
build:
@@ -42,75 +39,53 @@ jobs:
4239
- macos-14
4340
cc:
4441
- gcc-10
42+
- gcc-11
4543
- clang
4644
cxx:
4745
- g++-10
46+
- g++-11
4847
- clang++
4948
mpi:
50-
- "on"
51-
- "off"
49+
- "ON"
50+
- "OFF"
5251
omp:
53-
- "on"
54-
- "off"
52+
- "ON"
53+
- "OFF"
5554
exclude:
55+
- cc: gcc-11
56+
cxx: clang++
57+
- cc: clang
58+
cxx: g++-11
5659
- cc: gcc-10
5760
cxx: clang++
5861
- cc: clang
5962
cxx: g++-10
6063
- os: ubuntu-20.04
6164
cc: clang
6265
cxx: clang++
66+
- os: macos-14
67+
cxx: g++-10
68+
- os: macos-14
69+
cc: gcc-10
70+
- os: ubuntu-20.04
71+
cxx: g++-11
72+
- os: ubuntu-20.04
73+
cc: gcc-11
6374
- os: macos-14
6475
mpi: "on"
76+
- os: macos-14
77+
cxx: g++-11
6578
- cxx: clang++
6679
omp: "on"
6780

6881
steps:
69-
- uses: actions/checkout@v3
70-
with:
71-
submodules: recursive
82+
- uses: actions/checkout@v4
7283

7384
# Enable tmate debugging of manually-triggered workflows if the input option was provided
7485
- name: Setup tmate session
7586
uses: mxschmitt/action-tmate@v3
7687
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
7788

78-
- name: Install Dependencies on Ubunutu
79-
if: ${{ contains(matrix.os, 'ubuntu') }}
80-
run: |
81-
sudo apt update
82-
sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev
83-
pip install conan
84-
85-
- name: Install Dependencies on MacOS
86-
if: ${{ contains(matrix.os, 'macos') }}
87-
run: |
88-
brew install libtiff open-mpi libomp libyaml ccache conan
89-
echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV
90-
echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH
91-
92-
- name: Install Tensorflow API on Ubuntu
93-
# TODO could this be combined with mac version somehow? if/else?
94-
if: ${{ contains(matrix.os, 'ubuntu') }}
95-
uses: UCL/install-tensorflow-action@main
96-
with:
97-
version: 2.11.0
98-
os: linux
99-
100-
- name: Install Tensorflow API on MacOS
101-
if: ${{ contains(matrix.os, 'macos') }}
102-
uses: UCL/install-tensorflow-action@main
103-
with:
104-
version: 2.11.0
105-
os: darwin
106-
107-
- name: Select Python 3.10
108-
# otherwise turtlebrowser/get-conan@v1.1 fails on macos-12
109-
# ref: https://github.com/turtlebrowser/get-conan/issues/4
110-
uses: actions/setup-python@v4
111-
with:
112-
python-version: '3.10'
113-
11489
- name: Prepare ccache timestamp
11590
id: ccache_cache_timestamp
11691
run: echo "{date_and_time}={$(date +'%Y-%m-%d-%H;%M;%S')}" >> $GITHUB_OUTPUT
@@ -131,20 +106,70 @@ jobs:
131106
# - name: Clear ccache
132107
# run: ccache --clear
133108

134-
- name: Build sopt
109+
- name: Install Dependencies on Ubunutu
110+
if: ${{ contains(matrix.os, 'ubuntu') }}
111+
run: |
112+
sudo apt update
113+
sudo apt install openmpi-bin libopenmpi-dev ccache graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev
114+
115+
- name: Install Dependencies on MacOS
116+
if: ${{ contains(matrix.os, 'macos') }}
117+
run: |
118+
brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost yaml-cpp
119+
echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV
120+
echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH
121+
122+
- name: Checkout Catch2
123+
uses: actions/checkout@v4
124+
with:
125+
repository: catchorg/Catch2.git
126+
path: Catch2
127+
ref: v3.4.0
128+
129+
- name: Build Catch2
130+
run: |
131+
mkdir Catch2/build
132+
cd Catch2/build
133+
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
134+
make -j$(nproc --ignore 1) install
135+
136+
- name: Install FFTW
135137
run: |
136-
conan profile detect
137-
conan create ${{github.workspace}}/sopt --build missing -s compiler.cppstd=17 -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}}
138+
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
139+
cd fftw-3.3.10
140+
./configure --prefix=${{github.workspace}}/local --enable-shared
141+
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
142+
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
143+
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake
144+
145+
- name: Checkout SOPT
146+
uses: actions/checkout@v4
147+
with:
148+
repository: astro-informatics/sopt.git
149+
path: sopt
150+
ref: development
138151

139-
- name: Dependencies
140-
run: conan install ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 --build missing -o docasa=off -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}}
152+
- name: Build sopt
153+
run: |
154+
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
155+
mkdir -p ${{github.workspace}}/sopt/build
156+
cd ${{github.workspace}}/sopt/build
157+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} -Dtests=OFF -Dexamples=OFF
158+
make -j$(nproc --ignore 1) install
141159
142160
- name: Install
143161
# Build your program with the given configuration
144-
run: conan build ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 -o docasa=off -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}}
162+
run: |
163+
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
164+
mkdir -p ${{github.workspace}}/build
165+
cd ${{github.workspace}}/build
166+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}}
167+
make -j$(nproc --ignore 1) install
145168
146169
- name: Test
147170
working-directory: ${{github.workspace}}/build
148171
# Execute tests defined by the CMake configuration.
149172
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
150-
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
173+
run: |
174+
export LD_LIBRARY_PATH=${{github.workspace}}/local/lib:${{github.workspace}}/local/external/lib:${LD_LIBRARY_PATH}
175+
ctest -C ${{env.BUILD_TYPE}} --output-on-failure

.github/workflows/documentation.yml

Lines changed: 30 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
branches: [ development ]
88
if: github.event.pull_request.draft == false
99

10-
env:
11-
USE_CONAN: 0
12-
1310
jobs:
1411
make-documentation:
1512
runs-on: ubuntu-20.04
@@ -23,52 +20,31 @@ jobs:
2320
- name: Install dependencies
2421
run: |
2522
sudo apt update
26-
sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz
27-
if [[ "$USE_CONAN" = 1 ]]; then
28-
pip install conan
29-
else
30-
sudo apt install libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev
31-
sudo apt install libbenchmark-dev libboost-all-dev libyaml-cpp-dev
32-
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
33-
mkdir Catch2/build
34-
cd Catch2/build
35-
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build
36-
make -j$(nproc --ignore 1) install
37-
cd -
38-
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
39-
cd fftw-3.3.10
40-
./configure --prefix=${{github.workspace}}/build --enable-shared
41-
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
42-
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
43-
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake
44-
cd -
45-
fi
23+
sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev libbenchmark-dev libboost-all-dev libyaml-cpp-dev
24+
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
4625
47-
- name: Install Tensorflow API on Ubuntu
48-
uses: UCL/install-tensorflow-action@main
26+
- name: Checkout Catch2
27+
uses: actions/checkout@v4
4928
with:
50-
version: 2.11.0
51-
os: linux
29+
repository: catchorg/Catch2.git
30+
path: Catch2
31+
ref: v3.4.0
5232

53-
- name: Checkout cppflow repo
54-
uses: actions/checkout@v3
55-
with:
56-
repository: UCL/cppflow.git
57-
path: cppflow
58-
ref: master
33+
- name: Build Catch2
34+
run: |
35+
mkdir Catch2/build
36+
cd Catch2/build
37+
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
38+
make -j$(nproc --ignore 1) install
5939
60-
- name: Create cppflow package
40+
- name: Install FFTW
6141
run: |
62-
if [[ "USE_CONAN" = 1 ]]; then
63-
conan detect profile
64-
conan create ./cppflow -s compiler.cppstd=17
65-
else
66-
mkdir cppflow/build
67-
cd cppflow/build
68-
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}
69-
#cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build
70-
make -j$(nproc --ignore 1) install
71-
fi
42+
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
43+
cd fftw-3.3.10
44+
./configure --prefix=${{github.workspace}}/local --enable-shared
45+
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
46+
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
47+
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake
7248
7349
- name: Checkout SOPT
7450
uses: actions/checkout@v3
@@ -79,48 +55,19 @@ jobs:
7955

8056
- name: Create SOPT package
8157
run : |
82-
if [[ "USE_CONAN" = 1 ]]; then
83-
conan create ./sopt -s compiler.cppstd=17 --build missing -o dompi=off -o docasa=off -o openmp=off -o docs=off -o cppflow=on
84-
else
85-
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
86-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
87-
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
88-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH
89-
mkdir sopt/build
90-
cd sopt/build
91-
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON
92-
#cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON
93-
make -j$(nproc --ignore 1) install
94-
fi
58+
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
59+
mkdir sopt/build
60+
cd sopt/build
61+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF
62+
make -j$(nproc --ignore 1) install
9563
9664
- name: Configure
9765
run: |
98-
if [[ "USE_CONAN" = 1 ]]; then
99-
# Doxygen currently broken in Conan v1 and v2
100-
#conan install doxygen/1.9.4@#2af713e135f12722e3536808017ba086 --update
101-
conan install ${{github.workspace}} -if ${{github.workspace}}/build -s compiler.cppstd=17 --build missing -o docasa=off -o dompi=off -o openmp=off -o docs=on -o cppflow=on
102-
else
103-
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
104-
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
105-
mkdir -p ${{github.workspace}}/build
106-
cd ${{github.workspace}}/build
107-
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON
108-
fi
109-
110-
- name: Build
111-
run: |
112-
if [[ "USE_CONAN" = 1 ]]; then
113-
conan build ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 -o docasa=off -o dompi=off -o openmp=off -o docs=on -o cppflow=on
114-
else
115-
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
116-
##export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build/lib/cmake:$CMAKE_PREFIX_PATH
117-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build:$CMAKE_PREFIX_PATH
118-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
119-
##export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH
120-
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
121-
cd ${{github.workspace}}/build
122-
make -j$(nproc --ignore 1) install
123-
fi
66+
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
67+
mkdir -p ${{github.workspace}}/build
68+
cd ${{github.workspace}}/build
69+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON
70+
make -j$(nproc --ignore 1) install
12471
12572
- name: Deploy to GH pages
12673
if: ${{github.event_name == 'push'}}

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ option(docimg "Enable CImg" off)
1515
option(docasa "Enable CASA" off)
1616
option(docs "Build documentation" off)
1717
option(coverage "Build coverage" off)
18-
option(cppflow "Build with TensorFlow interface" off)
18+
option(onnxrt "Build with ONNXruntime interface" off)
1919

2020
if(NOT CMAKE_BUILD_TYPE)
2121
message(STATUS "Setting build type to 'Release' as none was specified.")
@@ -29,7 +29,6 @@ set(Sopt_GIT_TAG "development" CACHE STRING "Branch/tag when downloading sopt")
2929

3030
## we are doing c++11
3131
#include(AddCPP11Flags)
32-
# c++17 is required when using cppflow with learned algorithms
3332
set(CMAKE_CXX_STANDARD 17)
3433
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3534
set(CMAKE_CXX_EXTENSIONS OFF)

0 commit comments

Comments
 (0)