Skip to content

Commit

Permalink
[OpenMVG/OpenMVS] fix tools (#12229)
Browse files Browse the repository at this point in the history
  • Loading branch information
cenit committed Aug 28, 2020
1 parent 6800300 commit 0a506f7
Show file tree
Hide file tree
Showing 47 changed files with 2,482 additions and 2,117 deletions.
4 changes: 2 additions & 2 deletions ports/armadillo/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: armadillo
Version: 2019-04-16
Port-Version: 9
Port-Version: 10
Description: Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use
Build-Depends: openblas (!osx), lapack
Build-Depends: openblas, lapack
13 changes: 2 additions & 11 deletions ports/ceres/0001_cmakelists_fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,10 @@ index 02c72b5..62d8c59 100644
endif (MINIGLOG)

if (NOT SCHUR_SPECIALIZATIONS)
@@ -582,7 +562,7 @@ include_directories(
# Note that this is *not* propagated to clients, ie CERES_INCLUDE_DIRS
# used by clients after find_package(Ceres) does not identify Eigen as
# as system headers.
-include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS})
+include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}/Eigen)

if (SUITESPARSE)
include_directories(${SUITESPARSE_INCLUDE_DIRS})
@@ -917,8 +897,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake"
@@ -917,8 +897,5 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake"
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake"
"${Ceres_SOURCE_DIR}/cmake/FindEigen.cmake"
- "${Ceres_SOURCE_DIR}/cmake/FindEigen.cmake"
- "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake"
- "${Ceres_SOURCE_DIR}/cmake/FindGflags.cmake"
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
Expand Down
22 changes: 0 additions & 22 deletions ports/ceres/0004_blas_linux_fix.patch

This file was deleted.

122 changes: 122 additions & 0 deletions ports/ceres/0004_fix_find_eigen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7033de0..5235baa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -209,40 +209,40 @@ endif (IOS)
unset(CERES_COMPILE_OPTIONS)

# Eigen.
-find_package(Eigen REQUIRED)
-if (EIGEN_FOUND)
- message("-- Found Eigen version ${EIGEN_VERSION}: ${EIGEN_INCLUDE_DIRS}")
- if (EIGEN_VERSION VERSION_LESS 3.1.0)
+find_package(Eigen3 REQUIRED)
+if (EIGEN3_FOUND)
+ message(STATUS "Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}")
+ if (EIGEN3_VERSION_STRING VERSION_LESS 3.1.0)
message(FATAL_ERROR "-- Ceres requires Eigen version >= 3.1.0 in order "
"that Eigen/SparseCore be available, detected version of Eigen is: "
- "${EIGEN_VERSION}")
- endif (EIGEN_VERSION VERSION_LESS 3.1.0)
+ "${EIGEN3_VERSION_STRING}")
+ endif (EIGEN3_VERSION_STRING VERSION_LESS 3.1.0)

if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)" AND
- EIGEN_VERSION VERSION_LESS 3.3.4)
+ EIGEN3_VERSION_STRING VERSION_LESS 3.3.4)
# As per issue #289: https://github.com/ceres-solver/ceres-solver/issues/289
# the bundle_adjustment_test will fail for Eigen < 3.3.4 on aarch64.
message(FATAL_ERROR "-- Ceres requires Eigen version >= 3.3.4 on aarch64. "
- "Detected version of Eigen is: ${EIGEN_VERSION}.")
+ "Detected version of Eigen is: ${EIGEN3_VERSION_STRING}.")
endif()

if (EIGENSPARSE)
- message("-- Enabling use of Eigen as a sparse linear algebra library.")
+ message(STATUS "Enabling use of Eigen as a sparse linear algebra library.")
list(APPEND CERES_COMPILE_OPTIONS CERES_USE_EIGEN_SPARSE)
- if (EIGEN_VERSION VERSION_LESS 3.2.2)
+ if (EIGEN3_VERSION_STRING VERSION_LESS 3.2.2)
message(" WARNING:")
message("")
- message(" Your version of Eigen (${EIGEN_VERSION}) is older than ")
+ message(" Your version of Eigen (${EIGEN3_VERSION_STRING}) is older than ")
message(" version 3.2.2. The performance of SPARSE_NORMAL_CHOLESKY ")
message(" and SPARSE_SCHUR linear solvers will suffer.")
- endif (EIGEN_VERSION VERSION_LESS 3.2.2)
+ endif (EIGEN3_VERSION_STRING VERSION_LESS 3.2.2)
else (EIGENSPARSE)
message("-- Disabling use of Eigen as a sparse linear algebra library.")
message(" This does not affect the covariance estimation algorithm ")
message(" which can still use the EIGEN_SPARSE_QR algorithm.")
add_definitions(-DEIGEN_MPL2_ONLY)
endif (EIGENSPARSE)
-endif (EIGEN_FOUND)
+endif (EIGEN3_FOUND)

if (LAPACK)
find_package(LAPACK QUIET)
@@ -562,7 +562,7 @@ include_directories(
# Note that this is *not* propagated to clients, ie CERES_INCLUDE_DIRS
# used by clients after find_package(Ceres) does not identify Eigen as
# as system headers.
-include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS})
+include_directories(${EIGEN3_INCLUDE_DIRS})

if (SUITESPARSE)
include_directories(${SUITESPARSE_INCLUDE_DIRS})
diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in
index c4ed71f..b3d6a17 100644
--- a/cmake/CeresConfig.cmake.in
+++ b/cmake/CeresConfig.cmake.in
@@ -202,39 +202,39 @@ set(CERES_VERSION @CERES_VERSION@ )

# Eigen.
# Flag set during configuration and build of Ceres.
-set(CERES_EIGEN_VERSION @EIGEN_VERSION@)
+set(CERES_EIGEN_VERSION @EIGEN3_VERSION_STRING@)
set(EIGEN_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_EIGEN_CMAKE_CONFIGURATION@)
# Append the locations of Eigen when Ceres was built to the search path hints.
if (EIGEN_WAS_BUILT_WITH_CMAKE)
set(Eigen3_DIR @Eigen3_DIR@)
set(EIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION TRUE)
else()
- list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN_INCLUDE_DIR@)
+ list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN3_INCLUDE_DIR@)
endif()
# Search quietly to control the timing of the error message if not found. The
# search should be for an exact match, but for usability reasons do a soft
# match and reject with an explanation below.
-find_package(Eigen ${CERES_EIGEN_VERSION} QUIET)
-if (EIGEN_FOUND)
- if (NOT EIGEN_VERSION VERSION_EQUAL CERES_EIGEN_VERSION)
+find_package(Eigen3 ${CERES_EIGEN_VERSION} QUIET)
+if (EIGEN3_FOUND)
+ if (NOT EIGEN3_VERSION_STRING VERSION_EQUAL CERES_EIGEN_VERSION)
# CMake's VERSION check in FIND_PACKAGE() will accept any version >= the
# specified version. However, only version = is supported. Improve
# usability by explaining why we don't accept non-exact version matching.
ceres_report_not_found("Found Eigen dependency, but the version of Eigen "
- "found (${EIGEN_VERSION}) does not exactly match the version of Eigen "
+ "found (${EIGEN3_VERSION_STRING}) does not exactly match the version of Eigen "
"Ceres was compiled with (${CERES_EIGEN_VERSION}). This can cause subtle "
"bugs by triggering violations of the One Definition Rule. See the "
"Wikipedia article http://en.wikipedia.org/wiki/One_Definition_Rule "
"for more details")
endif ()
message(STATUS "Found required Ceres dependency: "
- "Eigen version ${CERES_EIGEN_VERSION} in ${EIGEN_INCLUDE_DIRS}")
-else (EIGEN_FOUND)
+ "Eigen version ${CERES_EIGEN_VERSION} in ${EIGEN3_INCLUDE_DIRS}")
+else (EIGEN3_FOUND)
ceres_report_not_found("Missing required Ceres "
"dependency: Eigen version ${CERES_EIGEN_VERSION}, please set "
- "EIGEN_INCLUDE_DIR.")
-endif (EIGEN_FOUND)
-list(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})
+ "EIGEN3_INCLUDE_DIR.")
+endif (EIGEN3_FOUND)
+list(APPEND CERES_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})

# Glog.
include (CMakeFindDependencyMacro)
2 changes: 1 addition & 1 deletion ports/ceres/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: ceres
Version: 1.14.0
Port-Version: 8
Port-Version: 9
Build-Depends: glog, eigen3
Homepage: https://github.com/ceres-solver/ceres-solver
Description: non-linear optimization package
Expand Down
19 changes: 6 additions & 13 deletions ports/ceres/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ if(VCPKG_CRT_LINKAGE STREQUAL "static")
set(MSVC_USE_STATIC_CRT_VALUE ON)
endif()

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(ADDITIONAL_PATCH "0004_blas_linux_fix.patch")
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ceres-solver/ceres-solver
Expand All @@ -20,15 +16,14 @@ vcpkg_from_github(
0001_cmakelists_fixes.patch
0002_use_glog_target.patch
0003_fix_exported_ceres_config.patch
${ADDITIONAL_PATCH}
0004_fix_find_eigen.patch
)

file(REMOVE ${SOURCE_PATH}/cmake/FindCXSparse.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/FindGflags.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake)
#file(REMOVE ${SOURCE_PATH}/cmake/FindEigen.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/FindEigen.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake)
#file(REMOVE ${SOURCE_PATH}/cmake/FindTBB.cmake)


vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"suitesparse" SUITESPARSE
Expand All @@ -52,7 +47,7 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_fixup_cmake_targets(CONFIG_PATH CMake)
else()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib${LIB_SUFFIX}/cmake/Ceres)
Expand All @@ -61,7 +56,7 @@ endif()
vcpkg_copy_pdbs()

# Changes target search path
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(VCPKG_TARGET_IS_WINDOWS)
file(READ ${CURRENT_PACKAGES_DIR}/share/ceres/CeresConfig.cmake CERES_TARGETS)
string(REPLACE "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${CERES_CURRENT_CONFIG_DIR}/../"
"get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${CERES_CURRENT_CONFIG_DIR}/../../" CERES_TARGETS "${CERES_TARGETS}")
Expand All @@ -77,6 +72,4 @@ endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# Handle copyright of suitesparse and metis
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ceres)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ceres/LICENSE ${CURRENT_PACKAGES_DIR}/share/ceres/copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
4 changes: 2 additions & 2 deletions ports/dlib/CONTROL
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: dlib
Version: 19.21
Port-Version: 2
Build-Depends: libjpeg-turbo, libpng, openblas (!osx), lapack
Port-Version: 3
Build-Depends: libjpeg-turbo, libpng, openblas, lapack
Homepage: https://github.com/davisking/dlib
Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++
Default-Features: fftw3, sqlite3
Expand Down
2 changes: 1 addition & 1 deletion ports/eigen3/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: eigen3
Version: 3.3.7
Port-Version: 6
Port-Version: 7
Homepage: http://eigen.tuxfamily.org
Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
11 changes: 2 additions & 9 deletions ports/eigen3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ vcpkg_configure_cmake(
)

vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)

vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/eigen3/Eigen3Targets.cmake
"set(_IMPORT_PREFIX " "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}/../..\" ABSOLUTE) #"
)

vcpkg_fixup_cmake_targets()
vcpkg_fixup_pkgconfig()

file(GLOB INCLUDES ${CURRENT_PACKAGES_DIR}/include/eigen3/*)
file(COPY ${INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)

file(INSTALL ${SOURCE_PATH}/COPYING.README DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
5 changes: 2 additions & 3 deletions ports/ensmallen/CONTROL
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Source: ensmallen
Version: 2.11.2
Port-Version: 1
Port-Version: 2
Homepage: https://github.com/mlpack/ensmallen
Description: A header-only C++ library for mathematical optimization.
Build-Depends: openblas (!osx), lapack, armadillo

Build-Depends: openblas, lapack, armadillo
3 changes: 2 additions & 1 deletion ports/geogram/CONTROL
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Source: geogram
Version: 1.7.5
Port-Version: 1
Homepage: https://gforge.inria.fr/projects/geogram/
Description: Geogram is a programming library of geometric algorithms.
Build-Depends: openblas (!osx), lapack
Build-Depends: openblas, lapack

Feature: graphics
Description: Build viewers and geogram_gfx library.
Expand Down
2 changes: 1 addition & 1 deletion ports/lapack-reference/FindLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ if(BLAS_FOUND)
LAPACK
cheev
""
"lapack;-lm;-lgfortran"
"lapack;m;gfortran"
""
""
""
Expand Down
4 changes: 2 additions & 2 deletions ports/lapack/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: lapack
Version: 1
Version: 2
Description: Metapackage for packages which provide LAPACK
Build-Depends: clapack ((arm&windows)|uwp), lapack-reference(!uwp&!(arm&windows))
Build-Depends: clapack ((arm&windows)|uwp), lapack-reference(!uwp&!(arm&windows))
Loading

0 comments on commit 0a506f7

Please sign in to comment.