platform, compiler, flags
2.1. platform: Linux - Ubuntu 18.04.4 LTS
2.2. compiler: clang 8 + libc++ 8
2.3. flags: see point 4
description of the problem
SystemC fails to build with clang 8 and libc++ 8 due to an incorrect include of experimental/string_view in sc_string_view.h
Note that experimental/string_view is not support anymore form libc++ 7 and onwards
steps to reproduce the problem
4.1. mkdir build
4.2. CC=clang-8 CXX=clang++-8 CXXFLAGS="-stdlib=libc++" cmake .. -DCMAKE_CXX_STANDARD=14
4.3. make
compile/runtime warnings and errors
...
In file included from src/sysc/kernel/sc_simcontext.cpp:57:
In file included from src/sysc/utils/sc_string_view.h:47:
/usr/lib/llvm-8/bin/../include/c++/v1/experimental/string_view:18:3: warning: "<experimental/string_view> has been removed. Use <string_view> instead." [-W#warnings]
# warning "<experimental/string_view> has been removed. Use <string_view> instead."
^
...
In file included from src/sysc/kernel/sc_simcontext.cpp:57:
src/sysc/utils/sc_string_view.h:62:9: error: no member named 'experimental' in namespace 'std'
typedef SC_STRING_VIEW_NS_::string_view sc_string_view;
...
code sample, not more than 100 lines to demonstrate the problem
Not Applicable
experimental/string_view
insc_string_view.h
Note thatexperimental/string_view
is not support anymore form libc++ 7 and onwardsmkdir build
4.2.CC=clang-8 CXX=clang++-8 CXXFLAGS="-stdlib=libc++" cmake .. -DCMAKE_CXX_STANDARD=14
4.3.make
Additional information:
Issue is caused at line 41 by the check for c++ version > c++14 https://github.com/accellera-official/systemc/blob/604182509559ae42c34e878f508bae7c18abbbd6/src/sysc/utils/sc_string_view.h#L40-L51
Best Regards, Jan