The nlohmann-json package provides a header-only in-memory JSON and interface library for C++. The package is simply called “json”, but most refer to it as “nlohmann json” to reduce ambiguity, and is done so here.
Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.
Download (HTTP): https://github.com/nlohmann/json/archive/v3.12.0/json-3.12.0.tar.gz
Download MD5 sum: c2528c3e04faccaaee44f1f8f3d30d99
Download size: 9.3 MB
Estimated disk space required: 21 MB (add 477 MB for tests)
Estimated build time: less than 0.1 SBU (add 5.8 SBU for tests)
Install nlohmann-json by running the following commands:
mkdir build &&
cd build &&
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D JSON_BuildTests=OFF \
-G Ninja ..
If you removed the -D
JSON_BuildTests=OFF parameter, run the test suite by
issuing ninja && ninja
test. 4 tests are known to fail which fetch
contents, but they require that a Git repository for the project is
set up.
Now, as the root user:
ninja install
-D JSON_BuildTests=OFF:
This parameter disables building tests, as they can take a while to
build. Remove this option if you want to run the test suite.