NVIDIA Jetson TX1 "make" Issues

Hello!
We are a new team to the NVIDIA Jetson, and honestly everything other than Labview. I have been following the tutorials on the FRC Screensteps for the TX1, and everything had been great until the end of tutorial 0. I’m able to do everything except make the executable with “make”. Every time I try to, I get an error saying that it has failed.
The terminal reads:

“ubuntu@tegra-ubuntu:~/0-cv-hello/build$ make
50%] Linking CXX executable cv_hello
/usr/bin/ld: cannot find -lopencv_dep_cudart
collect2: error: ld returned 1 exit status
CMakeFiles/cv_hello.dir/build.make:121: recipe for target ‘cv_hello’ failed
make[2]: *** [cv_hello] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/cv_hello.dir/all’ failed
make[1]: *** [CMakeFiles/cv_hello.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2”

I have gone back to make sure that CUDA is installed, I have checked for updates, restarted the Jetson, tried again from scratch, etc. But I always get the same message.
Thanks!

Huh. Didn’t know that FIRST was on the deep learning hype train.

If you have verified that you do in fact have this library (which I’m sure you do if you followed the instructions), then it is probably a paths issue.

Type; “$OpenCV_INCLUDE_DIRS” into terminal.

If it doesn’t output something like “Bash /dir/ Is a directory” then that means that your CmakeLists.txt (and ultimately bash) doesn’t know what you’re talking about when you say include_directories($OpenCV_INCLUDE_DIRS), because it doesn’t know what OpenCV_INCLUDE_DIRS is.

To give a basic example,

int main()
{
int a = b + 5;
}

the compiler doesn’t know what b is, it isn’t declared anywhere. So, you have to declare it.

In order to help you further, I need to know how you installed opencv, through the package manager, or did you compile from source and then link it?

We ran into the same problem, you need to include the

-DCUDA_USE_STATIC_CUDA_RUNTIME=OFF

argument when you run cmake.

It finally worked!! Thank you so much!! This has helped us make huge advancements!!!
I greatly appreciate the help :slight_smile:

I have a somewhat similar issue. Everytime I try to build i get this error:

CMakeFiles/parj.dir/build.make:62: recipe for target ‘CMakeFiles/parj.dir/liftTracker.cpp.o’ failed
make[2]: *** [CMakeFiles/parj.dir/liftTracker.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/parj.dir/all’ failed
make[1]: *** [CMakeFiles/parj.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2