Closed maddanio closed 5 years ago
cmake command:
cmake .. -DMDSPAN_ENABLE_EXAMPLES=YES
Try with -DMDSPAN_CXX_STANDARD=14
or -DMDSPAN_CXX_STANDARD=17
. Basically, apple-clang
is reporting that it only supports C++11, and then providing integer_sequence
(which is a C++14 feature) anyway. I'll have to put in a workaround.
still does not work. this is the compiler command and output when using -DMDSPAN_CXX_STANDARD=17 -DMDSPAN_ENABLE_EXAMPLES=YES
:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -I../include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14 -std=gnu++1z -MD -MT examples/subspan/CMakeFiles/subspan.dir/subspan.cpp.o -MF examples/subspan/CMakeFiles/subspan.dir/subspan.cpp.o.d -o examples/subspan/CMakeFiles/subspan.dir/subspan.cpp.o -c ../examples/subspan/subspan.cpp
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
In file included from ../include/experimental/__p0009_bits/array_workaround.hpp:48:
../include/experimental/__p0009_bits/trait_backports.hpp:95:29: error: no template named 'integer_sequence' in namespace 'std'; did you mean '__integer_sequence'?
using index_sequence = std::integer_sequence<std::size_t, Vals...>;
~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:93:8: note: '__integer_sequence' declared here
struct __integer_sequence {
^
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
In file included from ../include/experimental/__p0009_bits/array_workaround.hpp:48:
../include/experimental/__p0009_bits/trait_backports.hpp:103:37: error: reference to 'integer_sequence' is ambiguous
struct __make_int_seq_impl<T, N, N, integer_sequence<T, Vals...>>
^
../include/experimental/__p0009_bits/trait_backports.hpp:89:8: note: candidate found by name lookup is 'std::integer_sequence'
struct integer_sequence {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:868:29: note: candidate found by name lookup is 'std::__1::integer_sequence'
struct _LIBCPP_TEMPLATE_VIS integer_sequence
^
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
In file included from ../include/experimental/__p0009_bits/array_workaround.hpp:48:
../include/experimental/__p0009_bits/trait_backports.hpp:103:53: error: expected '>'
struct __make_int_seq_impl<T, N, N, integer_sequence<T, Vals...>>
^
../include/experimental/__p0009_bits/trait_backports.hpp:103:61: error: expected ';' at end of declaration
struct __make_int_seq_impl<T, N, N, integer_sequence<T, Vals...>>
^
;
../include/experimental/__p0009_bits/trait_backports.hpp:103:64: error: expected unqualified-id
struct __make_int_seq_impl<T, N, N, integer_sequence<T, Vals...>>
^
../include/experimental/__p0009_bits/trait_backports.hpp:110:12: error: reference to 'integer_sequence' is ambiguous
T, N, I, integer_sequence<T, Vals...>
^
../include/experimental/__p0009_bits/trait_backports.hpp:89:8: note: candidate found by name lookup is 'std::integer_sequence'
struct integer_sequence {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:868:29: note: candidate found by name lookup is 'std::__1::integer_sequence'
struct _LIBCPP_TEMPLATE_VIS integer_sequence
^
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
In file included from ../include/experimental/__p0009_bits/array_workaround.hpp:48:
../include/experimental/__p0009_bits/trait_backports.hpp:110:28: error: expected '>'
T, N, I, integer_sequence<T, Vals...>
^
../include/experimental/__p0009_bits/trait_backports.hpp:110:36: error: expected ';' at end of declaration
T, N, I, integer_sequence<T, Vals...>
^
;
../include/experimental/__p0009_bits/trait_backports.hpp:110:39: error: expected unqualified-id
T, N, I, integer_sequence<T, Vals...>
^
../include/experimental/__p0009_bits/trait_backports.hpp:117:79: error: reference to 'integer_sequence' is ambiguous
using make_integer_sequence = typename __detail::__make_int_seq_impl<T, N, 0, integer_sequence<T>>::type;
^
../include/experimental/__p0009_bits/trait_backports.hpp:89:8: note: candidate found by name lookup is 'std::integer_sequence'
struct integer_sequence {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:868:29: note: candidate found by name lookup is 'std::__1::integer_sequence'
struct _LIBCPP_TEMPLATE_VIS integer_sequence
^
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
In file included from ../include/experimental/__p0009_bits/array_workaround.hpp:48:
../include/experimental/__p0009_bits/trait_backports.hpp:117:95: error: expected '>'
using make_integer_sequence = typename __detail::__make_int_seq_impl<T, N, 0, integer_sequence<T>>::type;
^
../include/experimental/__p0009_bits/trait_backports.hpp:117:95: error: expected ';' after alias declaration
using make_integer_sequence = typename __detail::__make_int_seq_impl<T, N, 0, integer_sequence<T>>::type;
^
;
../include/experimental/__p0009_bits/trait_backports.hpp:120:82: error: reference to 'integer_sequence' is ambiguous
using make_index_sequence = typename __detail::__make_int_seq_impl<size_t, N, 0, integer_sequence<size_t>>::type;
^
../include/experimental/__p0009_bits/trait_backports.hpp:89:8: note: candidate found by name lookup is 'std::integer_sequence'
struct integer_sequence {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:868:29: note: candidate found by name lookup is 'std::__1::integer_sequence'
struct _LIBCPP_TEMPLATE_VIS integer_sequence
^
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
In file included from ../include/experimental/__p0009_bits/array_workaround.hpp:48:
../include/experimental/__p0009_bits/trait_backports.hpp:120:98: error: expected '>'
using make_index_sequence = typename __detail::__make_int_seq_impl<size_t, N, 0, integer_sequence<size_t>>::type;
^
../include/experimental/__p0009_bits/trait_backports.hpp:120:98: error: expected ';' after alias declaration
using make_index_sequence = typename __detail::__make_int_seq_impl<size_t, N, 0, integer_sequence<size_t>>::type;
^
;
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
../include/experimental/__p0009_bits/array_workaround.hpp:89:27: error: reference to 'integer_sequence' is ambiguous
struct __array_impl<T, N, integer_sequence<size_t, Idxs...>>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:868:29: note: candidate found by name lookup is 'std::__1::integer_sequence'
struct _LIBCPP_TEMPLATE_VIS integer_sequence
^
../include/experimental/__p0009_bits/trait_backports.hpp:89:8: note: candidate found by name lookup is 'std::integer_sequence'
struct integer_sequence {
^
In file included from ../examples/subspan/subspan.cpp:45:
In file included from ../include/experimental/mdspan:48:
../include/experimental/__p0009_bits/array_workaround.hpp:89:43: error: expected '>'
struct __array_impl<T, N, integer_sequence<size_t, Idxs...>>
^
../include/experimental/__p0009_bits/array_workaround.hpp:89:56: error: expected ';' at end of declaration
struct __array_impl<T, N, integer_sequence<size_t, Idxs...>>
^
;
../include/experimental/__p0009_bits/array_workaround.hpp:89:59: error: expected unqualified-id
struct __array_impl<T, N, integer_sequence<size_t, Idxs...>>
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Try the recent change I just pushed. I can't reproduce this issue; I do all of my development on a Mac and have not run in to this problem, so I'm kind of taking a shot in the dark.
hmm, unfortunately no. the important part in the error I think is:
In file included from ../include/experimental/__p0009_bits/array_workaround.hpp:48:
../include/experimental/__p0009_bits/trait_backports.hpp:104:37: error: reference to 'integer_sequence' is ambiguous
struct __make_int_seq_impl<T, N, N, integer_sequence<T, Vals...>>
^
../include/experimental/__p0009_bits/trait_backports.hpp:90:8: note: candidate found by name lookup is 'std::integer_sequence'
struct integer_sequence {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:868:29: note: candidate found by name lookup is 'std::__1::integer_sequence'
struct _LIBCPP_TEMPLATE_VIS integer_sequence
if I hard define _MDSPAN_USE_INTEGER_SEQUENCE 1
then something similar happens with enable_if_t
, so it seems the feature detection in config.hpp
doesnt work very well on osx
ok, I got examples to build by hand defining _MDSPAN_USE_INTEGER_SEQUENCE 1
and _MDSPAN_USE_STANDARD_TRAIT_ALIASES 1
@maddanio I was able to reproduce the error with AppleClang.
Would you please confirm it builds without any modification if you configure with -D MDSPAN_CXX_STANDARD=11
?
I can confirm that. But isnt that somewhat suboptimal?
I can confirm that. But isnt that somewhat suboptimal?
We will fix it. Just making sure.
We just need to fiddle with the macros in config.hpp
, and possibly special-case Apple clang. Even though it’s nice for zero-conf use cases, the problem with using feature macros instead of build-system feature compilation tests is that sometimes compilers lie about what they support.
Sent with GitHawk
@maddanio This should be working now with C++11, C++14, and C++17 modes.
works great!
can somebody explain for the beginner what is the fix? I cannot find any config option with SPAN_
below config I get from CMAKE.
C/C++:
Built as dynamic libs?: YES
C++ standard: 11
C++ Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ (ver 12.0.5.12050022)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,-dead_strip
Linker flags (Debug): -Wl,-dead_strip
ccache: NO
Precompiled headers: NO
Extra dependencies:
3rdparty dependencies:
I also tried -std=c++14 It doesn't help
os: 10.14.6 clang: Apple LLVM version 10.0.1 (clang-1001.0.46.4)