cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jerry.yau
Adventurer
Adventurer
726 Views
Registered: ‎03-21-2010

How to run Vitis vision L1 example in a centos 7.6

Hi

  I cloned the vitis vision library from https://github.com/Xilinx/Vitis_Libraries and I followed the steps described in https://xilinx.github.io/Vitis_Libraries/vision/2020.1/overview.html#hls-standalone-mode (GUI mode) to build an L1 example Dilation under the OS centos 7.6.

opencv1.JPG

I used  -I<path of vitis library>/vitis_vision/Vitis_Libraries/vision/L1/include -std=c++0x to repleace -I<path-to-include-directory>.

And my centos 7.6 had installed opencv library as shown below:

opencv.JPG

When I run C Simulation, I encountered this error message:

INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
Compiling ../../../../../vitis_vision/Vitis_Libraries/vision/L1/examples/dilation/xf_dilation_tb.cpp in debug mode
In file included from ../../../../../vitis_vision/Vitis_Libraries/vision/L1/examples/dilation/xf_dilation_tb.cpp:17:0:
../../../../../vitis_vision/Vitis_Libraries/vision/L1/include/common/xf_headers.hpp:26:43: fatal error: opencv2/imgcodecs/imgcodecs.hpp: 沒有此一檔案或目錄
#include "opencv2/imgcodecs/imgcodecs.hpp"
^
compilation terminated.
make: *** [obj/xf_dilation_tb.o] Error 1
ERR: [SIM 100] 'csim_design' failed: compilation error(s).

opencv2.JPG

how to fix this problem?

Do I need to use new opencv library or Vitis 2020.1 already have opencv library and how to use it?

And step by step available for this example?

Thanks

B/R

Jerry Yau

0 Kudos
5 Replies
jerry.yau
Adventurer
Adventurer
678 Views
Registered: ‎03-21-2010

Hi Xilinx expert,

I think centos 7 is too old to run Vitis vision library with opencv 3.x.x so I change to ubuntu 18.04. There are two opencv libraries in this system. One is installed in /usr/lib and one the other is installed in /usr/local/lib.

I ran the same L1 example Dilation. This time I got some different error messages.  The below picture showed all of my settings:

opencv3.JPG

 

Please help me to solve this issue and the error messages are:

INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
Compiling ../../../../../../vitis_vision/Vitis_Libraries/vision/L1/examples/dilation/xf_dilation_tb.cpp in debug mode
Compiling ../../../../../../vitis_vision/Vitis_Libraries/vision/L1/examples/dilation/xf_dilation_accel.cpp in debug mode
Generating csim.exe
Makefile.rules:379: recipe for target 'csim.exe' failed
/usr/lib/libgdal.so.20: undefined reference to `xmlBufferFree@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlBufferCreate@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathRegisterNs@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlNanoHTTPCleanup@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterEndElement@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlSearchNs@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlCreateFileParserCtxt@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlBufferCreateSize@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaSetValidErrors@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libtbb.so.2: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlAddNextSibling@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathNewContext@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlSetGenericErrorFunc@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathNewString@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlBufferContent@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterStartElementNS@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlAddPrevSibling@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterSetIndentString@LIBXML2_2.6.5'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlAddChild@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlCatalogResolveURI@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaNewMemParserCtxt@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libtbb.so.2: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlCheckVersion@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlSetNs@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterEndDocument@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlNewText@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaSetParserErrors@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterWriteString@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaValidateFile@LIBXML2_2.6.20'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlBufferSetAllocationScheme@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaParse@LIBXML2_2.5.8'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathEvalExpression@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlReadFile@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlParseDocument@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlGetExternalEntityLoader@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlFreeNode@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathErr@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathFreeContext@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterEndPI@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathFreeObject@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlNodeDump@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaNewValidCtxt@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlXPathFreeCompExpr@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlXPathCompile@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathRegisterFunc@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlReplaceNode@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `valuePush@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterWriteRaw@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterWriteElement@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaValidateDoc@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlCreatePushParserCtxt@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlXPathBooleanFunction@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlSearchNsByHref@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlGetLastError@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlParseChunk@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterWriteAttribute@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlParseDoc@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlSchemaNewDocParserCtxt@LIBXML2_2.6.2'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlCleanupParser@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlNewTextWriterMemory@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlDocDumpFormatMemory@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `valuePop@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSetExternalEntityLoader@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterStartPI@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlSAX2GetLineNumber@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlNewStringInputStream@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterStartElement@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlFree@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaFree@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterSetIndent@LIBXML2_2.6.5'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaFreeParserCtxt@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlTextWriterStartDocument@LIBXML2_2.6.0'
/usr/lib/libgdal.so.20: undefined reference to `xmlDocGetRootElement@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlFreeDoc@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlCatalogResolveSystem@LIBXML2_2.4.30'
/usr/lib/libgdal.so.20: undefined reference to `xmlSchemaFreeValidCtxt@LIBXML2_2.5.8'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlInitParser@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlFreeParserCtxt@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlNewNs@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlNewNode@LIBXML2_2.4.30'
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined reference to `xmlReadMemory@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlFreeTextWriter@LIBXML2_2.6.0'
/usr/lib/x86_64-linux-gnu/libdap.so.25: undefined reference to `xmlGetPredefinedEntity@LIBXML2_2.4.30'
collect2: error: ld returned 1 exit status
make: *** [csim.exe] Error 1
ERR: [SIM 100] 'csim_design' failed: compilation error(s).
INFO: [SIM 3] *************** CSIM finish ***************

 

Thanks

B/R

Jerry Yau

0 Kudos
wenchen
Moderator
Moderator
662 Views
Registered: ‎05-27-2018

Hi @jerry.yau ,

 Please try to use the absolute path to include the library files.

cflag2.PNG

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.


**~ Got a minute? Answer our Vitis HLS survey here! ~**


-------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 Kudos
jerry.yau
Adventurer
Adventurer
613 Views
Registered: ‎03-21-2010

Hi @wenchen.

I did input  absolute path  for include library. Vitis_hsl turned it into related path. I think there is not thing about absolute path or not because the error message comes from link process.

Today I install a new system with centos 8 and install opencv library with these commands:

yum install opencv-core.x86_64 opencv-contrib.x86_64 opencv-devel.x86_64

Then I tried L1's dilation example. I got error messges shown at the end of this post with below setting for CFLAGS

-I../../Vitis_Libraries-master/vision/L1/include -I../../Vitis_Libraries-master/vision/L1/examples/dilation -I../../Vitis_Libraries-master/vision/L1/examples/dilation/build -std=c++0x

Please help me to solve this problem.

I need L1's dilation example run on linux and windows 10.

Thanks

B/R

Jerry Yau

Error message:

/home/jerry/projects/vitis_hls/Dilation/solution1/csim/build/../../../../../../Vitis_Libraries-master/vision/L1/examples/dilation/xf_dilation_tb.cpp:34: undefined reference to `cv::imread(cv::String const&, int)'
/home/jerry/projects/vitis_hls/Dilation/solution1/csim/build/../../../../../../Vitis_Libraries-master/vision/L1/examples/dilation/xf_dilation_tb.cpp:58: undefined reference to `cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
/home/jerry/projects/vitis_hls/Dilation/solution1/csim/build/../../../../../../Vitis_Libraries-master/vision/L1/examples/dilation/xf_dilation_tb.cpp:59: undefined reference to `cv::dilate(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
/home/jerry/projects/vitis_hls/Dilation/solution1/csim/build/../../../../../../Vitis_Libraries-master/vision/L1/examples/dilation/xf_dilation_tb.cpp:60: undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
/home/jerry/projects/vitis_hls/Dilation/solution1/csim/build/../../../../../../Vitis_Libraries-master/vision/L1/examples/dilation/xf_dilation_tb.cpp:70: undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
/home/jerry/projects/vitis_hls/Dilation/solution1/csim/build/../../../../../../Vitis_Libraries-master/vision/L1/examples/dilation/xf_dilation_tb.cpp:76: undefined reference to `cv::absdiff(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&)'
/home/jerry/projects/vitis_hls/Dilation/solution1/csim/build/../../../../../../Vitis_Libraries-master/vision/L1/examples/dilation/xf_dilation_tb.cpp:77: undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
obj/xf_dilation_tb.o: In function `cv::String::String(char const*)':
/usr/include/opencv2/core/cvstd.hpp:602: undefined reference to `cv::String::allocate(unsigned long)'
obj/xf_dilation_tb.o: In function `cv::String::~String()':
/usr/include/opencv2/core/cvstd.hpp:648: undefined reference to `cv::String::deallocate()'
obj/xf_dilation_tb.o: In function `cv::String::operator=(cv::String const&)':
/usr/include/opencv2/core/cvstd.hpp:656: undefined reference to `cv::String::deallocate()'
obj/xf_dilation_tb.o: In function `cv::Mat::~Mat()':
/usr/include/opencv2/core/mat.inl.hpp:774: undefined reference to `cv::fastFree(void*)'
obj/xf_dilation_tb.o: In function `cv::Mat::create(int, int, int)':
/usr/include/opencv2/core/mat.inl.hpp:866: undefined reference to `cv::Mat::create(int, int const*, int)'
obj/xf_dilation_tb.o: In function `cv::Mat::release()':
/usr/include/opencv2/core/mat.inl.hpp:886: undefined reference to `cv::Mat::deallocate()'
obj/xf_dilation_tb.o: In function `cv::Mat::operator=(cv::Mat&&)':
/usr/include/opencv2/core/mat.inl.hpp:1455: undefined reference to `cv::fastFree(void*)'
collect2: error: ld returned 1 exit status
make: *** [Makefile.rules:380: csim.exe] Error 1
ERR: [SIM 100] 'csim_design' failed: compilation error(s).

 

0 Kudos
wenchen
Moderator
Moderator
592 Views
Registered: ‎05-27-2018

Hi @jerry.yau 

All of the error above comes from the invalid data path. Here is a sticky post that highlights the process of setting up the environment and creating a TCL script to use the OpenCV library for the Vision Library L1 resize example. I recommend running this first, then using the project that is created for GUI development if you wish. That post is here:


https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Using-Vitis-Vision-Libraries-and-OpenCV/td-p/1170435

Wen

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.


**~ Got a minute? Answer our Vitis HLS survey here! ~**


-------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 Kudos
baiyueguang
Visitor
Visitor
207 Views
Registered: ‎04-18-2021

Is solved?I had the same problem

0 Kudos