Skip to content

Commit e5f511c

Browse files
committed
Merge branch 'development' into tk/spack-install-fixes
2 parents c71c1f0 + 4c50839 commit e5f511c

File tree

6 files changed

+68
-92
lines changed

6 files changed

+68
-92
lines changed

.github/workflows/cmake.yml

Lines changed: 36 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -79,81 +79,71 @@ jobs:
7979
omp: "on"
8080

8181
steps:
82-
- uses: actions/checkout@v3
83-
with:
84-
submodules: recursive
82+
- uses: actions/checkout@v4
8583

8684
# Enable tmate debugging of manually-triggered workflows if the input option was provided
8785
- name: Setup tmate session
8886
uses: mxschmitt/action-tmate@v3
8987
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
9088

89+
- name: Prepare ccache timestamp
90+
id: ccache_cache_timestamp
91+
run: echo "{date_and_time}={$(date +'%Y-%m-%d-%H;%M;%S')}" >> $GITHUB_OUTPUT
92+
- name: Set ccache cache directory
93+
shell: bash
94+
run: echo "CCACHE_DIR=${{runner.workspace}}/.ccache" >> "${GITHUB_ENV}"
95+
- name: Cache ccache files
96+
uses: actions/cache@v3
97+
with:
98+
path: ${{runner.workspace}}/.ccache
99+
key: ${{matrix.os}}-${{matrix.cxx}}-${{matrix.mpi}}-${{matrix.omp}}-${{ steps.ccache_cache_timestamp.outputs.date_and_time }}
100+
restore-keys: |
101+
${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
102+
${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}
103+
${{ matrix.os }}-${{ matrix.cxx }}
104+
${{ matrix.os }}
105+
106+
# - name: Clear ccache
107+
# run: ccache --clear
108+
91109
- name: Install Dependencies on Ubunutu
92110
if: ${{ contains(matrix.os, 'ubuntu') }}
93111
run: |
94112
sudo apt update
95113
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
96-
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
97-
mkdir Catch2/build
98-
cd Catch2/build
99-
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
100-
make -j$(nproc --ignore 1) install
101-
cd -
102-
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
103-
cd fftw-3.3.10
104-
./configure --prefix=${{github.workspace}}/local --enable-shared
105-
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
106-
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
107-
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake
108-
cd -
109114
110115
- name: Install Dependencies on MacOS
111116
if: ${{ contains(matrix.os, 'macos') }}
112117
run: |
113118
brew install gcc libtiff open-mpi libomp eigen libyaml ccache cfitsio boost yaml-cpp
114119
echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV
115120
echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH
116-
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
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: |
117131
mkdir Catch2/build
118132
cd Catch2/build
119133
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
120134
make -j$(nproc --ignore 1) install
121-
cd -
135+
136+
- name: Install FFTW
137+
run: |
122138
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
123139
cd fftw-3.3.10
124140
./configure --prefix=${{github.workspace}}/local --enable-shared
125141
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
126142
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
127143
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/local/lib*/cmake/*/FFTW3Config.cmake
128-
cd -
129-
130-
- name: Select Python 3.10
131-
uses: actions/setup-python@v4
132-
with:
133-
python-version: '3.10'
134-
135-
- name: Prepare ccache timestamp
136-
id: ccache_cache_timestamp
137-
run: echo "{date_and_time}={$(date +'%Y-%m-%d-%H;%M;%S')}" >> $GITHUB_OUTPUT
138-
- name: Set ccache cache directory
139-
shell: bash
140-
run: echo "CCACHE_DIR=${{runner.workspace}}/.ccache" >> "${GITHUB_ENV}"
141-
- name: Cache ccache files
142-
uses: actions/cache@v3
143-
with:
144-
path: ${{runner.workspace}}/.ccache
145-
key: ${{matrix.os}}-${{matrix.cxx}}-${{matrix.mpi}}-${{matrix.omp}}-${{ steps.ccache_cache_timestamp.outputs.date_and_time }}
146-
restore-keys: |
147-
${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
148-
${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}
149-
${{ matrix.os }}-${{ matrix.cxx }}
150-
${{ matrix.os }}
151-
152-
# - name: Clear ccache
153-
# run: ccache --clear
154144
155145
- name: Checkout SOPT
156-
uses: actions/checkout@v3
146+
uses: actions/checkout@v4
157147
with:
158148
repository: astro-informatics/sopt.git
159149
path: sopt
@@ -162,19 +152,15 @@ jobs:
162152
- name: Build sopt
163153
run: |
164154
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
165-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
166155
mkdir -p ${{github.workspace}}/sopt/build
167156
cd ${{github.workspace}}/sopt/build
168-
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}}
157+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} -Dtests=OFF -Dexamples=OFF
169158
make -j$(nproc --ignore 1) install
170159
171-
172160
- name: Install
173161
# Build your program with the given configuration
174162
run: |
175163
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
176-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
177-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH
178164
mkdir -p ${{github.workspace}}/build
179165
cd ${{github.workspace}}/build
180166
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}}

.github/workflows/documentation.yml

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,30 @@ jobs:
2121
run: |
2222
sudo apt update
2323
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-
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
25-
mkdir Catch2/build
26-
cd Catch2/build
27-
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build
28-
make -j$(nproc --ignore 1) install
29-
cd -
3024
wget --no-check-certificate --no-verbose http://www.fftw.org/fftw-3.3.10.tar.gz -O- | tar --no-same-owner -xz;
31-
cd fftw-3.3.10
32-
./configure --prefix=${{github.workspace}}/build --enable-shared
33-
make -j$(nproc --ignore 1) install CFLAGS=-fPIC
34-
# Fix bug in FFT3 (cf. https://github.com/FFTW/fftw3/issues/332)
35-
sed -i -e 's/^.*FFTW3LibraryDepends.cmake.*$//1' ${{github.workspace}}/build/lib*/cmake/*/FFTW3Config.cmake
36-
cd -
25+
26+
- name: Checkout Catch2
27+
uses: actions/checkout@v4
28+
with:
29+
repository: catchorg/Catch2.git
30+
path: Catch2
31+
ref: v3.4.0
32+
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
39+
40+
- name: Install FFTW
41+
run: |
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
3748
3849
- name: Checkout SOPT
3950
uses: actions/checkout@v3
@@ -44,25 +55,18 @@ jobs:
4455

4556
- name: Create SOPT package
4657
run : |
47-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
48-
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
49-
#export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH
58+
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
5059
mkdir sopt/build
5160
cd sopt/build
52-
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF
61+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dtests=OFF -Dexamples=OFF
5362
make -j$(nproc --ignore 1) install
5463
5564
- name: Configure
5665
run: |
57-
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
66+
export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
5867
mkdir -p ${{github.workspace}}/build
5968
cd ${{github.workspace}}/build
60-
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON
61-
62-
- name: Build
63-
run: |
64-
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
65-
cd ${{github.workspace}}/build
69+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON
6670
make -j$(nproc --ignore 1) install
6771
6872
- name: Deploy to GH pages

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ This documentation outlines the necessary and optional [dependencies](#dependenc
3939
- [google/benchmark](https://github.com/google/benchmark) v1.6.0: Optional - A `C++`
4040
micro-benchmarking framework only needed for benchmarks.
4141

42+
For examples on how to install dependencies on Ubuntu and MacOS, see the
43+
[cmake.yml](https://github.com/astro-informatics/purify/blob/development/.github/workflows/cmake.yml).
4244

4345
## Installing and building PURIFY
4446

cmake_files/dependencies.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ endif()
1919

2020
find_package(CFitsIO REQUIRED)
2121

22+
cmake_policy(SET CMP0167 OLD)
2223
find_package(Boost COMPONENTS system filesystem REQUIRED)
2324

2425
find_package(yaml-cpp REQUIRED)
@@ -74,6 +75,7 @@ endif()
7475

7576
# Always find open-mp, since it may be used by sopt
7677
if (openmp)
78+
cmake_policy(SET CMP0074 NEW)
7779
find_package(OpenMP)
7880
if (OPENMP_FOUND)
7981
# Set PURIFY_OPENMP to TRUE when OpenMP is both found and requested

cpp/purify/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ target_include_directories(libpurify PUBLIC
7575
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
7676
$<INSTALL_INTERFACE:include/>)
7777

78-
if (cppflow)
79-
target_link_libraries(libpurify "${TENSORFLOW_LIB}")
80-
# Make cppflow include directory public. Install interface can't point to source directory,
81-
# so it needs to be separately defined, explained in
82-
# https://stackoverflow.com/questions/25676277/cmake-target-include-directories-prints-an-error-when-i-try-to-add-the-source
83-
# Add /usr/local/include for default location of TensorFlow headers
84-
target_include_directories(libpurify PUBLIC
85-
$<BUILD_INTERFACE:${cppflow_INCLUDE_DIR}>
86-
$<BUILD_INTERFACE:/usr/local/include>
87-
$<INSTALL_INTERFACE:cppflow/include/>
88-
)
89-
endif()
90-
9178
add_include_dir(
9279
${EIGEN3_INCLUDE_DIR}
9380
${Boost_INCLUDE_DIR}
@@ -124,12 +111,6 @@ if(PURIFY_CASACORE_LOOKUP)
124111
add_dependencies(libpurify Lookup-CasaCore)
125112
endif()
126113

127-
# Add spdlog as direct dependency
128-
if(spdlog_FOUND)
129-
target_link_libraries(libpurify spdlog::spdlog)
130-
target_include_directories(libpurify SYSTEM PUBLIC ${spdlog_INCLUDE_DIR})
131-
endif()
132-
133114
install(FILES ${HEADERS} DESTINATION include/purify)
134115
install(TARGETS libpurify
135116
EXPORT PurifyTargets

cpp/purify/config.in.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include <string>
2929
#include <tuple>
30+
#include <cstdint>
3031

3132
namespace purify {
3233
//! Returns library version

0 commit comments

Comments
 (0)