UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor wind330
Visitor
8,584 Views
Registered: ‎08-20-2009

Error when using flag "-std=c++11"

Jump to solution

Hi:

 

I have a few source code with c++11 fetures, but when I use the "-std=c++11" compile option, vivado hls report the following error:

 

D:/Xilinx/SDSoC/2016.1/VIVADO~1/2016.1/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:122:61: error: redefinition of default argument

 

How can I use "-std=c++11" compile option in SDSoC?

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
14,797 Views
Registered: ‎06-29-2015

Re: Error when using flag "-std=c++11"

Jump to solution
Hi,

SDSoC does not currently support C++11 in general. SDSoC itself uses Vivado, VivadoHLS, and SDK tools under-the-hood. So if something doesnt work in one of the underlying tools (in this case VivadoHLS) then it will not work in SDSoC either. The various ARM compilers (in SDK) that are used under-the-hood do support c++11, but VivadoHLS does not support c++11 (that I have heard).

According to this post (https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Does-the-latest-HLS-support-C-11-features/td-p/426966) VivadoHLS supports g++ 4.6.
According to this post (http://stackoverflow.com/questions/10363646/compiling-c11-with-g#comment13354800_10363646) g++ 4.6 supports c++11 using the experimental -std=c++0x option.
Dependening on what you are doing your mileage may vary. If you get errors when using VivadoHLS, SDSoC does create VivadoHLS projects under the hood located at <build_cfg>/_sds/vhls/<func_name>. You can always ask HLS specific questions in the other forums to get the attention of the HLS experts.
0 Kudos
3 Replies
Scholar stephenm
Scholar
8,481 Views
Registered: ‎05-06-2012

Re: Error when using flag "-std=c++11"

Jump to solution

right click on the application in SDSoC, and select C/C++ build settings. Then under ARM v7 gcc compiler -> Inferred Options -? Software Platform. Add this to the Software Platform Inferred Options

 

You can also just add this to the make file, if you want

0 Kudos
Xilinx Employee
Xilinx Employee
14,798 Views
Registered: ‎06-29-2015

Re: Error when using flag "-std=c++11"

Jump to solution
Hi,

SDSoC does not currently support C++11 in general. SDSoC itself uses Vivado, VivadoHLS, and SDK tools under-the-hood. So if something doesnt work in one of the underlying tools (in this case VivadoHLS) then it will not work in SDSoC either. The various ARM compilers (in SDK) that are used under-the-hood do support c++11, but VivadoHLS does not support c++11 (that I have heard).

According to this post (https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Does-the-latest-HLS-support-C-11-features/td-p/426966) VivadoHLS supports g++ 4.6.
According to this post (http://stackoverflow.com/questions/10363646/compiling-c11-with-g#comment13354800_10363646) g++ 4.6 supports c++11 using the experimental -std=c++0x option.
Dependening on what you are doing your mileage may vary. If you get errors when using VivadoHLS, SDSoC does create VivadoHLS projects under the hood located at <build_cfg>/_sds/vhls/<func_name>. You can always ask HLS specific questions in the other forums to get the attention of the HLS experts.
0 Kudos
302 Views
Registered: ‎02-11-2019

Re: Error when using flag "-std=c++11"

Jump to solution

Hi,

I am using 2018.2 version of sdsoc to run xililnx opencl application.

Here is the command am trying to hardcode.

/tools/xilinx/SDX/SDx/2018.2/SDx/2018.2/bin/xocc -t hw --platform zcu106 --clkid 1 -c -k foo --messageDb binary_container_1/foo.md --xp misc:solution_name=foo --temp_dir binary_container_1 --report_dir binary_container_1/reports --log_dir binary_container_1/logs -std=c++0x -o"binary_container_1/foo.xo" "../src/bar.cpp"

ERROR: option '--target' cannot be specified more than once, type 'xocc -h' for usage info.
make: *** [binary_container_1/foo.xo] Error 1

 

Note:- The conflict is happening when --target is passed as an argument along with the -std=c++0x (c++11 support)

rajasekhar
0 Kudos