Jump to content

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


sumit_tuwien

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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...