Skip to content

Updates from MSSL in-person meeting #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
571decb
migrate cppflow to ONNXrt
20DM Jul 15, 2024
c62d4d2
update docs
20DM Jul 15, 2024
bb6aacc
missed one preprocessor flag
20DM Jul 15, 2024
3bc4165
remove Conan support
20DM Jul 15, 2024
294e248
remove leftover cppflow stuff
20DM Jul 15, 2024
47e035a
set cmake prefix for catch2
20DM Jul 15, 2024
0a16ef4
protect against existing directory
20DM Jul 16, 2024
d5149a0
add debugging output
20DM Jul 16, 2024
0fe8436
why cannot it not find cubature?
20DM Jul 16, 2024
0057a6c
add boost
20DM Jul 16, 2024
e81e6de
add yaml-cpp to MacOS
20DM Jul 16, 2024
595bf03
help gcc a little
20DM Jul 16, 2024
5fec061
put correct install path for Cubature, d'oh
20DM Jul 16, 2024
5192e96
missed the lib
20DM Jul 16, 2024
4f23771
address comments
20DM Sep 12, 2024
8b3cd2c
Move duplication to separate steps
tkoskela Sep 12, 2024
8bb055f
Merge branch 'cg_cppflow_migration' of github.com:astro-informatics/p…
tkoskela Sep 12, 2024
e0cfc9a
address review comments
20DM Sep 12, 2024
fccf0f4
Merge branch 'cg_cppflow_migration' of github.com:astro-informatics/p…
20DM Sep 12, 2024
6372d63
switch off tests in SOPT for documentation
20DM Sep 12, 2024
9a0ea24
enable Purify tests and examples in docs
20DM Sep 12, 2024
968bcda
build -> local
20DM Sep 12, 2024
d059a9d
cleanups
20DM Sep 12, 2024
3b59a05
typo
20DM Sep 12, 2024
230c27f
Speed up sopt build
tkoskela Sep 12, 2024
18f49d2
Do cmake and make in same step
tkoskela Sep 12, 2024
d2b3001
debug install path
20DM Sep 12, 2024
0fcc525
replace PWD
20DM Sep 12, 2024
6c30d50
use double curly braces
20DM Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 58 additions & 33 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
OMP_NUM_THREADS: 2
CONAN_PRINT_RUN_COMMANDS: 1
CONAN_CPU_COUNT: 2
CONAN_SKIP_BROKEN_SYMLINKS_CHECK: 'True'

jobs:
build:
Expand Down Expand Up @@ -49,11 +46,11 @@ jobs:
- g++-11
- clang++
mpi:
- "on"
- "off"
- "ON"
- "OFF"
omp:
- "on"
- "off"
- "ON"
- "OFF"
exclude:
- cc: gcc-11
cxx: clang++
Expand All @@ -76,6 +73,8 @@ jobs:
cc: gcc-11
- os: macos-14
mpi: "on"
- os: macos-14
cxx: g++-11
- cxx: clang++
omp: "on"

Expand All @@ -93,34 +92,42 @@ jobs:
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt update
sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev
pip install conan
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
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
mkdir Catch2/build
cd Catch2/build
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
make -j$(nproc --ignore 1) install
cd -
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
cd fftw-3.3.10
./configure --prefix=${{github.workspace}}/local --enable-shared
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake
cd -

- name: Install Dependencies on MacOS
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install gcc libtiff open-mpi libomp libyaml ccache conan
brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost yaml-cpp
echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV
echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH

- name: Install Tensorflow API on Ubuntu
# TODO could this be combined with mac version somehow? if/else?
if: ${{ contains(matrix.os, 'ubuntu') }}
uses: UCL/install-tensorflow-action@main
with:
version: 2.11.0
os: linux

- name: Install Tensorflow API on MacOS
if: ${{ contains(matrix.os, 'macos') }}
uses: UCL/install-tensorflow-action@main
with:
version: 2.11.0
os: darwin
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
mkdir Catch2/build
cd Catch2/build
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
make -j$(nproc --ignore 1) install
cd -
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
cd fftw-3.3.10
./configure --prefix=${{github.workspace}}/local --enable-shared
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake
cd -

- name: Select Python 3.10
# otherwise turtlebrowser/get-conan@v1.1 fails on macos-12
# ref: https://github.com/turtlebrowser/get-conan/issues/4
uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -145,20 +152,38 @@ jobs:
# - name: Clear ccache
# run: ccache --clear

- name: Checkout SOPT
uses: actions/checkout@v3
with:
repository: astro-informatics/sopt.git
path: sopt
ref: development

- name: Build sopt
run: |
conan profile detect
conan create ${{github.workspace}}/sopt --build missing -s compiler.cppstd=17 -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}}
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
mkdir -p ${{github.workspace}}/sopt/build
cd ${{github.workspace}}/sopt/build
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}}
make -j$(nproc --ignore 1) install

- name: Dependencies
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}}

- name: Install
# Build your program with the given configuration
run: conan build ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 -o docasa=off -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}}
run: |
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH
mkdir -p ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}}
make -j$(nproc --ignore 1) install

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
run: |
export LD_LIBRARY_PATH=${{github.workspace}}/local/lib:${{github.workspace}}/local/external/lib:${LD_LIBRARY_PATH}
ctest -C ${{env.BUILD_TYPE}} --output-on-failure
111 changes: 27 additions & 84 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
branches: [ development ]
if: github.event.pull_request.draft == false

env:
USE_CONAN: 0

jobs:
make-documentation:
runs-on: ubuntu-20.04
Expand All @@ -23,52 +20,20 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev doxygen graphviz
if [[ "$USE_CONAN" = 1 ]]; then
pip install conan
else
sudo apt install libeigen3-dev libspdlog-dev libtiff-dev libcfitsio-dev
sudo apt install libbenchmark-dev libboost-all-dev libyaml-cpp-dev
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
mkdir Catch2/build
cd Catch2/build
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build
make -j$(nproc --ignore 1) install
cd -
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
cd fftw-3.3.10
./configure --prefix=${{github.workspace}}/build --enable-shared
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake
cd -
fi

- name: Install Tensorflow API on Ubuntu
uses: UCL/install-tensorflow-action@main
with:
version: 2.11.0
os: linux

- name: Checkout cppflow repo
uses: actions/checkout@v3
with:
repository: UCL/cppflow.git
path: cppflow
ref: master

- name: Create cppflow package
run: |
if [[ "USE_CONAN" = 1 ]]; then
conan detect profile
conan create ./cppflow -s compiler.cppstd=17
else
mkdir cppflow/build
cd cppflow/build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}
#cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build
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
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
mkdir Catch2/build
cd Catch2/build
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build
make -j$(nproc --ignore 1) install
fi
cd -
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
cd fftw-3.3.10
./configure --prefix=${{github.workspace}}/build --enable-shared
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake
cd -

- name: Checkout SOPT
uses: actions/checkout@v3
Expand All @@ -79,48 +44,26 @@ jobs:

- name: Create SOPT package
run : |
if [[ "USE_CONAN" = 1 ]]; then
conan create ./sopt -s compiler.cppstd=17 --build missing -o dompi=off -o docasa=off -o openmp=off -o docs=off -o cppflow=on
else
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH
mkdir sopt/build
cd sopt/build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON
#cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON
make -j$(nproc --ignore 1) install
fi
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH
mkdir sopt/build
cd sopt/build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF
make -j$(nproc --ignore 1) install

- name: Configure
run: |
if [[ "USE_CONAN" = 1 ]]; then
# Doxygen currently broken in Conan v1 and v2
#conan install doxygen/1.9.4@#2af713e135f12722e3536808017ba086 --update
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
else
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
mkdir -p ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON
fi
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
mkdir -p ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON

- name: Build
run: |
if [[ "USE_CONAN" = 1 ]]; then
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
else
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
##export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build/lib/cmake:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build:$CMAKE_PREFIX_PATH
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
##export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
cd ${{github.workspace}}/build
make -j$(nproc --ignore 1) install
fi
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
cd ${{github.workspace}}/build
make -j$(nproc --ignore 1) install

- name: Deploy to GH pages
if: ${{github.event_name == 'push'}}
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ option(docimg "Enable CImg" off)
option(docasa "Enable CASA" off)
option(docs "Build documentation" off)
option(coverage "Build coverage" off)
option(cppflow "Build with TensorFlow interface" off)
option(onnxrt "Build with ONNXruntime interface" off)

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

## we are doing c++11
#include(AddCPP11Flags)
# c++17 is required when using cppflow with learned algorithms
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
Loading
Loading