Skip to content

Commit 5515b61

Browse files
Optional backend (#30)
* update readme with dependencies * dummy to test the CI workflow * make Sparse2D backend as optional * update optional workflow * make Sparse2D optional * minor variable name change
1 parent 99cb864 commit 5515b61

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ Software developed at the [CosmoStat](https://www.cosmostat.org/) lab at [CEA](h
66

77
## Basic installation
88

9+
This package has an option to install [Sparse2D](https://github.com/CosmoStat/Sparse2D) as a backend (disabled by default).
10+
911
The package can be installed with `pip` as follows.
1012

1113
```bash
1214
python -m pip install .
15+
```
16+
17+
To install the Sparse2D backend along with the package installation, run:
18+
```bash
19+
BUILD_SPARSE2D=ON python -m pip install .
1320
```
1421

1522
### Requirements
1623

17-
This package installs [Sparse2D](https://github.com/CosmoStat/Sparse2D) as a backend, which requires the follow dependencies.
24+
[Sparse2D](https://github.com/CosmoStat/Sparse2D) requires the following dependencies.
1825

1926
- [Armadillo](https://arma.sourceforge.net/)
2027
- [BigMac](https://github.com/sfarrens/bigmac) (macOS only)
@@ -41,7 +48,7 @@ To install the package requirements on Ubuntu, it is recommended to use [apt](ht
4148

4249
```bash
4350
sudo apt-get update
44-
sudo apt-get install -y libarmadillo-dev libcfitsio-dev libfftw3-dev libgsl-dev libhealpix-cxx-dev pkg-config
51+
sudo apt-get install -y libarmadillo-dev libcfitsio-dev cmake libfftw3-dev libgsl-dev libhealpix-cxx-dev pkg-config build-essential
4552
```
4653

4754
## Docker installation

src/cxx/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,13 @@ message(STATUS "Python binding install path : ${Python_EXECUTABLE}")
2424
get_filename_component(SPARSE2D_INSTALL_DIR ${Python_EXECUTABLE} DIRECTORY)
2525
message(STATUS "Binary install path : ${SPARSE2D_INSTALL_DIR}")
2626

27-
# Build Sparse2D
28-
include(BuildSparse2D)
27+
# Build Sparse2D (optionally)
28+
if (DEFINED ENV{BUILD_SPARSE2D})
29+
set(BUILD_SPARSE2D $ENV{BUILD_SPARSE2D})
30+
else()
31+
set(BUILD_SPARSE2D OFF)
32+
endif()
33+
34+
if (BUILD_SPARSE2D)
35+
include(BuildSparse2D)
36+
endif()

0 commit comments

Comments
 (0)