Installation
Using the Conda package
A package for EDDL is available on Anaconda. You can use one of the following lines according to your needs:
conda install -c deephealth eddl-cpu
Note
Platforms supported: Linux and MacOS
conda install -c deephealth eddl-gpu
Note
Platforms supported: Linux
conda install -c deephealth eddl-cudnn
Note
Platforms supported: Linux
Using the Homebrew package
A package for EDDL is available on the homebrew package manager. You need to run both lines, one to add the tap and the other to install the library.
# Add deephealth tap
brew tap deephealthproject/homebrew-tap
# Install EDDL
brew install eddl
From source with cmake
You can also install EDDL
from source with cmake.
Note
Requirements:
C++ compiler
Anaconda
[Optional] CUDA Toolkit 10 or later (to compile for GPU)
These versions do not support GCC versions later than 8
[Optional] cuDNN to speed up training
# Download source code
git clone https://github.com/deephealthproject/eddl.git
cd eddl/
# Install dependencies
conda env create -f environment.yml
conda activate eddl
# Build and install
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
# [GPU ONLY] CUDA 10/11 does not support gcc versions later than 8.
# You *might* need to add these flags:
# -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
# -DCMAKE_C_COMPILER=$(which gcc-7) \
# -DCMAKE_CXX_COMPILER=$(which g++-7) \
make -j$(nproc) # The -j flag is to parallelize the compilation
make install
# Download source code
git clone https://github.com/deephealthproject/eddl.git
cd eddl/
# Install dependencies
conda env create -f environment.yml
conda activate eddl
# Build and install
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
make -j$(sysctl -n hw.logicalcpu) # The -j flag is to parallelize the compilation
make install
# Download source code
git clone https://github.com/deephealthproject/eddl.git
cd eddl/
# Install dependencies
conda env create -f environment.yml
conda activate eddl
# Build and install
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=%CONDA_PREFIX% -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%
cmake --build . --target install
See the Build and configuration section for more details about cmake options.
Note
1. You can ignore -DCMAKE_PREFIX_PATH
and -DCMAKE_INSTALL_PREFIX
but it is a good practice to use them
in order to avoid path conflicts.
2. To use a specific CUDA version you only need to specify the NVCC location:
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
3. CUDA 10 and 11 does not support GCC versions later than 8.
(Ubuntu 20.04 comes with GCC 9.3.0 by default, so you might need to force a lower version
with: -DCMAKE_CXX_COMPILER
)
4. If you want to distribute the resulting shared library, you should use the flag
-DBUILD_SUPERBUILD=ON
so that we can make specific tunings to our dependencies.
If you don’t want to install Anaconda, you can compile it using:
cmake .. -DBUILD_SUPERBUILD=ON -DBUILD_TARGET=CUDNN -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CXX_COMPILER=/usr/bin/g++-7
To update/remote the eddl environment type:
# Update existing environment
conda env update --file environment.yml --prune
# Remove environment
conda remove --name eddl --all
Including EDDL in your project
The different packages of EDDL
are built with cmake, so whatever the
installation mode you choose, you can add EDDL
to your project using cmake:
find_package(eddl REQUIRED)
target_link_libraries(your_target PUBLIC EDDL::eddl)
Note
After find_package
, you can access library components with theses variables:
EDDL_ROOT
, EDDL_INCLUDE_DIR
, EDDL_LIBRARIES_DIR
and EDDL_LIBRARIES
.