Skip to content

Compiling with icpc #755

Closed
Closed
@tdegeus

Description

@tdegeus

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 ipo

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions