Hello,
I have successfully installed Jetpack 4.2 using the sdk on my jetson tx2. I was building the opecv 3.4 but it always stops at 47% giving the error as :
No rule to make target ‘/usr/lib/aarch64-linux-gnu/libGL.so’, needed by ‘lib/libopencv_cudev.so.3.4.1’. Stop. tx2
Can some one please help me solve this problem or help me build opecv 4.0
As WayneWWW proposed, I followed the link to the openCV installation files and have been able to install OpenCV 4.0.0 with the “install_opencv4.0.0_Nano.sh” on my Jetson TX2 by changing the architecture to 6.2. I had some issues with packages that were not too hard to fix so you should be able to do the same and have OpenCV 4.0.0 running on your TX2.
Thank you all for the reply. I re-flashed my TX2 with jetpack 4.2 and built the opencv 4 using the nano script. But my python 2 and 3 version of opencv has been downgraded from 3.3.0 to 3.2.0 instead upgrading it to 4.0. The binding for python in the script are ON but still couldn’t figure out how to update my opencv version of python 2 and 3 to 4.0. There were no errors during the build(some warning of course but nothing serious ). can you guys suggest something that might be wrong or something that could be done to make my python-opencv version to 4.0 ?
you are right WayneWWW but I am building the opencv from the source.
When I build opencv 3.4.0, I get the error No rule to make target ‘/usr/lib/aarch64-linux-gnu/libGL.so’, needed by ‘lib/libopencv_cudev.so.3.4.1’. Stop. tx2 and when i checked the libGL.so, the link is broken and there should be another libGL.so present in /usr/lib/aarch64-linux-gnu/tegra directory but its not there.
Then I started building the opencv 4.0, which does build properly without any errors but my python version shows the opencv version as 3.2.0.
I am trying to solve errors from either of the build but nothing is proving to be working. I have flashed my jetson once and do not want to do it again because flashing takes a lot of time and also building tensorflow and protobuf from source takes even more (not even including the opencv build :-p)
if you can help me with libGL.so file or give me a reason why build of opencv4.0 still shows version 3.2.0 that would be helpful.
When I build opencv 3.4.0, I get the error No rule to make target ‘/usr/lib/aarch64-linux-gnu/libGL.so’, needed by ‘lib/libopencv_cudev.so.3.4.1’. Stop. tx2 and when i checked the libGL.so, the link is broken and there should be another libGL.so present in /usr/lib/aarch64-linux-gnu/tegra directory but its not there.
Do you mean the default jetpack has a empty symlink for libGL.so? I will help check.
I don’t think opencv4.0 gives the 3.2 opencv-python. Are you sure you didn’t install it by using apt-get or something else?
Yes, there was no libGL.so so i re-flashed tx2 with 4.2 again and its present now. But instead of building Opencv 3.4.0 , i tried again to install opecv 4.0 and below is the log after the build and opencv version that it shows.
Setting up libdapclient6v5:arm64 (3.19.1-2build1) …
Setting up gdal-data (2.2.3+dfsg-2) …
Setting up libgeos-c1v5:arm64 (3.6.2-1build2) …
Setting up libpq5:arm64 (10.7-0ubuntu0.18.04.1) …
Processing triggers for libc-bin (2.27-3ubuntu1) …
Setting up libgdcm2.8:arm64 (2.8.4-1build2) …
Setting up libopencv-ml3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libarpack2:arm64 (3.5.0+real-2) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …
Setting up libopencv-imgproc3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-flann3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libtcl8.6:arm64 (8.6.8+dfsg-3) …
Setting up libhdf4-0-alt (4.2.13-2) …
Setting up libopencv-video3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libxerces-c3.2:arm64 (3.2.0+debian-2) …
Setting up liburiparser1:arm64 (0.8.4-1) …
Setting up libsz2:arm64 (0.3.2-2) …
Setting up proj-data (4.9.3-2) …
Setting up libgl2ps1.4 (1.4.0+dfsg1-1) …
Setting up libopencv-photo3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libproj12:arm64 (4.9.3-2) …
Setting up libhdf5-openmpi-100:arm64 (1.10.0-patch1+docs-4) …
Setting up libhdf5-100:arm64 (1.10.0-patch1+docs-4) …
Setting up libtk8.6:arm64 (8.6.8-4) …
Setting up libtesseract4 (4.00~git2288-10f4998a-2) …
Setting up libkmlbase1:arm64 (1.3.0-5) …
Setting up libarmadillo8 (1:8.400.0+dfsg-2) …
Setting up libogdi3.2 (3.2.0+ds-2) …
Setting up proj-bin (4.9.3-2) …
Setting up libgeotiff2:arm64 (1.4.2-2build1) …
Setting up libnetcdf13:arm64 (1:4.6.0-2build1) …
Setting up libopencv-shape3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libspatialite7:arm64 (4.3.0a-5build1) …
Setting up libkmldom1:arm64 (1.3.0-5) …
Setting up libnetcdf-c++4 (4.2-8) …
Setting up libkmlengine1:arm64 (1.3.0-5) …
Setting up odbcinst1debian2:arm64 (2.3.4-1.1ubuntu3) …
Setting up odbcinst (2.3.4-1.1ubuntu3) …
Setting up libgdal20 (2.2.3+dfsg-2) …
Setting up libopencv-imgcodecs3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libvtk6.3 (6.3.0+dfsg1-11build1) …
Setting up libopencv-videoio3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-viz3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-superres3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-highgui3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-objdetect3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-features2d3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-calib3d3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-stitching3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-videostab3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up libopencv-contrib3.2:arm64 (3.2.0+dfsg-4ubuntu0.1) …
Setting up python3-opencv (3.2.0+dfsg-4ubuntu0.1) …
Setting up python-opencv (3.2.0+dfsg-4ubuntu0.1) …
Processing triggers for libc-bin (2.27-3ubuntu1) …
** Install opencv-4.0.0 successfully
** Bye :)
nvidia@nvidia:~/JEP/script$ clear
nvidia@nvidia:~/JEP/script$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import cv2
cv2.version
‘3.2.0’
I think its not installing properly due memory limitations but i have approx 16 gb free on my tx2, so it might be ram issue but still not sure whats causing this !!
hello , i am trying to install opencv and opencv-contrib as i wanted to use the “xfeatures2d” from the contrib/modules but when i try to compile the opencv by using the command “make -j4” after 34% it stops and the jetson runs out of memory. I have 5 GB of free space in the jetson tx2 .
can anyone help me out ?
I cannot tell you what is the necessary disk size for installing opencv, but sometimes the makefile will create too much file simultaneously when you compile with -j option. You could try to use -j2 with slower build time or just some external storage(usb/sdcard).