Skip to content
Draft
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
50 changes: 18 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,51 +125,37 @@ Jupyter Notebooks usage examples without any local installation are provided in
In case of development it is useful to be able to build the software directly. You should clone this repository as

```sh
git clone --recurse-submodule [email protected]:TomographicImaging/CIL
```

The use of `--recurse-submodule` is necessary if the user wants the examples data to be fetched (they are needed by the unit tests). We have moved such data, previously hosted in this repo at `Wrappers/Python/data` to the [CIL-data](https://github.com/TomographicImaging/CIL-Data) repository and linked it to this one as submodule. If the data is not available it can be fetched in an already cloned repository as

```sh
git submodule update --init --recursive
git clone [email protected]:TomographicImaging/CIL
```

### Building with `pip`

#### Install Dependencies

To create a conda environment with all the dependencies for building CIL run the following shell script:

```sh
bash ./scripts/create_local_env_for_cil_development.sh
```

Or with the CIL build and test dependencies:

```sh
bash ./scripts/create_local_env_for_cil_development.sh -t
```
We suggest creating a conda environment with all the dependencies for building CIL running the following shell script depending on operating system:

And then install CIL in to this environment using `pip`.
| OS | Command | Status |
|----|----|----|
| Linux | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`| Tested |
| Windows | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development.yml`| Tested |
| MacOS (ARM) | `conda env create -f https://tomographicimaging.github.io/scripts/env/cil_development_osx.yml`| Experimental |

Alternatively, one can use the `scripts/requirements-test.yml` to create a conda environment with all the
appropriate dependencies, using the following command:
> [!NOTE]
> Currently only Linux and Windows are tested and supported. The support on MacOS (ARM) is experimental and certain features are not available/working, such as FFT filtering for FDK.

```sh
conda env create -f ./scripts/requirements-test.yml
```
or, on windows:
```sh
conda env create -f ./scripts/requirements-test-windows.yml
```

#### Build CIL

A C++ compiler is required to build the source code. Let's suppose that the user is in the source directory, then the following commands should work:

```sh
pip install --no-deps .
```

| OS | Build Command |
|----|----|
| Linux | `pip install --no-deps . -Ccmake.define.IPP_ROOT=$CONDA_PREFIX`|
| Windows | `pip install --no-deps . -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%`|

> [!NOTE]
> You need to have a **working compiler** on your system, such as Visual Studio on Windows, GCC on Linux and XCode on MacOS.

If not installing inside a conda environment, then the user might need to set the locations of optional libraries:

Expand All @@ -188,7 +174,7 @@ docker build . -t ghcr.io/tomographicimaging/cil

### Testing

One installed, CIL functionality can be tested using the following command:
Once installed, CIL functionality can be tested using the following command:

```sh
export TESTS_FORCE_GPU=1 # optional, makes GPU test failures noisy
Expand Down
2 changes: 1 addition & 1 deletion recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL=%PKG_VERSION%
if not "%GIT_DESCRIBE_NUMBER%"=="0" (
set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL=%PKG_VERSION%.dev%GIT_DESCRIBE_NUMBER%+%GIT_DESCRIBE_HASH%
)
pip install . --no-deps
pip install . --no-deps -Ccmake.define.IPP_ROOT=%CONDA_PREFIX%
if errorlevel 1 exit 1
4 changes: 2 additions & 2 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ if test $(python -c "from __future__ import print_function; import platform; pri
echo "Darwin"
extra_args="$extra_args -DOPENMP_LIBRARIES=${CONDA_PREFIX}/lib -DOPENMP_INCLUDES=${CONDA_PREFIX}/include"
else
echo "something else"
echo "Not Darwin"
fi

export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL="${PKG_VERSION}"
if test "${GIT_DESCRIBE_NUMBER}" != "0"; then
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CIL="${PKG_VERSION}.dev${GIT_DESCRIBE_NUMBER}+${GIT_DESCRIBE_HASH}"
fi
pip install . --no-deps -Ccmake.args="${extra_args}"
pip install . --no-deps -Ccmake.args="${extra_args}" -Ccmake.define.IPP_ROOT=${CONDA_PREFIX}
Loading