Scripts for build OpenCV on the NVIDIA Jetson Nano Developer Kit
MIT License
Script for building OpenCV 4 on the NVIDIA Jetson Nano Developer Kit
Building for:
Note: The script does not check to see which version of L4T is running before building, understand the script may only work with the stated versions.
This is a long build, you may want to write to a log file, for example:
While the build will still be written to the console, the build log will be written to openCV_build.log for later review.
On the Jetson Nano, this is a challenging build. There is not enough memory on the Nano to make with multiple jobs (i.e)
without using a significant amount of swap file space. With L4T 32.2.1, there is a default swap space. However, if you are using a SD card, this can result in long compile times as both physcial memory and the swap file memory exhaust. Recommend using a USB drive for building. If you use a SD card, consider setting the environment variable NUM_JOBS in the buildOpenCV.sh script to 1. The build time may be longer, but you will not have the same amount of memory/SD card thrashing. If you are using a USB drive, you may want to add a swapfile: https://github.com/JetsonHacksNano/installSwapfile.
Note that if you are building for Python, you most definitely will benefit from building with a swap file and running on a USB drive. See: https://github.com/JetsonHacksNano/installSwapfile
OpenCV is a very rich environment, with many different options available. Check the script to make sure that the options you need are included/excluded. By default, the buildOpenCV.sh script selects these major options:
By default, the build will create a OpenCV package. The package file will be found in:
The advantage of packaging is that you can use the resulting package file to install this OpenCV build on other machines without having to rebuild. Whether the OpenCV package is built or not is controlled by the CMake directive CPACK_BINARY_DEB in the script.
November 2019, Initial Release