Jump to content
sumit_tuwien

CMAKE_CXX_STANDARD in SystemC-2.3.2 build System Enables Nonstandard C++11 Switch

Recommended Posts

Hello All,

cmake ../ -DCMAKE_CXX_STANDARD=11 enables gcc specific switch -std=gnu++11 and "not" standard -std=c++11

And this is creating some side effects:

When I try to use clang: 

cmake ../ -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX=/home/sumit/systemc-2.3.2/ -DBUILD_SOURCE_DOCUMENTATION=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++

I see -std=c++11 option is not enabled during compilation:

............................................

[  9%] Building CXX object src/CMakeFiles/systemc.dir/sysc/communication/sc_signal_ports.cpp.o
cd /home/sumit/install/systemc-2.3.2/objdir/src && /usr/bin/clang++   -DSC_BUILD -DSC_ENABLE_ASSERTIONS -DSC_ENABLE_EARLY_MAXTIME_CREATION -DSC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING -DSC_INCLUDE_FX -I/home/sumit/install/systemc-2.3.2/src  -O3 -DNDEBUG   -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -pthread -o CMakeFiles/systemc.dir/sysc/communication/sc_signal_ports.cpp.o -c /home/sumit/install/systemc-2.3.2/src/sysc/communication/sc_signal_ports.cpp
[  9%] Building CXX object src/CMakeFiles/systemc.dir/sysc/communication/sc_signal_resolved.cpp.o
cd /home/sumit/install/systemc-2.3.2/objdir/src && /usr/bin/clang++   -DSC_BUILD -DSC_ENABLE_ASSERTIONS -DSC_ENABLE_EARLY_MAXTIME_CREATION -DSC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING -DSC_INCLUDE_FX -I/home/sumit/install/systemc-2.3.2/src  -O3 -DNDEBUG   -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -pthread -o CMakeFiles/systemc.dir/sysc/communication/sc_signal_resolved.cpp.o -c /home/sumit/install/systemc-2.3.2/src/sysc/communication/sc_signal_resolved.cpp
[  9%] Building CXX object src/CMakeFiles/systemc.dir/sysc/communication/sc_signal_resolved_ports.cpp.o
cd /home/sumit/install/systemc-2.3.2/objdir/src && /usr/bin/clang++   -DSC_BUILD -DSC_ENABLE_ASSERTIONS -DSC_ENABLE_EARLY_MAXTIME_CREATION -DSC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING -DSC_INCLUDE_FX -I/home/sumit/install/systemc-2.3.2/src  -O3 -DNDEBUG   -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -pthread -o CMakeFiles/systemc.dir/sysc/communication/sc_signal_resolved_ports.cpp.o -c /home/sumit/install/systemc-2.3.2/src/sysc/communication/sc_signal_resolved_ports.cpp

..........

Regards,

Sumit

Share this post


Link to post
Share on other sites

Hello @sumit_tuwien,

You can turn off the G++ extensions using the CMake command-line option:

# Enable C++11 compilation flag
# -DCMAKE_CXX_STANDARD=11
# Disable C++ Compiler Extensions
# -DCMAKE_CXX_EXTENSIONS=OFF
cmake -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_INSTALL_PREFIX=<Path to install location> ..

You can find a reference here.

Can you also list the version and platform information of the tools you are using (clang, CMake, etc.)?

Hope it helps.

Regards,

Ameya Vikram Singh

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×