Skip to content

Commit 3bc4165

Browse files
committed
remove Conan support
1 parent bb6aacc commit 3bc4165

File tree

4 files changed

+79
-304
lines changed

4 files changed

+79
-304
lines changed

.github/workflows/cmake.yml

Lines changed: 24 additions & 33 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:
@@ -49,11 +46,11 @@ jobs:
4946
- g++-11
5047
- clang++
5148
mpi:
52-
- "on"
53-
- "off"
49+
- "ON"
50+
- "OFF"
5451
omp:
55-
- "on"
56-
- "off"
52+
- "ON"
53+
- "OFF"
5754
exclude:
5855
- cc: gcc-11
5956
cxx: clang++
@@ -93,34 +90,22 @@ jobs:
9390
if: ${{ contains(matrix.os, 'ubuntu') }}
9491
run: |
9592
sudo apt update
96-
sudo apt install openmpi-bin libopenmpi-dev ccache casacore-dev
97-
pip install conan
93+
sudo apt install openmpi-bin libopenmpi-dev ccache libyaml-cpp-dev ccache libeigen3-dev libtiff-dev
94+
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
95+
mkdir Catch2/build
96+
cd Catch2/build
97+
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD}
98+
make -j$(nproc --ignore 1) install
99+
cd -
98100
99101
- name: Install Dependencies on MacOS
100102
if: ${{ contains(matrix.os, 'macos') }}
101103
run: |
102-
brew install gcc libtiff open-mpi libomp libyaml ccache conan
104+
brew install gcc libtiff open-mpi libomp eigen libyaml ccache catch2
103105
echo "CMAKE_PREFIX_PATH=/opt/homebrew/opt/libomp" >> $GITHUB_ENV
104106
echo "/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH
105107
106-
- name: Install Tensorflow API on Ubuntu
107-
# TODO could this be combined with mac version somehow? if/else?
108-
if: ${{ contains(matrix.os, 'ubuntu') }}
109-
uses: UCL/install-tensorflow-action@main
110-
with:
111-
version: 2.11.0
112-
os: linux
113-
114-
- name: Install Tensorflow API on MacOS
115-
if: ${{ contains(matrix.os, 'macos') }}
116-
uses: UCL/install-tensorflow-action@main
117-
with:
118-
version: 2.11.0
119-
os: darwin
120-
121108
- name: Select Python 3.10
122-
# otherwise turtlebrowser/get-conan@v1.1 fails on macos-12
123-
# ref: https://github.com/turtlebrowser/get-conan/issues/4
124109
uses: actions/setup-python@v4
125110
with:
126111
python-version: '3.10'
@@ -147,15 +132,21 @@ jobs:
147132

148133
- name: Build sopt
149134
run: |
150-
conan profile detect
151-
conan create ${{github.workspace}}/sopt --build missing -s compiler.cppstd=17 -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}}
152-
153-
- name: Dependencies
154-
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}}
135+
export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
136+
mkdir ${{github.workspace}}/sopt/build
137+
cd ${{github.workspace}}/sopt/build
138+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}}
139+
make -j$(nproc --ignore 1) install
155140
156141
- name: Install
157142
# Build your program with the given configuration
158-
run: conan build ${{github.workspace}} -of ${{github.workspace}}/build -s compiler.cppstd=17 -o docasa=off -o dompi=${{matrix.mpi}} -o openmp=${{matrix.omp}}
143+
run: |
144+
export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
145+
export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build
146+
mkdir ${{github.workspace}}/build
147+
cd ${{github.workspace}}/build
148+
cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}}
149+
make -j$(nproc --ignore 1) install
159150
160151
- name: Test
161152
working-directory: ${{github.workspace}}/build

.github/workflows/documentation.yml

Lines changed: 41 additions & 69 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,26 +20,20 @@ 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+
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 -
30+
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 -
4637
4738
- name: Install Tensorflow API on Ubuntu
4839
uses: UCL/install-tensorflow-action@main
@@ -59,16 +50,11 @@ jobs:
5950

6051
- name: Create cppflow package
6152
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
53+
mkdir cppflow/build
54+
cd cppflow/build
55+
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}
56+
#cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build
57+
make -j$(nproc --ignore 1) install
7258
7359
- name: Checkout SOPT
7460
uses: actions/checkout@v3
@@ -79,48 +65,34 @@ jobs:
7965

8066
- name: Create SOPT package
8167
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
68+
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
69+
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
70+
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
71+
#export CMAKE_PREFIX_PATH=${{github.workspace}}/build/lib/cmake:$CMAKE_PREFIX_PATH
72+
mkdir sopt/build
73+
cd sopt/build
74+
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddocasa=OFF -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON
75+
#cmake .. -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build -Ddompi=OFF -Dopenmp=OFF -Ddocs=OFF -Dcppflow=ON
76+
make -j$(nproc --ignore 1) install
9577
9678
- name: Configure
9779
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
80+
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
81+
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
82+
mkdir -p ${{github.workspace}}/build
83+
cd ${{github.workspace}}/build
84+
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON
10985
11086
- name: Build
11187
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
88+
export CMAKE_PREFIX_PATH=${{github.workspace}}/cppflow/build:$CMAKE_PREFIX_PATH
89+
##export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build/lib/cmake:$CMAKE_PREFIX_PATH
90+
#export CMAKE_PREFIX_PATH=${{github.workspace}}/fftw-3.3.10/build:$CMAKE_PREFIX_PATH
91+
#export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake:$CMAKE_PREFIX_PATH
92+
##export CMAKE_PREFIX_PATH=${{github.workspace}}/sopt/build:$CMAKE_PREFIX_PATH
93+
export CMAKE_PREFIX_PATH=${{github.workspace}}/build:$CMAKE_PREFIX_PATH
94+
cd ${{github.workspace}}/build
95+
make -j$(nproc --ignore 1) install
12496
12597
- name: Deploy to GH pages
12698
if: ${{github.event_name == 'push'}}

README.md

Lines changed: 14 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -14,92 +14,34 @@ This documentation outlines the necessary and optional [dependencies](#dependenc
1414

1515
## Dependencies installation
1616

17-
**PURIFY** is written in `C++11`. Required software and libraries, and their minimum supported versions, are listed below. The build system will attempt to automatically download and build the automatically included libraries. (an internet connection is required for this). Most dependencies are handled by the `conan` package manager.
17+
**PURIFY** is written in `C++11`. Required software and libraries, and their minimum supported versions, are listed below. The build system will attempt to automatically download and build the automatically included libraries. (an internet connection is required for this).
1818

1919
`C++` dependencies:
2020

21-
### User-provided libraries
22-
23-
In order to build **PURIFY**, you should have the following installed on your system.
24-
2521
- [CMake](http://www.cmake.org/) v3.5.1 A free software that allows cross-platform compilation
26-
- [conan](https://conan.io/) v2.0.11 `C/C++` package manager. **NOTE** Conan v1 is no loner supported.
2722
- [GCC](https://gcc.gnu.org) v7.3.0 GNU compiler for `C++`
2823
- [OpenMP](http://openmp.org/wp/) v4.8.4 - Optional - Speeds up some of the operations.
2924
- [MPI](https://www.open-mpi.org) v3.1.1 - Optional - Parallelisation paradigm to speed up operations.
30-
31-
### Automatically included libraries
32-
33-
The build system of **PURIFY** will attempt to download and build these additional dependencies, depending on the build options passed to `conan`. Most of them are automatically handled by `conan`.
34-
35-
- [astro-informatics/sopt](https://github.com/astro-informatics/sopt) v4.0.0: Sparse Optimization
25+
- [astro-informatics/sopt](https://github.com/astro-informatics/sopt) v4.1.0: Sparse Optimization
3626
Compressed Sensing library. Included as a submodule.
37-
- [UCL/GreatCMakeCookOff](https://github.com/UCL/GreatCMakeCookOff) Collection of `CMake` recipes.
38-
Downloaded automatically if absent.
3927
- [Boost](https://www.boost.org/) v1.78.0: A set of free peer-reviewed
40-
portable C++ libraries. Downloaded automatically by conan.
41-
- [fftw3](www.fftw.org) v3.3.9: Fastest Fourier Transform in the West. Downloaded automatically by conan.
42-
- [Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page) v3.3.7: Modern `C++` linear algebra. Downloaded automatically by conan.
43-
- [tiff](http://www.libtiff.org/) v4.0.9: Tag Image File Format library. Downloaded automatically by conan.
44-
- [cfitsio](http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html): v4.0.0: Library of `C` and `Fortran` subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format. Downloaded automatically by conan.
45-
- [yaml-cpp](https://github.com/jbeder/yaml-cpp) v0.6.3: YAML parser and emitter in `C++`. Downloaded automatically by conan.
28+
portable C++ libraries.
29+
- [fftw3](www.fftw.org) v3.3.9: Fastest Fourier Transform in the West.
30+
- [Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page) v3.3.7: Modern `C++` linear algebra.
31+
- [tiff](http://www.libtiff.org/) v4.0.9: Tag Image File Format library.
32+
- [cfitsio](http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html): v4.0.0: Library of `C` and `Fortran` subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format.
33+
- [yaml-cpp](https://github.com/jbeder/yaml-cpp) v0.6.3: YAML parser and emitter in `C++`.
4634
- [casacore](http://casacore.github.io/casacore/) - Optional - Needed to interface with measurement
35+
- [ONNXruntime](https://onnxruntime.ai/) v1.17.1 - Optional - a cross-platform runtime engine based on the Open Neural Network eXchange format.
4736
sets. The main **PURIFY** program requires this library (and its dependencies)
48-
- [spdlog](https://github.com/gabime/spdlog) v1.9.2: Optional - Logging library. Downloaded automatically by conan.
4937
- [Catch2](https://github.com/catchorg/Catch2) v2.13.9: Optional - A `C++`
50-
unit-testing framework only needed for testing. Downloaded automatically by conan.
38+
unit-testing framework only needed for testing.
5139
- [google/benchmark](https://github.com/google/benchmark) v1.6.0: Optional - A `C++`
52-
micro-benchmarking framework only needed for benchmarks. Downloaded automatically by conan.
40+
micro-benchmarking framework only needed for benchmarks.
5341

5442

5543
## Installing and building PURIFY
5644

57-
**Using Conan v2 (recommended)**
58-
59-
[Conan](https://docs.conan.io/en/latest/installation.html) is a C++ package manager that helps deal with most of the
60-
C++ dependencies as well as the **PURIFY** installation:
61-
62-
1. Once the mandatory user-provided dependencies are present,
63-
`git clone` from the [GitHub repository](https://github.com/astro-informatics/purify):
64-
65-
``` bash
66-
git clone --recurse-submodules https://github.com/astro-informatics/purify.git
67-
```
68-
1. Create a `conan` package for `sopt`
69-
70-
```bash
71-
conan create /path/to/purify/sopt/ --build missing
72-
```
73-
If you get an error about broken symlinks you can set `skip_broken_symlinks_check = True` in
74-
your `~/.conan/conan.conf` file or
75-
[set an environment variable](https://docs.conan.io/en/1.46/reference/env_vars.html#conan-skip-broken-symlinks-check)
76-
1. Then, the program can be built using `conan`:
77-
78-
``` bash
79-
cd /path/to/purify
80-
mkdir build
81-
cd build
82-
conan install .. -of . --build missing
83-
conan build .. -of .
84-
```
85-
86-
You can turn the various options on and off by adding flags to the `conan install` command, e.g.
87-
88-
```bash
89-
conan install .. -of . --build missing -o onnxrt=on -o openmp=on -o mpi=off
90-
conan build .. -of .
91-
```
92-
93-
The full list of build options can be found in the [conanfile](./conanfile.py).
94-
To install in directory `INSTALL_FOLDER`, add the following options to the conan build command:
95-
96-
``` bash
97-
conan build .. -of INSTALL_FOLDER
98-
```
99-
100-
101-
**Using CMake**
102-
10345
If the dependencies are already available on your system, you can also install **PURIFY** manually like so
10446

10547
``` bash
@@ -118,28 +60,12 @@ On MacOS, you can also install most of the dependencies with Homebrew e.g.
11860
```
11961

12062

121-
### Machine-learning models support
63+
### Machine-learning models
12264

12365
The **SOPT** library includes an interface to ONNXrt for using trained models
12466
as priors in the Forward-Backward optimization algorithm. To build **PURIFY** with
125-
ONNXrt capability, you need to enable `ONNXrt` support also in **SOPT**:
126-
127-
1. Follow the nominal build instructions, making sure you enable the `onnxrt`
128-
option when building **SOPT** ...
129-
130-
```bash
131-
conan create /path/to/purify/sopt/ --build missing -o onnxrt=on
132-
```
133-
134-
1. ... and **PURIFY**:
135-
136-
``` bash
137-
cd /path/to/purify
138-
mkdir build
139-
cd build
140-
conan install .. --build missing -o onnrt=on
141-
conan build ..
142-
```
67+
ONNXrt capability, you need to enable `ONNXrt` support also in **SOPT** using
68+
the `onnxrt` option when running the `cmake` command.
14369

14470
## Testing
14571

0 commit comments

Comments
 (0)