diy2 does not compile using intel compiler
I'm trying to build VTK (commit 6295ff22) on linux using our intel compiler and get compiler errors when building diy2.
The errors are related to the expansion of FMT_DEPRECATED, like
<path-to-VTK>/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/fmt/core.h(478): error: identifier "parse_context" is undefined
using parse_context FMT_DEPRECATED = basic_parse_context<char>;
The FMT_DEPRECATED macro is defined as
#ifndef FMT_DEPRECATED
# if (FMT_HAS_CPP_ATTRIBUTE(deprecated) && __cplusplus >= 201402L) || \
FMT_MSC_VER >= 1900
# define FMT_DEPRECATED [[deprecated]]
# else
# if defined(__GNUC__) || defined(__clang__)
# define FMT_DEPRECATED __attribute__((deprecated))
# elif FMT_MSC_VER
# define FMT_DEPRECATED __declspec(deprecated)
# else
# define FMT_DEPRECATED /* deprecated */
# endif
# endif
#endif
Our compiler version is 19.0.2.187 20190117 which has __cplusplus >= 201402L and supports the [[deprecated]] attribute, but it does not have __has_cpp_attribute (which is a C++20 feature). The FMT_DEPRECATED macro however expands to attribute((deprecated)) which causes compiler errors.
I fixed my build by using
#ifndef FMT_DEPRECATED
# if (FMT_HAS_CPP_ATTRIBUTE(deprecated) && __cplusplus >= 201402L) || \
FMT_MSC_VER >= 1900 || \
defined(__ICC)
# define FMT_DEPRECATED [[deprecated]]
# else
# if defined(__GNUC__) || defined(__clang__)
# define FMT_DEPRECATED __attribute__((deprecated))
# elif FMT_MSC_VER
# define FMT_DEPRECATED __declspec(deprecated)
# else
# define FMT_DEPRECATED /* deprecated */
# endif
# endif
#endif
but this may not work properly I suppose for older intel compilers.
@caitlin.ross Could you please have a look at this? Thanks!