From 00f54a63b41e4a9141ae4c240c0b6c802f6f75df Mon Sep 17 00:00:00 2001 From: swdee Date: Sat, 7 Oct 2023 20:11:53 +1300 Subject: [PATCH 1/4] Update GoCV version number to v0.34.0. Update OpenCV version to 4.8.1. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 75cbf632..72588654 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,10 @@ .PHONY: test deps download build clean astyle cmds docker # GoCV version to use. -GOCV_VERSION?="v0.31.0" +GOCV_VERSION?="v0.34.0" # OpenCV version to use. -OPENCV_VERSION?=4.8.0 +OPENCV_VERSION?=4.8.1 # Go version to use when building Docker image GOVERSION?=1.16.2 From 81a67ecf334b2154faf9d8c108b2d116a3af45aa Mon Sep 17 00:00:00 2001 From: swdee Date: Sat, 7 Oct 2023 21:11:54 +1300 Subject: [PATCH 2/4] change sudo_pre_install_clean to support cleanup on 64bit architechtures (arm and x86) --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 72588654..da0fa2bb 100644 --- a/Makefile +++ b/Makefile @@ -235,10 +235,26 @@ clean: # Cleanup old library files. sudo_pre_install_clean: +ifneq (,$(wildcard /usr/local/lib/libopencv*)) sudo rm -rf /usr/local/lib/cmake/opencv4/ sudo rm -rf /usr/local/lib/libopencv* sudo rm -rf /usr/local/lib/pkgconfig/opencv* sudo rm -rf /usr/local/include/opencv* +else +ifneq (,$(wildcard /usr/local/lib64/libopencv*)) + sudo rm -rf /usr/local/lib64/cmake/opencv4/ + sudo rm -rf /usr/local/lib64/libopencv* + sudo rm -rf /usr/local/lib64/pkgconfig/opencv* + sudo rm -rf /usr/local/include/opencv* +else +ifneq (,$(wildcard /usr/local/lib/aarch64-linux-gnu/libopencv*)) + sudo rm -rf /usr/local/lib/aarch64-linux-gnu/cmake/opencv4/ + sudo rm -rf /usr/local/lib/aarch64-linux-gnu/libopencv* + sudo rm -rf /usr/local/lib/aarch64-linux-gnu/pkgconfig/opencv* + sudo rm -rf /usr/local/include/opencv* +endif +endif +endif # Do everything. install: deps download sudo_pre_install_clean build sudo_install clean verify From a12b672ce4905f586ce54e25acb52ac54c00394f Mon Sep 17 00:00:00 2001 From: swdee Date: Sat, 7 Oct 2023 21:13:45 +1300 Subject: [PATCH 3/4] added sudo_pre_install_clean to raspberry pi and jetson installs --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index da0fa2bb..fb9ef1b1 100644 --- a/Makefile +++ b/Makefile @@ -260,13 +260,13 @@ endif install: deps download sudo_pre_install_clean build sudo_install clean verify # Do everything on Raspbian. -install_raspi: deps download build_raspi sudo_install clean verify +install_raspi: deps download sudo_pre_install_clean build_raspi sudo_install clean verify # Do everything on the raspberry pi zero. -install_raspi_zero: deps download build_raspi_zero sudo_install clean verify +install_raspi_zero: deps download sudo_pre_install_clean build_raspi_zero sudo_install clean verify # Do everything on Jetson. -install_jetson: deps download build_jetson sudo_install clean verify +install_jetson: deps download sudo_pre_install_clean build_jetson sudo_install clean verify # Do everything with cuda. install_cuda: deps download sudo_pre_install_clean build_cuda sudo_install clean verify verify_cuda From 5152ae18dab0352cd47c11ac3d4369619718c258 Mon Sep 17 00:00:00 2001 From: swdee Date: Sat, 7 Oct 2023 21:31:27 +1300 Subject: [PATCH 4/4] for build_raspi added conditional cmake build for 64 and 32bit platforms. remove ENABLE_VFPV3=ON and add WITH_TBB=ON from 64bit build. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index fb9ef1b1..db29212e 100644 --- a/Makefile +++ b/Makefile @@ -118,7 +118,11 @@ build_raspi: mkdir build cd build rm -rf * +ifneq ($(shell uname -m | grep "aarch64"),) + cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D ENABLE_NEON=ON -D WITH_JASPER=OFF -D WITH_TBB=ON -D OPENCV_GENERATE_PKGCONFIG=ON .. +else cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D ENABLE_NEON=ON -D ENABLE_VFPV3=ON -D WITH_JASPER=OFF -D OPENCV_GENERATE_PKGCONFIG=ON .. +endif $(MAKE) -j $(shell nproc --all --ignore 1) $(MAKE) preinstall cd -