Building from source
The following software is required to build csnip:
-
A C build environment (C compiler, linker, a build tool like e.g.
make
orninja
). Some of csnip’s features require at least the C11 standard. -
The cmake build system generator, at least version 3.13.
-
Optionally a C++ compiler. The C++ compiler is used to build the C++ example code.
-
Optionally Doxygen. The reference documentation is written in Doxygen.
Steps to build
Fetch a release source tarball (from github)[https://github.com/lorinder/csnip/releases]. Then extract the tarball and move into its directory. The following example is for version 0.1.
tar xzf v0.1.tar.gz
cd csnip-0.1
Then create a build subdirectory and run cmake
from within:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
Further options can be supplied to cmake to adjust the build settings. In particular,
-
-DBUILD_DOCS=ON
will enable the generation of the documentation with Doxygen. -
-DBUILD_CXX_PIECES=OFF
will disable the C++ code in csnip.
Next, build the csnip source code:
cmake --build .
Assuming everything else went fine and there are no errors, the test suite can be now run. This step is optional, but recommended.
ctest
If no errors are reported, csnip is ready to be installed:
sudo cmake --build . --target install
This will install csnip into the /usr/local
tree.