You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this will install `conda build` environment and compiles C/C++ and Python wrappers and performs basic tests for environment with python 3.10 and numpy 1.24.
11
15
12
16
### CMake
17
+
13
18
If you want to build directly using cmake, install CMake (v.>=3) to configure it. Additionally you will need a C compiler, `make` (on linux) and CUDA SDK where available. The toolkit may be used directly from C/C++ as it is compiled as a shared library (check-out the include files in `Core` for this)
19
+
14
20
1. Clone this repository to a directory, i.e. `CCPi-Regularisation-Toolkit`,
15
21
2. create a build directory.
16
22
3. Issue `cmake` to configure (or `cmake-gui`, or `ccmake`, or `cmake3`). Use additional flags to fine tune the configuration.
@@ -22,35 +28,35 @@ Flags used during configuration
22
28
|`BUILD_PYTHON_WRAPPER`| bool |`ON\|OFF` whether to build the Python wrapper |
23
29
|`BUILD_MATLAB_WRAPPER`| bool |`ON\|OFF` whether to build the Matlab wrapper |
24
30
|`CMAKE_INSTALL_PREFIX`| path | your favourite install directory |
conda install -c file://${CONDA_PREFIX}/conda-bld/ ccpi-regulariser=${CIL_VERSION} --force-reinstall # try this one
@@ -60,25 +66,38 @@ python demo_gpu_regularisers.py # to run GPU demo
60
66
```
61
67
62
68
### Python (GPU-CuPy)
63
-
One can also use some of the GPU modules directly (i.e. without the need of building the package) by using [CuPy](https://docs.cupy.dev/en/stable/index.html) implementations.
69
+
70
+
One can also use some of the GPU modules directly (i.e. without the need of building the package) by using [CuPy](https://docs.cupy.dev) implementations.
> The above currently doesn't work; see **Python build** below instead:
69
78
70
79
#### Python build
71
-
If passed `CONDA_BUILD=ON` the software will be installed by issuing `python setup.py install` which will install in the system python (or whichever other python it's been picked up by CMake at configuration time.)
72
-
If passed `CONDA_BUILD=OFF` the software will be installed in the directory pointed by `${PYTHON_DEST_DIR}` which defaults to `${CMAKE_INSTALL_PREFIX}/python`. Therefore this directory should be added to the `PYTHONPATH`.
73
80
74
-
If Python is not picked by CMake you can provide the additional flag to CMake `-DPYTHON_EXECUTABLE=/path/to/python/executable`.
81
+
If passed `BUILD_PYTHON_WRAPPER=ON`, CMake will install libraries in-place under `./src/Python`, followed by running `python -m pip install ./src/Python`.
82
+
(Note that libraries are also installed under the user-specified `${CMAKE_INSTALL_PREFIX}`, which could be set to a throwaway directory, e.g. `-DCMAKE_INSTALL_PREFIX=./install`).
83
+
84
+
If Python is not picked by CMake you can provide the additional flag to CMake `-DPYTHON_EXECUTABLE=/path/to/executable/python`.
### MultiGPU capability (to use in Python with mpi4py)
93
+
77
94
The toolkit can be used by running in parallel across multiple GPU devices on a PC or a compute node of a cluster. In order to initiate a parallel run on your GPUs you will need an MPI library, such as, [mpi4py](https://mpi4py.readthedocs.io/en/stable/). See multi_gpu demo script in demos folder, it can be run as
78
-
```
95
+
96
+
```sh
79
97
mpirun -np 2 python multi_gpu.py -g -s -gpus 2
80
98
```
81
-
where `-np` parameter defines the total number of processes and `-gpus` defines the number of available GPUs.
99
+
100
+
where `-np` parameter defines the total number of processes and `-gpus` defines the number of available GPUs.
82
101
83
102
### Matlab
84
103
@@ -87,23 +106,27 @@ Matlab wrapper will install in the `${MATLAB_DEST_DIR}` directory, which default
87
106
If Matlab is not picked by CMake, you could add `-DMatlab_ROOT_DIR=<Matlab directory>`.
88
107
89
108
#### Linux
109
+
90
110
Because you've installed the modules in `<your favourite install directory>` you need to instruct Matlab to look in those directories:
0 commit comments