cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peanut
Observer
Observer
437 Views
Registered: ‎11-30-2018

vitis2021.1 hls /usr/local/lib//libopencv_imgcodecs.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.

When I run the L1 example from vitis Vision Library, the following error occurs in vitis_hls. I installed oencV version 4.4.0. This is an error in C-Simuliation. This will not happen in version 2020.1. How do I fix it. Thank you so much for helping to recreate it and help solve it. Thanks again!

Starting C simulation ...
/tools/Xilinx/Vitis_HLS/2021.1/bin/vitis_hls /home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/pyrdown.prj/sol1/csim.tcl
INFO: [HLS 200-10] Running '/tools/Xilinx/Vitis_HLS/2021.1/bin/unwrapped/lnx64.o/vitis_hls'
INFO: [HLS 200-10] For user 'l' on host 'l' (Linux_x86_64 version 5.4.0-42-generic) on Wed Jul 28 14:53:45 CST 2021
INFO: [HLS 200-10] On os Ubuntu 20.04.1 LTS
INFO: [HLS 200-10] In directory '/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown'
Sourcing Tcl script '/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/pyrdown.prj/sol1/csim.tcl'
INFO: [HLS 200-1510] Running: open_project pyrdown.prj
INFO: [HLS 200-10] Opening project '/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/pyrdown.prj'.
INFO: [HLS 200-1510] Running: set_top pyr_down_accel
INFO: [HLS 200-1510] Running: add_files xf_pyr_down_accel.cpp -cflags -I/home/l/Vitis_Libraries-master/vision/L1/include -I/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/build -I./. -D__SDSVHLS__ -std=c++0x -csimflags -I/home/l/Vitis_Libraries-master/vision/L1/include -I/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/build -I./. -D__SDSVHLS__ -std=c++0x
INFO: [HLS 200-10] Adding design file 'xf_pyr_down_accel.cpp' to the project
INFO: [HLS 200-1510] Running: add_files -tb xf_pyr_down_tb.cpp -cflags -I/usr/local/include/opencv4/. -I/home/l/Vitis_Libraries-master/vision/L1/include -I/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/build -I. -D__SDSVHLS__ -std=c++0x -Wno-unknown-pragmas -csimflags -I/home/l/Vitis_Libraries-master/vision/L1/include -I/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/build -I. -D__SDSVHLS__ -std=c++0x -Wno-unknown-pragmas
INFO: [HLS 200-10] Adding test bench file 'xf_pyr_down_tb.cpp' to the project
INFO: [HLS 200-1510] Running: open_solution sol1 -flow_target vivado
INFO: [HLS 200-10] Opening solution '/home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/pyrdown.prj/sol1'.
INFO: [SYN 201-201] Setting up clock 'default' with a period of 3.3ns.
INFO: [HLS 200-1611] Setting target device to 'xczu9eg-ffvb1156-2-e'
INFO: [HLS 200-1505] Using flow_target 'vivado'
Resolution: For help on HLS 200-1505 see www.xilinx.com/cgi-bin/docs/rdoc?v=2021.1;t=hls+guidance;d=200-1505.html
INFO: [HLS 200-1510] Running: set_part xczu9eg-ffvb1156-2-e
INFO: [HLS 200-1510] Running: create_clock -period 3.3 -name default
INFO: [HLS 200-1510] Running: csim_design -ldflags -L /usr/local/lib/ -lopencv_imgcodecs -lopencv_imgproc -lopencv_core -lopencv_highgui -lopencv_flann -lopencv_features2d -argv /home/l/Vitis_Libraries-master/vision/data/128x128.png -quiet
INFO: [SIM 211-2] *************** CSIM start ***************
INFO: [SIM 211-4] CSIM will launch GCC as the compiler.
Generating csim.exe
/usr/local/lib//libopencv_imgcodecs.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26'
/usr/local/lib//libopencv_flann.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
collect2: error: ld returned 1 exit status
make: *** [Makefile.rules:393: csim.exe] Error 1
ERROR: [SIM 211-100] 'csim_design' failed: compilation error(s).
INFO: [SIM 211-3] *************** CSIM finish ***************
INFO: [HLS 200-111] Finished Command csim_design CPU user time: 0.93 seconds. CPU system time: 0.28 seconds. Elapsed time: 0.62 seconds; current allocated memory: 205.961 MB.
4
while executing
"source /home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/pyrdown.prj/sol1/csim.tcl"
invoked from within
"hls::main /home/l/Vitis_Libraries-master/vision/L1/examples/pyrdown/pyrdown.prj/sol1/csim.tcl"
("uplevel" body line 1)
invoked from within
"uplevel 1 hls::main {*}$newargs"
(procedure "hls_proc" line 16)
invoked from within
"hls_proc [info nameofexecutable] $argv"
Finished C simulation.

 

4 Replies
wardo_82
Observer
Observer
385 Views
Registered: ‎11-17-2020

I have the same problem with

 

/usr/local/lib/libopencv_core.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26'

 

 

It seems to be a common error on other contexts too, see here for example (i tried this solution, did not work). Also here a user says it is because the compilation was done using a different c++ standard. Maybe we should compile OpenCV with the same gcc version Vitis_HLS uses? I don't know if Vitis uses the system one or a custom one brought with the installation.

Can someone confirm?

0 Kudos
peanut
Observer
Observer
355 Views
Registered: ‎11-30-2018

How do I check the GCC version of Vitis2021_HLS?

0 Kudos
hemangd
Moderator
Moderator
351 Views
Registered: ‎03-16-2017

@peanut check vitis hls installed directory \lin64\Vitis_HLS\2021.1\lnx64\tools\gcc\bin 

it might be 2021.1 has 4.6.3

Regards,
hemangd

Don't forget to give kudos and mark it as accepted solution if your issue gets resolved.
0 Kudos
wardo_82
Observer
Observer
326 Views
Registered: ‎11-17-2020

Hi @hemangd , Vitis_HLS alone has all this gcc locations.

./Vitis_HLS/2021.1/tps/lnx64/gcc-6.2.0/bin/gcc
./Vitis_HLS/2021.1/tps/lnx64/gcc-6.2.0/libexec/gcc
./Vitis_HLS/2021.1/tps/lnx64/gcc-6.2.0/lib/gcc
./Vitis_HLS/2021.1/tps/boost_1_72_0/boost/mpl/aux_/preprocessed/gcc
./Vitis_HLS/2021.1/lnx64/tools/clang-3.9/lib/gcc
./Vitis_HLS/2021.1/lnx64/tools/gcc/bin/gcc
./Vitis_HLS/2021.1/lnx64/tools/gcc/libexec/gcc
./Vitis_HLS/2021.1/lnx64/tools/gcc/lib/gcc


Some are directories but at least gcc6 and gcc4 are there. Which one should we use?
If it is the case that we need to compile OpenCV with Vitis's gcc version, why isn't that on any introduction to Vitis? On the Vitis Vision Library homepage says it was tested with OpenCV4.4.

When i try to compile OpenCV3.4 with gcc4.6.3 provided with Vitis it fails.