Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile fixes for 64bit architechtures and GoCV/OpenCV version updates #1106

Merged
merged 4 commits into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 -
Expand Down Expand Up @@ -235,22 +239,38 @@ 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

# 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
Expand Down
Loading