-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
fix: When cross-compiling, CMake miss the correct library files. #27978
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
base: 4.x
Are you sure you want to change the base?
Conversation
…h OpenBLAS detection, causing CMake to miss the correct library files.
…`OpenBLAS::OpenBLAS`
|
The solution looks a bit wired. Could you describe your use-case: compiler, toolchain file, the way how the BLAS is searched, etc? |
|
I first cross-compiled OpenBLAS, and then used this previously cross-compiled OpenBLAS when cross-compiling OpenCV.
aarch64-mix210-linux-gcc -v
In both cases, the line below cannot find the files unless I add NO_CMAKE_FIND_ROOT_PATH. opencv/cmake/OpenCVFindLAPACK.cmake Line 35 in 2dd0ac3
When cross-compiling, the toolchain defines CMAKE_FIND_ROOT_PATH. In the CMake documentation, it is described as:
It might be more appropriate to modify it by adding a check for CMAKE_CROSSCOMPILING. if(CMAKE_CROSSCOMPILING)
find_path(${VAR} "${NAME}" ${ARGN} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
else()
find_path(${VAR} "${NAME}" ${ARGN} NO_DEFAULT_PATH)
endif() |
When cross-compiling, CMake miss the correct library files.
CMAKE_FIND_ROOT_PATHcan interfere with OpenBLAS detection, causing CMake to miss the correct library include files.find_package(OpenBLAS QUIET),OpenBLAS_LIBRARIESdoes not containOpenBLAS::OpenBLAS.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.