Install
Dependencies
Besides thirparties python packages, CARS depends on OTB and VLFeat
Check OTB install:
OTB environment has to be setup:
OTB applications are working. Example:
otbcli_ReadImageInfo -in some_image.tif
OTB_APPLICATION_PATH
is set.GDAL must work (gdal-config –version must be available)
Check Vlfeat install with following global environment variables:
VLFEAT_INCLUDE_DIR
: should be set with the path of thevl
folder of the VLFeat library.VLFEAT_LIBRARY
: should be set with the path of thelibvl.so
file obtained after the VLFeat library compilation.
See CARS Dockerfile example for detailed steps.
Quick install
Clone CARS source code (choose version)
$ git clone --depth 1 https://github.com/CNES/cars.git # For latest version
$ git clone --depth 1 --branch LAST_TAG https://github.com/CNES/cars.git # For latest stable version
Install CARS
$ cd cars
$ make install # Cars is installed in `venv` directory
Run CARS in virtualenv
$ source venv/bin/activate
$ source venv/bin/env_cars.sh
$ cars -h
Advanced Install
This chapter further explains the content and behavior of make install
(see the Makefile).
Virtualenv
First create a virtualenv and upgrade main pip packages.
$ virtualenv -p python venv/
$ source venv/bin/activate
$ python3 -m pip install --upgrade pip setuptools
Required python packages
CARS python package requires some python packages:
numpy, cython: They have to be installed at first, otherwise some dependencies won’t be correctly installed.
fiona, rasterio, pygdal: On some systems, they have to be installed from sources to match local GDAL version.
Here are the corresponding commands to install these requirements:
$ virtualenv -p python venv/
$ source venv/bin/activate
$ python3 -m pip install --upgrade cython numpy
$ python3 -m pip install --no-binary fiona fiona
$ python3 -m pip install --no-binary rasterio rasterio
$ python3 -m pip install pygdal=="$(gdal-config --version).*"
To manually install CARS core dense matching correlator, see the Pandora documentation.
Environment variables
The script env_cars.sh sets several environment variables impacting dask, ITK, OTB, numba and GDAL configurations.
For CARS internal OTB remote modules, the PATH
, PYTHONPATH
, LD_LIBRARY_PATH
and OTB_APPLICATION_PATH
environment variables have also to be set.
CARS manual install
Then, to install CARS:
$ cd project_root
$ pip install .
You can use pip install .[docs]
and/or pip install .[dev]
to install specific dependencies that are not required to run CARS.
Follow User guide to run and configure CARS.
CARS OTB Application Compilation
This compilation is automatically done through CARS pip install.
Nonetheless, CARS internal OTB remote modules can be built manually if needed:
$ mkdir -p project_root/build
$ cd project_root/build
$ cmake -DOTB_BUILD_MODULE_AS_STANDALONE=ON -DCMAKE_BUILD_TYPE=Release -DVLFEAT_INCLUDE_DIR=$VLFEAT_INCLUDE_DIR ../otb_remote_module
$ make