Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ Software developed at the [CosmoStat](https://www.cosmostat.org/) lab at [CEA](h

## Basic installation

This package has an option to install [Sparse2D](https://github.com/CosmoStat/Sparse2D) as a backend (disabled by default).

The package can be installed with `pip` as follows.

```bash
python -m pip install .
```

To install the Sparse2D backend along with the package installation, run:
```bash
BUILD_SPARSE2D=ON python -m pip install .
```

### Requirements

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

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

```bash
sudo apt-get update
sudo apt-get install -y libarmadillo-dev libcfitsio-dev libfftw3-dev libgsl-dev libhealpix-cxx-dev pkg-config
sudo apt-get install -y libarmadillo-dev libcfitsio-dev cmake libfftw3-dev libgsl-dev libhealpix-cxx-dev pkg-config build-essential
```

## Docker installation
Expand Down
12 changes: 10 additions & 2 deletions src/cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@ message(STATUS "Python binding install path : ${Python_EXECUTABLE}")
get_filename_component(SPARSE2D_INSTALL_DIR ${Python_EXECUTABLE} DIRECTORY)
message(STATUS "Binary install path : ${SPARSE2D_INSTALL_DIR}")

# Build Sparse2D
include(BuildSparse2D)
# Build Sparse2D (optionally)
if (DEFINED ENV{BUILD_SPARSE2D})
set(BUILD_SPARSE2D $ENV{BUILD_SPARSE2D})
else()
set(BUILD_SPARSE2D OFF)
endif()

if (BUILD_SPARSE2D)
include(BuildSparse2D)
endif()