From 5fedf828ee2b985351747c8f6485475e033074b9 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:19:00 +0300 Subject: [PATCH 1/4] Added the lapack installation --- travis_config.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/travis_config.sh b/travis_config.sh index a83fe141..7026a021 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -26,6 +26,13 @@ function bdist_wheel_cmd { if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi } +if [ -n "$IS_OSX" ]; then + brew install lapack +else + yum install -y atlas-devel blas-devel lapack-devel + cp /usr/include/lapacke/lapacke*.h /usr/include/ +fi + if [ -n "$IS_OSX" ]; then echo " > OSX environment " export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" From 3c1ea4402db35fa51c6804db7424bd30d561a51c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 1 Oct 2021 11:35:33 +0300 Subject: [PATCH 2/4] Changed blas to openblas and fixed flow to a proper installation --- scripts/build.sh | 1 + travis_config.sh | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index f48ca066..aa9ff968 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,3 +15,4 @@ echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT +rm wheelhouse/numpy* diff --git a/travis_config.sh b/travis_config.sh index 7026a021..28fbb96f 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -26,13 +26,6 @@ function bdist_wheel_cmd { if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi } -if [ -n "$IS_OSX" ]; then - brew install lapack -else - yum install -y atlas-devel blas-devel lapack-devel - cp /usr/include/lapacke/lapacke*.h /usr/include/ -fi - if [ -n "$IS_OSX" ]; then echo " > OSX environment " export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" @@ -99,6 +92,14 @@ function pre_build { echo "Starting pre-build" set -e -o pipefail + if [ -n "$IS_OSX" ]; then + brew install lapack + else + yum install -y lapack-devel openblas-devel + cp /usr/include/lapacke/lapacke*.h /usr/include/ + curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h + fi + if [ -n "$IS_OSX" ]; then echo "Running for OSX" From 40e0e3b8c235386c003f8ea5d0a9d9ea968a06cd Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 1 Oct 2021 13:51:43 +0300 Subject: [PATCH 3/4] Fixed aarch64 openblas installation --- travis_config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index 28fbb96f..a387966c 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -95,7 +95,8 @@ function pre_build { if [ -n "$IS_OSX" ]; then brew install lapack else - yum install -y lapack-devel openblas-devel + # epel-release need for aarch64 to get openblas packages + yum install -y lapack-devel epel-release && yum install -y openblas-devel cp /usr/include/lapacke/lapacke*.h /usr/include/ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h fi From 1d6e03459e32a5effd27b7b86186b418f2bde437 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 1 Oct 2021 19:11:37 +0300 Subject: [PATCH 4/4] Fixed an issue when machine:X86 was defined on Windows x64 --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 612a080c..22b6561d 100644 --- a/setup.py +++ b/setup.py @@ -151,6 +151,12 @@ def main(): "-DBUILD_PERF_TESTS=OFF", "-DBUILD_DOCS=OFF", ] + + ( + # If it is not defined 'linker flags: /machine:X86' on Windows x64 + ["-DCMAKE_GENERATOR_PLATFORM=x64"] + if x64 and sys.platform == "win32" + else [] + ) + ( ["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib