Bump mkdocs-material from 9.7.3 to 9.7.4 in /docs/mkdocs (#5097)
Bumps mkdocs-material from 9.7.3 to 9.7.4.
updated-dependencies:
- dependency-name: mkdocs-material dependency-version: 9.7.4 dependency-type: direct:production update-type: version-update:semver-patch …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
jsonobjects from JSON literalsDesign goals
There are myriads of JSON libraries out there, and each may even have its reason to exist. Our class had these design goals:
Intuitive syntax. In languages such as Python, JSON feels like a first-class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. Check out the examples below and you’ll know what I mean.
Trivial integration. Our whole code consists of a single header file
json.hpp. That’s it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings. The library is also included in all popular package managers.Serious testing. Our code is heavily unit-tested and covers 100% of the code, including all exceptional behavior. Furthermore, we checked with Valgrind and the Clang Sanitizers that there are no memory leaks. Google OSS-Fuzz additionally runs fuzz tests against all parsers 24/7, effectively executing billions of tests so far. To maintain high quality, the project is following the Core Infrastructure Initiative (CII) best practices. See the quality assurance overview documentation.
Other aspects were not so important to us:
Memory efficiency. Each JSON object has an overhead of one pointer (the maximal size of a union) and one enumeration element (1 byte). The default generalization uses the following C++ data types:
std::stringfor strings,int64_t,uint64_tordoublefor numbers,std::mapfor objects,std::vectorfor arrays, andboolfor Booleans. However, you can template the generalized classbasic_jsonto your needs.Speed. There are certainly faster JSON libraries out there. However, if your goal is to speed up your development by adding JSON support with a single header, then this library is the way to go. If you know how to use a
std::vectororstd::map, you are already set.See the contribution guidelines for more information.
Sponsors
You can sponsor this library at GitHub Sponsors.
🏷️ Named Sponsors
Further support
The development of the library is further supported by JetBrains by providing free access to their IDE tools.
Thanks everyone!
Support
🚧 If you want to understand the API better, check out the API Reference or have a look at the quick reference below.
🐛 If you found a bug, please check the FAQ if it is a known issue or the result of a design decision. Please also have a look at the issue list before you create a new issue. Please provide as much information as possible to help us understand and reproduce your issue.
There is also a docset for the documentation browsers Dash, Velocity, and Zeal that contains the full documentation as an offline resource.
Quick reference
Full API documentation
Examples
Here are some examples to give you an idea how to use the class.
Besides the examples below, you may want to:
→ Check the documentation
→ Browse the standalone example files
→ Read the full API Documentation with self-contained examples for every function
Read JSON from a file
The
jsonclass provides an API for manipulating a JSON value. To create ajsonobject by reading a JSON file:If using modules (enabled with
NLOHMANN_JSON_BUILD_MODULES), this example becomes:Creating
jsonobjects from JSON literalsAssume you want to hard-code this literal JSON value as a
jsonobject:There are various options:
JSON as a first-class data type
Here are some examples to give you an idea how to use the class.
Assume you want to create the JSON object
With this library, you could write:
Note that in all these cases, you never need to “tell” the compiler which JSON value type you want to use. If you want to be explicit or express some edge cases, the functions
json::array()andjson::object()will help:Serialization / Deserialization
To/from strings
You can create a JSON value (deserialization) by appending
_jsonto a string literal:Note that without appending the
_jsonsuffix, the passed string literal is not parsed, but just used as JSON string value. That is,json j = "{ \"happy\": true, \"pi\": 3.141 }"would just store the string"{ "happy": true, "pi": 3.141 }"rather than parsing the actual object.The string literal should be brought into scope with
using namespace nlohmann::literals;(seejson::parse()).The above example can also be expressed explicitly using
json::parse():You can also get a string representation of a JSON value (serialize):
Note the difference between serialization and assignment:
.dump()returns the originally stored string value.Note the library only supports UTF-8. When you store strings with different encodings in the library, calling
dump()may throw an exception unlessjson::error_handler_t::replaceorjson::error_handler_t::ignoreare used as error handlers.To/from streams (e.g., files, string streams)
You can also use streams to serialize and deserialize:
These operators work for any subclasses of
std::istreamorstd::ostream. Here is the same example with files:Please note that setting the exception bit for
failbitis inappropriate for this use case. It will result in program termination due to thenoexceptspecifier in use.Read from iterator range
You can also parse JSON from an iterator range; that is, from any container accessible by iterators whose
value_typeis an integral type of 1, 2, or 4 bytes, which will be interpreted as UTF-8, UTF-16, and UTF-32 respectively. For instance, astd::vector<std::uint8_t>, or astd::list<std::uint16_t>:You may leave the iterators for the range [begin, end):
Custom data source
Since the parse function accepts arbitrary iterator ranges, you can provide your own data sources by implementing the
LegacyInputIteratorconcept.SAX interface
The library uses a SAX-like interface with the following functions:
The return value of each function determines whether parsing should proceed.
To implement your own SAX handler, proceed as follows:
nlohmann::json_sax<json>as base class, but you can also use any class where the functions described above are implemented and public.my_sax.bool json::sax_parse(input, &my_sax); where the first parameter can be any input like a string or an input stream and the second parameter is a pointer to your SAX interface.Note the
sax_parsefunction only returns aboolindicating the result of the last executed SAX event. It does not return ajsonvalue - it is up to you to decide what to do with the SAX events. Furthermore, no exceptions are thrown in case of a parse error – it is up to you what to do with the exception object passed to yourparse_errorimplementation. Internally, the SAX interface is used for the DOM parser (classjson_sax_dom_parser) as well as the acceptor (json_sax_acceptor), see filejson_sax.hpp.STL-like access
We designed the JSON class to behave just like an STL container. In fact, it satisfies the ReversibleContainer requirement.
Conversion from STL containers
Any sequence container (
std::array,std::vector,std::deque,std::forward_list,std::list) whose values can be used to construct JSON values (e.g., integers, floating point numbers, Booleans, string types, or again STL containers described in this section) can be used to create a JSON array. The same holds for similar associative containers (std::set,std::multiset,std::unordered_set,std::unordered_multiset), but in these cases the order of the elements of the array depends on how the elements are ordered in the respective STL container.Likewise, any associative key-value containers (
std::map,std::multimap,std::unordered_map,std::unordered_multimap) whose keys can construct anstd::stringand whose values can be used to construct JSON values (see examples above) can be used to create a JSON object. Note that in case of multimaps, only one key is used in the JSON object and the value depends on the internal order of the STL container.JSON Pointer and JSON Patch
The library supports JSON Pointer (RFC 6901) as an alternative means to address structured values. On top of this, JSON Patch (RFC 6902) allows describing differences between two JSON values – effectively allowing patch and diff operations known from Unix.
JSON Merge Patch
The library supports JSON Merge Patch (RFC 7386) as a patch format. Instead of using JSON Pointer (see above) to specify values to be manipulated, it describes the changes using a syntax that closely mimics the document being modified.
Implicit conversions
Supported types can be implicitly converted to JSON values.
It is recommended to NOT USE implicit conversions FROM a JSON value. You can find more details about this recommendation here. You can switch off implicit conversions by defining
JSON_USE_IMPLICIT_CONVERSIONSto0before including thejson.hppheader. When using CMake, you can also achieve this by setting the optionJSON_ImplicitConversionstoOFF.Note that
chartypes are not automatically converted to JSON strings, but to integer numbers. A conversion to a string must be specified explicitly:Arbitrary types conversions
Every type can be serialized in JSON, not just STL containers and scalar types. Usually, you would do something along those lines:
It works, but that’s quite a lot of boilerplate… Fortunately, there’s a better way:
Basic usage
To make this work with one of your types, you only need to provide two functions:
That’s all! When calling the
jsonconstructor with your type, your customto_jsonmethod will be automatically called. Likewise, when callingget<your_type>()orget_to(your_type&), thefrom_jsonmethod will be called.Some important things:
ns, wherepersonis defined).get<your_type>(),your_typeMUST be DefaultConstructible. (There is a way to bypass this requirement described later.)from_json, use functionat()to access the object values rather thanoperator[]. In case a key does not exist,atthrows an exception that you can handle, whereasoperator[]exhibits undefined behavior.std::vector: the library already implements these.Simplify your life with macros
If you just want to serialize/deserialize some structs, the
to_json/from_jsonfunctions can be a lot of boilerplate. There are several macros to make your life easier as long as you (1) want to use a JSON object as serialization and (2) want to use the member variable names as object keys in that object.Which macro to choose depends on whether private member variables need to be accessed, a deserialization is needed, missing values should yield an error or should be replaced by default values, and if derived classes are used. See this overview to choose the right one for your use case.
Example usage of macros
The
to_json/from_jsonfunctions for thepersonstruct above can be created withNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE. In all macros, the first parameter is the name of the class/struct, and all remaining parameters name the members.Here is another example with private members, where
NLOHMANN_DEFINE_TYPE_INTRUSIVEis needed:How do I convert third-party types?
This requires a bit more advanced technique. But first, let’s see how this conversion mechanism works:
The library uses JSON Serializers to convert types to JSON. The default serializer for
nlohmann::jsonisnlohmann::adl_serializer(ADL means Argument-Dependent Lookup).It is implemented like this (simplified):
This serializer works fine when you have control over the type’s namespace. However, what about
boost::optionalorstd::filesystem::path(C++17)? Hijacking theboostnamespace is pretty bad, and it’s illegal to add something other than template specializations tostd…To solve this, you need to add a specialization of
adl_serializerto thenlohmannnamespace, here’s an example:How can I use
get()for non-default constructible/non-copyable types?There is a way if your type is MoveConstructible. You will need to specialize the
adl_serializeras well, but with a specialfrom_jsonoverload:Can I write my own serializer? (Advanced use)
Yes. You might want to take a look at
unit-udt.cppin the test suite, to see a few examples.If you write your own serializer, you’ll need to do a few things:
basic_jsonalias thannlohmann::json(the last template parameter ofbasic_jsonis theJSONSerializer)basic_jsonalias (or a template parameter) in all yourto_json/from_jsonmethodsnlohmann::to_jsonandnlohmann::from_jsonwhen you need ADLHere is an example, without simplifications, that only accepts types with a size <= 32, and uses ADL.
Be very careful when reimplementing your serializer, you can stack overflow if you don’t pay attention:
Specializing enum conversion
By default, enum values are serialized to JSON as integers. In some cases, this could result in undesired behavior. If an enum is modified or re-ordered after data has been serialized to JSON, the later deserialized JSON data may be undefined or a different enum value than was originally intended.
It is possible to more precisely specify how a given enum is mapped to and from JSON as shown below:
The
NLOHMANN_JSON_SERIALIZE_ENUM()macro declares a set ofto_json()/from_json()functions for typeTaskStatewhile avoiding repetition and boilerplate serialization code.Usage:
Just as in Arbitrary Type Conversions above,
NLOHMANN_JSON_SERIALIZE_ENUM()MUST be declared in your enum type’s namespace (which can be the global namespace), or the library will not be able to locate it, and it will default to integer serialization.Other Important points:
get<ENUM_TYPE>(), undefined JSON values will default to the first pair specified in your map. Select this default pair carefully.Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)
Though JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports BSON (Binary JSON), CBOR (Concise Binary Object Representation), MessagePack, UBJSON (Universal Binary JSON Specification) and BJData (Binary JData) to efficiently encode JSON values to byte vectors and to decode such vectors.
The library also supports binary types from BSON, CBOR (byte strings), and MessagePack (bin, ext, fixext). They are stored by default as
std::vector<std::uint8_t>to be processed outside the library.Customers
The library is used in multiple projects, applications, operating systems, etc. The list below is not exhaustive, but the result of an internet search. If you know further customers of the library, please let me know, see contact.
Supported compilers
Though it’s 2026 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work:
I would be happy to learn about other compilers/versions.
Please note:
GCC 4.8 has a bug 57824: multiline raw strings cannot be the arguments to macros. Don’t use multiline raw strings directly in macros with this compiler.
Android defaults to using very old compilers and C++ libraries. To fix this, add the following to your
Application.mk. This will switch to the LLVM C++ library, the Clang compiler, and enable C++11 and other features disabled by default.The code compiles successfully with Android NDK, Revision 9 - 11 (and possibly later) and CrystaX’s Android NDK version 10.
For GCC running on MinGW or Android SDK, the error
'to_string' is not a member of 'std'(or similarly, forstrtodorstrtof) may occur. Note this is not an issue with the code, but rather with the compiler itself. On Android, see above to build with a newer environment. For MinGW, please refer to this site and this discussion for information on how to fix this bug. For Android NDK usingAPP_STL := gnustl_static, please refer to this discussion.Unsupported versions of GCC and Clang are rejected by
#errordirectives. This can be switched off by definingJSON_SKIP_UNSUPPORTED_COMPILER_CHECK. Note that you can expect no support in this case.See the page quality assurance on the compilers used to check the library in the CI.
Integration
json.hppis the single required file insingle_include/nlohmannor released here. You need to addto the files you want to process JSON and set the necessary switches to enable C++11 (e.g.,
-std=c++11for GCC and Clang).You can further use file
include/nlohmann/json_fwd.hppfor forward-declarations. The installation ofjson_fwd.hpp(as part of cmake’s install step) can be achieved by setting-DJSON_MultipleHeaders=ON.CMake
You can also use the
nlohmann_json::nlohmann_jsoninterface target in CMake. This target populates the appropriate usage requirements forINTERFACE_INCLUDE_DIRECTORIESto point to the appropriate include directories andINTERFACE_COMPILE_FEATURESfor the necessary C++11 flags.External
To use this library from a CMake project, you can locate it directly with
find_package()and use the namespaced imported target from the generated package configuration:The package configuration file,
nlohmann_jsonConfig.cmake, can be used either from an install tree or directly out of the build tree.Embedded
To embed the library directly into an existing CMake project, place the entire source tree in a subdirectory and call
add_subdirectory()in yourCMakeLists.txtfile:Embedded (FetchContent)
Since CMake v3.11, FetchContent can be used to automatically download a release as a dependency at configure time.
Example:
Note: It is recommended to use the URL approach described above, which is supported as of version 3.10.0. See https://json.nlohmann.me/integration/cmake/#fetchcontent for more information.
Supporting Both
To allow your project to support either an externally supplied or an embedded JSON library, you can use a pattern akin to the following:
thirdparty/nlohmann_jsonis then a complete copy of this source tree.Package Managers
Use your favorite package manager to use the library.
nlohmann-jsonnlohmann_jsonnlohmann_jsonnlohmann_jsonnlohmann-jsonnlohmann_jsonnlohmann-jsonnlohmann/jsonnlohmann/jsonnlohmann.jsonnlohmann_jsonnlohmann-jsongh:nlohmann/jsonnlohmann_jsonThe library is part of many package managers. See the documentation for detailed descriptions and examples.
Pkg-config
If you are using bare Makefiles, you can use
pkg-configto generate the include flags that point to where the library is installed:License
The class is licensed under the MIT License:
Copyright © 2013-2026 Niels Lohmann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The library is compliant to version 3.3 of the REUSE specification:
LICENSESfolder..reuse/dep5contains an overview of all files’ copyrights and licenses.pipx run reuse lintto verify the project’s REUSE compliance andpipx run reuse spdxto generate a SPDX SBOM.Contact
If you have questions regarding the library, I would like to invite you to open an issue at GitHub. Please describe your request, problem, or question as detailed as possible, and also mention the version of the library you are using as well as the version of your compiler and operating system. Opening an issue at GitHub allows other users and contributors to this library to collaborate. For instance, I have little experience with MSVC, and most issues in this regard have been solved by a growing community. If you have a look at the closed issues, you will see that we react quite timely in most cases.
Only if your request would contain confidential information, please send me an email. For encrypted messages, please use this key.
Security
Commits by Niels Lohmann and releases are signed with this PGP Key.
Thanks
I deeply appreciate the help of the following people.
parse()to accept an rvalue reference.get_ref()function to get a reference to stored values.has_mapped_typefunction.int64_tanduint64_t.std::multiset.dump()function.std::locale::classic()to avoid too much locale joggling, found some nice performance improvements in the parser, improved the benchmarking code, and realized locale-independent number parsing and printing.nullptrs.-Weffc++warnings.std::min.<iostream>with<iosfwd>.find()andcount()..natvisfor the MSVC debug view.std::stringstream.items()function.JSON_INTERNAL_CATCHto control the exception handling inside the library.find_packagewithout installing the library.NLOHMANN_JSON_SERIALIZE_ENUMmacro to quickly define an enum/JSON mapping.FILE*.operator/for JSON Pointers.contains()function.push_back()andpop_back()for JSON Pointers.to_stringmethod.containsfunction.json_pointer::back.items()function work with custom string types.std::pairandstd::tupletojson.FetchContent.NLOHMANN_DEFINE_TYPE_NON_INTRUSIVEinline.NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE/NLOHMANN_DEFINE_TYPE_INTRUSIVEmacros.nlohmann::ordered_json.NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE/NLOHMANN_DEFINE_TYPE_INTRUSIVEmacros.string_viewsupport and allowed C++20 support.FetchContent.-Wfloat-equalwarnings.-Wswitch-enumwarnings.-Wextra-semi-stmt warnings.-Wunusedwarnings onJSON_DIAGNOSTICS.JSON_DIAGNOSTICS.operator[]documentation.parsedocumentation.std::string_viewsupport for object keys and made dozens of other improvements.NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULTandNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT.meta()for MSVC.std::filesystem.CHECK_THROWS_WITH_AS.<windows.h>..pcand.cmakefiles tosharedirectory.patch_inplacefunction..gitignore.std::iterator_traits.JSON_NO_ENUMto disable default enum conversions.include.ziparchive.ensure_asciito thedumpfunction.seddiscovery in the Makefile.iterator_traits.operator/=andoperator/to construct JSON pointers.get<>calls.CODEOWNERSfile.const&.NLOHMANN_DEFINE_DERIVED_TYPE_*macros.iterator_proxy_valueastd::forward_iterator.std::optional.nullptris passed toparse.EINTRset inerrno.get_numberimplementation.ONLY_SERIALIZEforNLOHMANN_DEFINE_DERIVED_TYPE_*macros.alwayslink=TrueBazel flag.NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULTwith an empty JSON instance.NLOHMANN_DEFINE_TYPEmacros to also supportordered_json.std::filesystem::pathconversion to/from UTF-8 encoded string explicit.Thanks a lot for helping out! Please let me know if I forgot someone.
Used third-party tools
The library itself consists of a single header file licensed under the MIT license. However, it is built, tested, documented, and whatnot using a lot of third-party tools and services. Thanks a lot!
Notes
Character encoding
The library supports Unicode input as follows:
std::u16stringandstd::u32stringcan be parsed, assuming UTF-16 and UTF-32 encoding, respectively. These encodings are not supported when reading from files or other input containers.\uDEAD) will yield parse errors.std::string), note that its length/size functions return the number of stored bytes rather than the number of characters or glyphs.dump()may throw an exception unlessjson::error_handler_t::replaceorjson::error_handler_t::ignoreare used as error handlers.std::wstring), you need to convert them to a UTF-8 encodedstd::stringbefore, see an example.Comments in JSON
This library does not support comments by default. It does so for three reasons:
//or/* */are allowed in JavaScript, but JSON is not JavaScript.However, you can set set parameter
ignore_commentsto true in theparsefunction to ignore//or/* */comments. Comments will then be treated as whitespace.Trailing commas
The JSON specification does not allow trailing commas in arrays and objects, and hence this library is treating them as parsing errors by default.
Like comments, you can set parameter
ignore_trailing_commasto true in theparsefunction to ignore trailing commas in arrays and objects. Note that a single comma as the only content of the array or object ([,]or{,}) is not allowed, and multiple trailing commas ([1,,]) are not allowed either.This library does not add trailing commas when serializing JSON data.
For more information, see JSON With Commas and Comments (JWCC).
Order of object keys
By default, the library does not preserve the insertion order of object elements. This is standards-compliant, as the JSON standard defines objects as “an unordered collection of zero or more name/value pairs”.
If you do want to preserve the insertion order, you can try the type
nlohmann::ordered_json. Alternatively, you can use a more sophisticated ordered map liketsl::ordered_map(integration) ornlohmann::fifo_map(integration).See the documentation on object order for more information.
Memory Release
We checked with Valgrind and the Address Sanitizer (ASAN) that there are no memory leaks.
If you find that a parsing program with this library does not release memory, please consider the following case, and it may be unrelated to this library.
Your program is compiled with glibc. There is a tunable threshold that glibc uses to decide whether to actually return memory to the system or whether to cache it for later reuse. If in your program you make lots of small allocations and those small allocations are not a contiguous block and are presumably below the threshold, then they will not get returned to the OS. Here is a related issue #1924.
Further notes
NDEBUG, see the documentation ofassert. In particular, noteoperator[]implements unchecked access for const objects: If the given key is not present, the behavior is undefined (think of a dereferenced null pointer) and yields an assertion failure if assertions are switched on. If you are not sure whether an element in an object exists, use checked access with theat()function. Furthermore, you can defineJSON_ASSERT(x)to replace calls toassert(x). See the documentation on runtime assertions for more information.doublemay be used to store numbers which may yield floating-point exceptions in certain rare situations if floating-point exceptions have been unmasked in the calling code. These exceptions are not caused by the library and need to be fixed in the calling code, such as by re-masking the exceptions prior to calling library functions.-fno-rtticompiler flag.-fno-exceptionsor by defining the symbolJSON_NOEXCEPTION. In this case, exceptions are replaced byabort()calls. You can further control this behavior by definingJSON_THROW_USER(overridingthrow),JSON_TRY_USER(overridingtry), andJSON_CATCH_USER(overridingcatch). Note thatJSON_THROW_USERshould leave the current scope (e.g., by throwing or aborting), as continuing after it may yield undefined behavior. Note the explanatorywhat()string of exceptions is not available for MSVC if exceptions are disabled, see #2824. See the documentation of exceptions for more information.Execute unit tests
To compile and run the tests, you need to execute
Note that during the
cteststage, several JSON test files are downloaded from an external repository. If policies forbid downloading artifacts during testing, you can download the files yourself and pass the directory with the test files via-DJSON_TestDataDirectory=pathto CMake. Then, no Internet connectivity is required. See issue #2189 for more information.If the testdata is not found, several test suites will fail like this:
In case you have downloaded the library rather than checked out the code via Git, test
cmake_fetch_content_configurewill fail. Please executectest -LE git_requiredto skip these tests. See issue #2189 for more information.Some tests are requiring network to be properly execute. They are labeled as
git_required. Please executectest -LE git_requiredto skip these tests. See issue #4851 for more information.Some tests change the installed files and hence make the whole process not reproducible. Please execute
ctest -LE not_reproducibleto skip these tests. See issue #2324 for more information. Furthermore, assertions must be switched off to ensure reproducible builds (see discussion 4494).Note you need to call
cmake -LE "not_reproducible|git_required"to exclude both labels. See issue #2596 for more information.As Intel compilers use unsafe floating point optimization by default, the unit tests may fail. Use flag
/fp:precisethen.