Repository navigation
Closed
Labels
kind: bugplatform: iccrelated to Intel compilerrelated to Intel compilerrelease item: 🔨 further changesolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Milestone
Description
I would like to compile with the Intel C++ compiler, in particular this one
$ icpc --version
icpc (ICC) 17.0.2 20170213
Copyright (C) 1985-2017 Intel Corporation. All rights reserved.But currently this results in
...json.hpp(67): error: #error directive: "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"When I remove the checks, I'm able to successfully compile and run. Compiling with -Wall -Wextra -pendantic only results in the following warnings
/home/tdegeus/prog/research/avalanches_inertia/json/json.hpp(6323): warning #186: pointless comparison of unsigned integer with zero
return ((0 <= u and u <= 127) ? 0
^
detected during:
instantiation of "std::size_t={unsigned long} nlohmann::detail::serializer<BasicJsonType>::extra_space(const nlohmann::detail::serializer<BasicJsonType>::string_t &, bool) [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>]" at line 6500
instantiation of "void nlohmann::detail::serializer<BasicJsonType>::dump_escaped(const nlohmann::detail::serializer<BasicJsonType>::string_t &, bool) const [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>]" at line 6154
instantiation of "void nlohmann::detail::serializer<BasicJsonType>::dump(const BasicJsonType &, bool, bool, unsigned int, unsigned int) [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>]" at line 8995
instantiation of "nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::string_t nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::dump(int, char, bool) const [with ObjectType=std::map, ArrayType=std::vector, StringType=std::string, BooleanType=bool,
NumberIntegerType=int64_t={long}, NumberUnsignedType=uint64_t={unsigned long}, NumberFloatType=double, AllocatorType=std::allocator, JSONSerializer=nlohmann::adl_serializer]" at line 14653
/home/tdegeus/prog/research/avalanches_inertia/json/json.hpp(6663): warning #186: pointless comparison of unsigned integer with zero
const bool is_negative = x < 0;
^
detected during:
instantiation of "void nlohmann::detail::serializer<BasicJsonType>::dump_integer(NumberType) [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>, NumberType=uint64_t={unsigned long}, <unnamed>=0]" at line 6290
instantiation of "void nlohmann::detail::serializer<BasicJsonType>::dump(const BasicJsonType &, bool, bool, unsigned int, unsigned int) [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>]" at line 8995
instantiation of "nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::string_t nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::dump(int, char, bool) const [with ObjectType=std::map, ArrayType=std::vector, StringType=std::string, BooleanType=bool,
NumberIntegerType=int64_t={long}, NumberUnsignedType=uint64_t={unsigned long}, NumberFloatType=double, AllocatorType=std::allocator, JSONSerializer=nlohmann::adl_serializer]" at line 14653
/home/tdegeus/prog/research/avalanches_inertia/json/json.hpp(9762): warning #191: type qualifier is meaningless on cast type
return get_impl_ptr(static_cast<const PointerType>(nullptr));
^
detected during:
instantiation of "void nlohmann::detail::get_arithmetic_value(const BasicJsonType &, ArithmeticType &) [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>, ArithmeticType=double, <unnamed>=0]" at line 1133
instantiation of "void nlohmann::detail::from_json(const BasicJsonType &, BasicJsonType::number_float_t &) [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>]" at line 1368
instantiation of "auto nlohmann::detail::from_json_fn::call(const BasicJsonType &, T &, nlohmann::detail::priority_tag<1U>) const->decltype((<expression>)) [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>, T=double]" at line 1383
instantiation of "void nlohmann::detail::from_json_fn::operator()(const BasicJsonType &, T &) const [with BasicJsonType=nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer>, T=double]" at line 6880
instantiation of "void nlohmann::adl_serializer<<unnamed>, <unnamed>>::from_json(BasicJsonType &&, ValueType &) [with <unnamed>=double, <unnamed>=void, BasicJsonType=const nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t={long}, uint64_t={unsigned long}, double, std::allocator, nlohmann::adl_serializer> &, ValueType=double]" at line 9592
instantiation of "ValueType nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::get<ValueTypeCV,ValueType,<unnamed>>() const [with ObjectType=std::map, ArrayType=std::vector, StringType=std::string, BooleanType=bool, NumberIntegerType=int64_t={long}, NumberUnsignedType=uint64_t={unsigned long}, NumberFloatType=double, AllocatorType=std::allocator,
JSONSerializer=nlohmann::adl_serializer, ValueTypeCV=double, ValueType=double, <unnamed>=0]" at line 237 of "/home/tdegeus/prog/research/avalanches_inertia/main.cpp"
remark #11074: Inlining inhibited by limit max-size
remark #11074: Inlining inhibited by limit max-total-size
remark #11076: To get full report use -qopt-report=4 -qopt-report-phase ipoMetadata
Metadata
Assignees
Labels
kind: bugplatform: iccrelated to Intel compilerrelated to Intel compilerrelease item: 🔨 further changesolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Activity
nlohmann commentedon Sep 29, 2017
Thanks for reporting! I shall have a look at the warnings.
Apparently, we seem to "recognize" a GCC here. Could you please post the output of the
json::meta()function? If the Intel Compiler is correctly recognized there, I may have an idea how to fix the compiler detection above.tdegeus commentedon Sep 29, 2017
Here is the output of
json::meta():{ "compiler": { "c++": "201103", "family": "icc", "version": 1700 }, "copyright": "(C) 2013-2017 Niels Lohmann", "name": "JSON for Modern C++", "platform": "linux", "url": "https://github.com/nlohmann/json", "version": { "major": 2, "minor": 1, "patch": 1, "string": "2.1.1" } }nlohmann commentedon Sep 29, 2017
Thanks! I shall have a look. I maybe just need to exclude ICC from the GCC version check.
By the way: do you know whether there is a free version of ICC so that I could use it in the CI test suite?
tdegeus commentedon Sep 29, 2017
Yes, there are 'free' versions for students, academic researchers, and open-source developers.
🚨 removing compiler warnings #755
nlohmann commentedon Oct 2, 2017
@tdegeus All but 1 warnings should be gone now. I tried to fix the last one, but ran into a compiler issue, see #761. Could you try the latest
developversion please?tdegeus commentedon Oct 2, 2017
@nlohmann Great, thanks! I have compiled with the latest
developversion. It works. As predicted the only compiler warning that remains isnlohmann commentedon Oct 2, 2017
Meanwhile, I tried to get ICC running on Travis (see https://travis-ci.org/nlohmann/json/jobs/282297971), but it fails to compile so far. Maybe someone has an idea how to fix this.
gregmarr commentedon Oct 2, 2017
Maybe this would help:
🚨 removing a compiler warning #755
nlohmann commentedon Oct 2, 2017
@gregmarr Thanks!
6 remaining items
🚨 fixing last warning in #755
nlohmann commentedon Oct 4, 2017
Thanks everybody!
kaidokert commentedon Jan 19, 2018
Just FYI, gcc-5.2 reports on this:
zakalibit commentedon Aug 29, 2018
I changed to this and it makes compiler happy
const bool is_negative = !(x>=0);
🚨 fixed a compilation issue with ICPC #755
🚨 fixed a compilation issue with ICPC #755
TedLyngmo commentedon Nov 21, 2018
Hi! I still have this issue (although with an old unsupported clang 3.3.1 based compiler) but I managed to remove the warning by creating these templates:
and in
dump_integer(NumberType x):I don't know exactly where to put these templates to make a proper pull request. Right now I just put them above
dump_integer()to try it out.Would a change like this break something else? If not, can someone help me to find the proper place for the templates and I'll make a pull request out of it.