Problem to compile VisionWorks example

Hello,

I want to modify the code of the nvgstcamera_capture example which is provided with VisionWorks-1.6.

First, I made a copy of the nvgstcamera_capture folder to another directory. Then I used make to run the Makefile provided by the example to build the executable. However I get the following error:

nvidia@tegra-ubuntu:~/Documents/CUDA Examples/nvgstcamera_capture$ make
g++ -I/usr/local/cuda-9.0/include -I/home/nvidia/code/build-visionworks/install/include -I…/…/nvxio/include -I…/…/nvxio/src/ -I…/…/nvxio/src/NVX/ -I…/…/3rdparty/opengl -I…/…/3rdparty/glfw3/include -I…/…/3rdparty/freetype/include -I…/…/3rdparty/eigen -O3 -DNDEBUG -std=c++0x -DCUDA_API_PER_THREAD_DEFAULT_STREAM -DUSE_GUI=1 -DUSE_GLFW=1 -DUSE_GLES=1 -DUSE_GSTREAMER=1 -DUSE_NVGSTCAMERA=1 -DUSE_GSTREAMER_OMX=1 -o obj/release/main_nvgstcamera_capture.o -c main_nvgstcamera_capture.cpp
main_nvgstcamera_capture.cpp:37:34: fatal error: OVX/FrameSourceOVX.hpp: No such file or directory
compilation terminated.
Makefile:140: recipe for target ‘obj/release/main_nvgstcamera_capture.o’ failed
make: *** [obj/release/main_nvgstcamera_capture.o] Error 1

I also tried the build a cmake file as is suggested in another thread. My CMakeLists.txt is:

[i]cmake_minimum_required(VERSION 2.8)
project(nvfstcamera_capture)

set(CMAKE_CXX_STANDARD 11)
find_package(VisionWorks REQUIRED)
find_package(VisionWorks-NVXIO REQUIRED)

MESSAGE( STATUS "VisionWorks Lib: " {VisionWorks_LIBRARIES}) MESSAGE( STATUS "NVXIO Lib: " {VisionWorks-NVXIO_LIBRARIES})

add_executable(app main_nvgstcamera_capture.cpp)
target_link_libraries(app {VisionWorks_LIBRARIES} {VisionWorks-NVXIO_LIBRARIES})[/i]

But I got the following error:

[i]nvidia@tegra-ubuntu:~/Documents/CUDA Examples/nvgstcamera_capture/build$ cmake …
– The C compiler identification is GNU 5.4.0
– The CXX compiler identification is GNU 5.4.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Error at CMakeLists.txt:6 (find_package):
By not providing “FindVisionWorks-NVXIO.cmake” in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
“VisionWorks-NVXIO”, but CMake did not find one.

Could not find a package configuration file provided by “VisionWorks-NVXIO”
with any of the following names:

VisionWorks-NVXIOConfig.cmake
visionworks-nvxio-config.cmake

Add the installation prefix of “VisionWorks-NVXIO” to CMAKE_PREFIX_PATH or
set “VisionWorks-NVXIO_DIR” to a directory containing one of the above
files. If “VisionWorks-NVXIO” provides a separate development package or
SDK, be sure it has been installed.

– Configuring incomplete, errors occurred!
See also “/home/nvidia/Documents/CUDA Examples/nvgstcamera_capture/build/CMakeFiles/CMakeOutput.log”.[/i]

Evidently, the library NVXIO has some problem to be included in both cases. Can someone explain me how to include the library correctly, please? I am compiling directly on my Jetson TX2 platform which has the last JetPack installed.

Thank you.

Hi,

NVXIO was split into NVX and OVX from version 1.6.
You can find a Makefile example for VisionWorks-1.6 on this topic:
https://devtalk.nvidia.com/default/topic/1016273/jetson-tx2/visionworks-linking-problem/

Thanks.

Thank you for your answer.

Can you provide an example of how to include the flags of the thread in a Cmake file, please? I have tried to include the flags but I have the same previous error.

Regards,

Hi,

Here is the CMakeLists.txt example for topic 1016273:
https://devtalk.nvidia.com/default/topic/1016273/jetson-tx2/visionworks-linking-problem/post/5179211/#5179211

cmake_minimum_required (VERSION 2.8)

project(VisionWorks)

set (CMAKE_CXX_STANDARD 11)
find_package(VisionWorks REQUIRED)

include_directories("/usr/share/visionworks/sources/nvxio/include")
link_directories("/usr/local/cuda/targets/aarch64-linux/lib" "/usr/share/visionworks/sources/libs/aarch64/linux/release")

set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-lvisionworks -lovx -lnvx -lpthread")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGE} "-lgstpbutils-1.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGE} "/usr/share/visionworks/sources/3rdparty/glfw3/libs/libglfw3.a")
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGE} "-lXrandr -lXi -lXxf86vm -lX11 -lGL")

add_executable(app topic_1037512.cpp)

target_link_libraries(app ${VisionWorks_LIBRARIES})

Thanks.

Hi AastaLLL,

I’ve got the same problem as ercalleortiz and your CMakeLists solved it.
But now, I’ve got another problem, here is the result of ‘make’ :

Linking CXX executable vision
CMakeFiles/vision.dir/vision.cpp.o: In function `main':
vision.cpp:(.text+0x68): undefined reference to `nvxio::Application::get()'
vision.cpp:(.text+0x164): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: error: ld returned 1 exit status
CMakeFiles/vision.dir/build.make:95: recipe for target 'vision' failed
make[2]: *** [vision] Error 1
CMakeFiles/Makefile2:215: recipe for target 'CMakeFiles/vision.dir/all' failed
make[1]: *** [CMakeFiles/vision.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

I found other topic which solved this problem ( https://devtalk.nvidia.com/default/topic/965838/jetson-tx1/unable-to-install-package-libvisionworks-nvxi-jetpack-l4t-2-1-1-32-bit-via-jetpack-2-3-/post/4997975/#4997975 ) but it seems like libvisionworks-nvxio doesn’t exist anymore.

I use a Jetson TX2 L4T r27.1 on Jetpack 3.0 with VisionWorks 1.6.
All the VisionWorks samples are working.

Do you have an idea of how to solve this problem ?

Thanks.

Alright, I managed to make it work but only VisionWorks-1.6-Sample directory with a copy of a sample Makefile.

I have the same issue.
Unfortunately the solution still use the sample dir from VisionWorks 1.6.0

Hello,

Does anybody know if there is a way to use CMakelists.txt to compile one of the Visionworks (1.6) Samples ?

Thank you.

Hi,

Thanks for your patience.

We are still checking this issue internally. Will update to you later.
Thanks.

Has there been an update on this? Struggling to use Visionworks w/ cmake in order to include it in ROS nodes.

Thanks.

Hi,

We are still checking this issue.
For more progress, please check this topic for the update:
https://devtalk.nvidia.com/default/topic/1064190

Thanks.