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

[lapack-reference] Fixed lapack.lib not being found when linking using cmake under Windows #38035

Merged
merged 40 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d004f3d
remvoe from faillist
jimwang118 Apr 3, 2024
402871e
Revert "remvoe from faillist"
jimwang118 Apr 3, 2024
0a311c9
Merge branch 'master' of https://github.com/Microsoft/vcpkg
jimwang118 Apr 8, 2024
59af43b
fix lapack.lib not found
jimwang118 Apr 8, 2024
3377097
update version
jimwang118 Apr 8, 2024
2466145
fix config file
jimwang118 Apr 9, 2024
d96bb18
update version
jimwang118 Apr 9, 2024
21fdb4e
Merge branch 'master' into fix-lapack-reference
jimwang118 Apr 9, 2024
4bff5ef
update version
jimwang118 Apr 9, 2024
f2d77c2
update version
jimwang118 Apr 9, 2024
62e7fbc
update version
jimwang118 Apr 9, 2024
272f754
Merge branch 'master' of https://github.com/Microsoft/vcpkg
jimwang118 Apr 9, 2024
4743d8d
Merge branch 'master' into fix-lapack-reference
jimwang118 Apr 9, 2024
3aeecf9
modify config
jimwang118 Apr 9, 2024
45d3452
update version
jimwang118 Apr 9, 2024
4b0c875
\r
jimwang118 Apr 9, 2024
5669193
up
jimwang118 Apr 9, 2024
1fe36ee
update usage
jimwang118 Apr 9, 2024
6282fa3
update version
jimwang118 Apr 9, 2024
6e031c3
modify portfile
jimwang118 Apr 9, 2024
3492df2
update version
jimwang118 Apr 9, 2024
37653e4
Merge branch 'master' of https://github.com/Microsoft/vcpkg
jimwang118 Apr 11, 2024
05a3604
reset wrapper
jimwang118 Apr 11, 2024
d23ef08
update version
jimwang118 Apr 11, 2024
1a59795
add patch
jimwang118 Apr 11, 2024
02ab40c
update version
jimwang118 Apr 11, 2024
412cd13
modify LAPACK_LIBRARIES
jimwang118 Apr 12, 2024
4d279b9
update version
jimwang118 Apr 12, 2024
e4b3439
Merge branch 'master' of https://github.com/microsoft/vcpkg into fix-…
jimwang118 Apr 15, 2024
498e449
Merge branch 'master' of https://github.com/jimwang118/vcpkg
jimwang118 Apr 16, 2024
a57ec21
modify patch
jimwang118 Apr 16, 2024
905d4ba
update version
jimwang118 Apr 16, 2024
295500a
Merge branch 'fix-lapack-reference' of https://github.com/jimwang118/…
jimwang118 Apr 16, 2024
fa6da0f
Merge branch 'master' of https://github.com/Microsoft/vcpkg
jimwang118 Apr 16, 2024
74dfdb7
Merge branch 'master' of https://github.com/jimwang118/vcpkg
jimwang118 Apr 16, 2024
91f6edb
Merge branch 'master' into fix-lapack-reference
jimwang118 Apr 16, 2024
9092be4
add missing dependency
jimwang118 Apr 18, 2024
d9e6e39
update version
jimwang118 Apr 18, 2024
b8b4ea7
modify patch
jimwang118 Apr 18, 2024
db1118a
update version
jimwang118 Apr 18, 2024
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
17 changes: 17 additions & 0 deletions ports/lapack-reference/fix_prefix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c99d71a..7333110 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,12 @@ set(
${LAPACK_MAJOR_VERSION}.${LAPACK_MINOR_VERSION}.${LAPACK_PATCH_VERSION}
)

+if(WIN32)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this breaks MINGW.

+ set(CMAKE_STATIC_LIBRARY_PREFIX "")
+ set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+ set(CMAKE_IMPORT_LIBRARY_PREFIX "")
+endif()
+
# Add the CMake directory for custom CMake modules
set(CMAKE_MODULE_PATH "${LAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})

11 changes: 3 additions & 8 deletions ports/lapack-reference/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ vcpkg_from_github(
PATCHES
cmake-config.patch
lapacke.patch
fix_prefix.patch
)

if(NOT VCPKG_TARGET_IS_WINDOWS)
Expand Down Expand Up @@ -69,7 +70,7 @@ vcpkg_cmake_configure(

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME lapack-${VERSION} CONFIG_PATH lib/cmake/lapack-${VERSION}) #Should the target path be lapack and not lapack-reference?
vcpkg_cmake_config_fixup(PACKAGE_NAME ${PORT} CONFIG_PATH lib/cmake/lapack-${VERSION}) #Should the target path be lapack and not lapack-reference?

set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/lapack.pc")
if(EXISTS "${pcfile}")
Expand Down Expand Up @@ -129,12 +130,6 @@ endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

if(VCPKG_TARGET_IS_WINDOWS)
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/lib/lapack.lib")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/lapack.lib")
endif()
if(NOT USE_OPTIMIZED_BLAS)
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/libblas.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libblas.lib" "${CURRENT_PACKAGES_DIR}/lib/blas.lib")
Expand All @@ -156,4 +151,4 @@ configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRE
file(COPY "${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
2 changes: 1 addition & 1 deletion ports/lapack-reference/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(@CBLAS@)
find_library(CBLAS_LIBRARY_RELEASE NAMES libcblas PATHS "${CURRENT_PACKAGES_DIR}/lib" NO_DEFAULT_PATH)
find_library(CBLAS_LIBRARY_DEBUG NAMES libcblas PATHS "${CURRENT_PACKAGES_DIR}/debug/lib" NO_DEFAULT_PATH)
select_library_configurations(CBLAS)
set(LAPACK_LIBRARIES ${CBLAS_LIBRARIES} ${LAPACK_LIBRARIES})
set(LAPACK_LIBRARIES ${LAPACK_LIBRARIES})
endif()

set(CMAKE_MODULE_PATH "${LAPACK_PREV_MODULE_PATH}")
2 changes: 1 addition & 1 deletion ports/lapack-reference/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lapack-reference",
"version": "3.11.0",
"port-version": 4,
"port-version": 5,
"description": "LAPACK - Linear Algebra PACKage",
"homepage": "https://netlib.org/lapack/",
"license": "BSD-3-Clause-Open-MPI",
Expand Down
26 changes: 26 additions & 0 deletions ports/opencv4/0023-fix-no-flatbuffers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b6e382..29a81f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -756,7 +756,7 @@ include(cmake/OpenCVFindLibsVideo.cmake)
include(cmake/OpenCVFindLibsPerf.cmake)
include(cmake/OpenCVFindLAPACK.cmake)
include(cmake/OpenCVFindProtobuf.cmake)
-include(cmake/OpenCVDetectFlatbuffers.cmake)
+find_package(flatbuffers CONFIG REQUIRED)
if(WITH_TENGINE)
include(cmake/OpenCVFindTengine.cmake)
endif()
diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt
index 804b78e..86d9d45 100644
--- a/modules/dnn/CMakeLists.txt
+++ b/modules/dnn/CMakeLists.txt
@@ -133,7 +133,7 @@ if(TARGET ocv.3rdparty.flatbuffers AND OPENCV_DNN_TFLITE)
if(NOT HAVE_FLATBUFFERS)
message(FATAL_ERROR "DNN: TFLite is not supported without enabled 'flatbuffers'. Check build configuration.")
endif()
- list(APPEND libs ocv.3rdparty.flatbuffers)
+ list(APPEND libs flatbuffers::flatbuffers)
list(APPEND fw_hdrs "${CMAKE_CURRENT_LIST_DIR}/misc/tflite/schema_generated.h")
list(APPEND fw_inc "${CMAKE_CURRENT_LIST_DIR}/misc/tflite")

1 change: 1 addition & 0 deletions ports/opencv4/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ vcpkg_from_github(
0021-static-openvino.patch # https://github.com/opencv/opencv/pull/23963
"${ARM64_WINDOWS_FIX}"
0022-fix-supportqnx.patch
0023-fix-no-flatbuffers.patch
)
# Disallow accidental build of vendored copies
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/openexr")
Expand Down
2 changes: 1 addition & 1 deletion ports/opencv4/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencv4",
"version": "4.8.0",
"port-version": 15,
"port-version": 16,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",
Expand Down
17 changes: 17 additions & 0 deletions ports/openmvs/fix_no_zstd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39ec359..ee90ae6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,10 +177,8 @@ if(Boost_FOUND)
LIST(APPEND OpenMVS_DEFINITIONS -D_USE_BOOST)
ADD_DEFINITIONS(${Boost_DEFINITIONS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
- if(NOT MSVC AND DEFINED CMAKE_TOOLCHAIN_FILE)
- # work around this missing library link in vcpkg
- LIST(APPEND Boost_LIBRARIES zstd)
- endif()
+ # work around this missing library link in vcpkg
+ LIST(APPEND Boost_LIBRARIES zstd)
jimwang118 marked this conversation as resolved.
Show resolved Hide resolved
SET(_USE_BOOST TRUE)
endif()

5 changes: 3 additions & 2 deletions ports/openmvs/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO cdcseacave/openMVS
REF v2.1.0
REF "v${VERSION}"
SHA512 95d83c6694b63b6fd27657c4c5e22ddbc078d26b7324b8f17952a6c7e4547028698aa155077c0cfb916d3497ca31c365e0cbcd81f3cbe959ef40a7ee2e5cd300
HEAD_REF master
PATCHES
fix-build.patch
no-absolute-paths.patch
fix_no_zstd.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down Expand Up @@ -82,4 +83,4 @@ configure_file("${SOURCE_PATH}/MvgMvsPipeline.py.in" "${CURRENT_PACKAGES_DIR}/to
configure_file("${SOURCE_PATH}/MvgOptimizeSfM.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/MvgOptimizeSfM.py" @ONLY)
file(INSTALL "${SOURCE_PATH}/build/Modules/FindVCG.cmake" DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
2 changes: 1 addition & 1 deletion ports/openmvs/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openmvs",
"version": "2.1.0",
"port-version": 2,
"port-version": 3,
"description": "OpenMVS: open Multi-View Stereo reconstruction library",
"homepage": "https://cdcseacave.github.io/openMVS",
"license": "AGPL-3.0-only",
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4070,7 +4070,7 @@
},
"lapack-reference": {
"baseline": "3.11.0",
"port-version": 4
"port-version": 5
},
"lastools": {
"baseline": "2.0.2+20230206",
Expand Down Expand Up @@ -6430,7 +6430,7 @@
},
"opencv4": {
"baseline": "4.8.0",
"port-version": 15
"port-version": 16
},
"opendnp3": {
"baseline": "3.1.1",
Expand Down Expand Up @@ -6494,7 +6494,7 @@
},
"openmvs": {
"baseline": "2.1.0",
"port-version": 2
"port-version": 3
},
"openni2": {
"baseline": "2.2.0.33",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/lapack-reference.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "27fda0472d5bfb11fef0264ba62681f6d6b4b1d2",
"version": "3.11.0",
"port-version": 5
},
{
"git-tree": "0036813fc0d0004d8a47ec3743ab9c9c37beaac2",
"version": "3.11.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opencv4.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1818e44260c19a5524d75c66fd51af9d5857df6d",
"version": "4.8.0",
"port-version": 16
},
{
"git-tree": "ec4e040d476cee60b2fc21a1f847d30905ac9726",
"version": "4.8.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openmvs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "14cc4ac41f5710b5281e06697ac6e6cd7800377f",
"version": "2.1.0",
"port-version": 3
},
{
"git-tree": "8779bcf1acd942b029c79791b2335b252e151f20",
"version": "2.1.0",
Expand Down