Building from source¶
You need a C++14 compiler and CMake 3.24 or newer. On Linux you also need a C compiler and make.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build
cmake --install build --prefix <where>
The Python package¶
pip install . builds and installs the package in one go. It takes the
options of this page as -C cmake.define.<option>=<value>, such as
-C cmake.define.VITRIO_USE_SYSTEM_DEPENDENCIES=ON.
To build it with CMake instead, add -DVITRIO_BUILD_PYTHON=ON. This needs
Python 3.10 or newer with nanobind installed. The package ends up under
python/ in the build tree, so putting that directory on PYTHONPATH is
enough to import it.
Dependencies¶
By default CMake downloads the libraries that vitrio depends on and builds them into the vitrio library, so nothing has to be installed first.
Library |
Needed for |
Left out with |
|---|---|---|
Boost (Filesystem, Interprocess and ContainerHash) |
Everything |
|
spdlog |
Everything |
|
libtiff, and zlib for it |
TIFF and EER |
|
nlohmann/json, c-blosc, zstd and zlib |
ZARR |
|
zlib |
MRC files compressed with gzip |
|
liburing |
io_uring, on Linux |
|
Google Highway |
Vectorized conversion of half precision values |
|
Catch2 and trompeloeil |
The tests |
|
Using the libraries of the system¶
Turn VITRIO_USE_SYSTEM_DEPENDENCIES on to use the libraries installed on
the system instead. CMake then looks for each of them with find_package,
or with pkg-config for liburing, c-blosc and zstd. CMake 3.18 is enough in
this case.
The minimum versions are Boost 1.70, libtiff 4.5, spdlog 1.4, liburing 2.0, nlohmann/json 3.6, c-blosc 1.14, zstd 1.4, Highway 1.2.0 and Catch2 3.
To take a single library from the system and build the others, turn its own
option on, such as -DVITRIO_USE_SYSTEM_TIFF=ON. The options are
VITRIO_USE_SYSTEM_BOOST, VITRIO_USE_SYSTEM_SPDLOG,
VITRIO_USE_SYSTEM_TIFF, VITRIO_USE_SYSTEM_ZLIB,
VITRIO_USE_SYSTEM_LIBURING, VITRIO_USE_SYSTEM_NLOHMANN_JSON,
VITRIO_USE_SYSTEM_BLOSC, VITRIO_USE_SYSTEM_ZSTD,
VITRIO_USE_SYSTEM_HIGHWAY, VITRIO_USE_SYSTEM_CATCH2 and
VITRIO_USE_SYSTEM_TROMPELOEIL.
Building without network access¶
Give CMake the source directory of each library that it would download, such
as -DFETCHCONTENT_SOURCE_DIR_BOOST=<dir>.
Options¶
Option |
Effect |
|---|---|
|
Use the installed libraries instead of downloading and building them |
|
Skip the tests, and Catch2 and trompeloeil with them |
|
Leave TIFF and EER out, and libtiff with them |
|
Leave ZARR out, and nlohmann/json, c-blosc and zstd with it |
|
Leave out reading MRC files compressed with gzip. zlib is left out too when TIFF and ZARR are off |
|
On Linux, leave io_uring out, and liburing with it |
|
Convert half precision values with ordinary loops, and leave Highway out |
|
Compile the vector loops once, for the instruction set that the compiler flags allow. By default they are compiled once per instruction set, and the best one is chosen when the library runs |
|
The instruction sets to compile the vector loops for beyond the baseline, by their Highway names. The default is |
|
Build the Python package too |
|
Build the C++ examples of |
|
Add the target |