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

[eigen3] Update to 3.4.0 #19665

Merged
merged 8 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
18 changes: 0 additions & 18 deletions ports/eigen3/disable_pkgconfig_absolute_path_check.patch

This file was deleted.

30 changes: 0 additions & 30 deletions ports/eigen3/fix-cuda-error.patch

This file was deleted.

24 changes: 10 additions & 14 deletions ports/eigen3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ vcpkg_from_gitlab(
GITLAB_URL https://gitlab.com
OUT_SOURCE_PATH SOURCE_PATH
REPO libeigen/eigen
REF 3.3.9
SHA512 16244cc89f2e1879543232b965cbf653b3ccf10e967c8c437a41e27d8320392bdf584d8c24b8a97406ab7d1481d5154da74e0702ec1334ae6a46de83f4573a46
REF 3.4.0
SHA512 ba75ecb760e32acf4ceaf27115468e65d4f77c44f8d519b5a13e7940af2c03a304ad433368cb6d55431f307c5c39e2666ab41d34442db3cf441638e51f5c3b6a
HEAD_REF master
PATCHES
disable_pkgconfig_absolute_path_check.patch
fix-cuda-error.patch # issue https://gitlab.com/libeigen/eigen/-/issues/1526
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DEIGEN_BUILD_PKGCONFIG=ON
Expand All @@ -26,13 +22,13 @@ vcpkg_configure_cmake(
-DPKGCONFIG_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_fixup_pkgconfig()

file(GLOB INCLUDES ${CURRENT_PACKAGES_DIR}/include/eigen3/*)
file(GLOB INCLUDES "${CURRENT_PACKAGES_DIR}/include/eigen3/*")
# Copy the eigen header files to conventional location for user-wide MSBuild integration
file(COPY ${INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
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)
file(INSTALL "${SOURCE_PATH}/COPYING.README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
15 changes: 12 additions & 3 deletions ports/eigen3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"name": "eigen3",
"version-string": "3.3.9",
"port-version": 1,
"version-semver": "3.4.0",
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
spinicist marked this conversation as resolved.
Show resolved Hide resolved
"description": "C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.",
"homepage": "http://eigen.tuxfamily.org"
"homepage": "http://eigen.tuxfamily.org",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
13 changes: 13 additions & 0 deletions ports/openmvg/0002-eigen-3.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/src/openMVG/multiview/CMakeLists.txt
+++ b/src/openMVG/multiview/CMakeLists.txt
@@ -38,6 +38,9 @@ target_include_directories(openMVG_multiview
$<INSTALL_INTERFACE:include>
)
set_target_properties(openMVG_multiview PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR} VERSION "${OPENMVG_VERSION_MAJOR}.${OPENMVG_VERSION_MINOR}")
+if (MSVC)
+ set_target_properties(openMVG_multiview PROPERTIES COMPILE_FLAGS "/bigobj")
+endif (MSVC)

add_library(openMVG_multiview_test_data ${MULTIVIEWTESTDATA})
target_link_libraries(openMVG_multiview_test_data PRIVATE openMVG_numeric openMVG_multiview)

1 change: 1 addition & 0 deletions ports/openmvg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ vcpkg_from_github(
PATCHES
build_fixes.patch
0001-eigen_3.4.0.patch
0002-eigen-3.4.patch
)

set(OpenMVG_USE_OPENMP OFF)
Expand Down
1 change: 1 addition & 0 deletions ports/openmvg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "openmvg",
"version": "2.0",
"port-version": 1,
"description": "open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.",
"dependencies": [
"cereal",
Expand Down
24 changes: 24 additions & 0 deletions ports/rtabmap/0001-add-bigobj-for-msvc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 37a2b1fe682bcea48cb944762853bec404c9e937 Mon Sep 17 00:00:00 2001
From: Amin Yahyaabadi <[email protected]>
Date: Sun, 6 Feb 2022 12:29:02 -0800
Subject: [PATCH] add bigobj for msvc

---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cdae617..ed829a46 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,6 +106,7 @@ if(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N}")
endif()
endif()
+ add_compile_options("/bigobj")
endif()

# [Eclipse] Automatic Discovery of Include directories (Optional, but handy)
--
2.35.1.windows.2

1 change: 1 addition & 0 deletions ports/rtabmap/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix-qt.patch
0001-add-bigobj-for-msvc.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion ports/rtabmap/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rtabmap",
"version": "0.20.13",
"port-version": 2,
"port-version": 3,
"description": "Real-Time Appearance-Based Mapping",
"homepage": "https://introlab.github.io/rtabmap/",
"supports": "windows & !static",
Expand Down
65 changes: 65 additions & 0 deletions ports/shogun/eigen-3.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
--- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
+++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
@@ -84,9 +84,9 @@ class CMultiPsiLine : public func_base
float64_t result=0;
for(index_t bl=0; bl<C; bl++)
{
- eigen_f.block(bl*n,0,n,1)=K*alpha->block(bl*n,0,n,1)*CMath::exp(log_scale*2.0);
- result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0;
- eigen_f.block(bl*n,0,n,1)+=eigen_m;
+ eigen_f.segment(bl*n,n)=K*alpha->segment(bl*n,n)*CMath::exp(log_scale*2.0);
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
+ result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0;
+ eigen_f.segment(bl*n,n)+=eigen_m;
}

// get first and second derivatives of log likelihood
@@ -272,7 +272,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()
{
Map<VectorXd> alpha(m_alpha.vector, m_alpha.vlen);
for(index_t bl=0; bl<C; bl++)
- eigen_mu.block(bl*n,0,n,1)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.block(bl*n,0,n,1);
+ eigen_mu.segment(bl*n,n)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.segment(bl*n,n);

//alpha'*(f-m)/2.0
Psi_New=alpha.dot(eigen_mu)/2.0;
@@ -316,7 +316,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()

for(index_t bl=0; bl<C; bl++)
{
- VectorXd eigen_sD=eigen_dpi.block(bl*n,0,n,1).cwiseSqrt();
+ VectorXd eigen_sD=eigen_dpi.segment(bl*n,n).cwiseSqrt();
LLT<MatrixXd> chol_tmp((eigen_sD*eigen_sD.transpose()).cwiseProduct(eigen_ktrtr*CMath::exp(m_log_scale*2.0))+
MatrixXd::Identity(m_ktrtr.num_rows, m_ktrtr.num_cols));
MatrixXd eigen_L_tmp=chol_tmp.matrixU();
@@ -341,11 +341,11 @@ void CMultiLaplaceInferenceMethod::update_alpha()
VectorXd tmp2=m_tmp.array().rowwise().sum();

for(index_t bl=0; bl<C; bl++)
- eigen_b.block(bl*n,0,n,1)+=eigen_dpi.block(bl*n,0,n,1).cwiseProduct(eigen_mu.block(bl*n,0,n,1)-eigen_mean_bl-tmp2);
+ eigen_b.segment(bl*n,n)+=eigen_dpi.segment(bl*n,n).cwiseProduct(eigen_mu.segment(bl*n,n)-eigen_mean_bl-tmp2);

Map<VectorXd> &eigen_c=eigen_W;
for(index_t bl=0; bl<C; bl++)
- eigen_c.block(bl*n,0,n,1)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.block(bl*n,0,n,1));
+ eigen_c.segment(bl*n,n)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.segment(bl*n,n));

Map<MatrixXd> c_tmp(eigen_c.data(),n,C);

@@ -409,7 +409,7 @@ float64_t CMultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix<float64_t
{
result+=((eigen_E.block(0,bl*n,n,n)-eigen_U.block(0,bl*n,n,n).transpose()*eigen_U.block(0,bl*n,n,n)).array()
*eigen_dK.array()).sum();
- result-=(eigen_dK*eigen_alpha.block(bl*n,0,n,1)).dot(eigen_alpha.block(bl*n,0,n,1));
+ result-=(eigen_dK*eigen_alpha.segment(bl*n,n)).dot(eigen_alpha.segment(bl*n,n));
}

return result/2.0;
@@ -489,7 +489,7 @@ SGVector<float64_t> CMultiLaplaceInferenceMethod::get_derivative_wrt_mean(
result[i]=0;
//currently only compute the explicit term
for(index_t bl=0; bl<C; bl++)
- result[i]-=eigen_alpha.block(bl*n,0,n,1).dot(eigen_dmu);
+ result[i]-=eigen_alpha.segment(bl*n,n).dot(eigen_dmu);
}

return result;
1 change: 1 addition & 0 deletions ports/shogun/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
PATCHES
cmake.patch
cmake-config.in.patch
eigen-3.4.patch
fix-dirent.patch
fix-ASSERT-not-found.patch
fix-cblas-path.patch
Expand Down
2 changes: 1 addition & 1 deletion ports/shogun/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "shogun",
"version-string": "6.1.4",
"port-version": 6,
"port-version": 7,
"description": "Unified and efficient Machine Learning",
"homepage": "https://github.com/shogun-toolbox/shogun",
"dependencies": [
Expand Down
24 changes: 24 additions & 0 deletions ports/theia/eigen-3.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- a/libraries/akaze/src/nldiffusion_functions.cpp
+++ b/libraries/akaze/src/nldiffusion_functions.cpp
@@ -222,8 +222,8 @@ void halfsample_image(const RowMatrixXf& src, RowMatrixXf& dst) {

// Do the whole resampling in one pass by using neighboring values. First, we
// compute the borders.
- const double x_kernel_size = static_cast<double>(src.cols()) / dst.cols();
- const double y_kernel_size = static_cast<double>(src.rows()) / dst.rows();
+ const int x_kernel_size = static_cast<double>(src.cols()) / dst.cols();
+ const int y_kernel_size = static_cast<double>(src.rows()) / dst.rows();

// Do simple linear interpolation.
if (x_kernel_size == 2 && y_kernel_size == 2) {
@@ -237,8 +237,8 @@ void halfsample_image(const RowMatrixXf& src, RowMatrixXf& dst) {
return;
}

- const double x_kernel_clamped_size = static_cast<int>(ceil(x_kernel_size));
- const double y_kernel_clamped_size = static_cast<int>(ceil(y_kernel_size));
+ const int x_kernel_clamped_size = static_cast<int>(ceil(static_cast<double>(src.cols()) / dst.cols()));
+ const int y_kernel_clamped_size = static_cast<int>(ceil(static_cast<double>(src.rows()) / dst.rows()));

// Set up precomputed factor matrices.
Eigen::RowVectorXf x_kernel_mul(static_cast<int>(x_kernel_clamped_size)),
1 change: 1 addition & 0 deletions ports/theia/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
PATCHES
fix-external-dependencies.patch
fix-external-dependencies2.patch
eigen-3.4.patch
)

file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake)
Expand Down
2 changes: 1 addition & 1 deletion ports/theia/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "theia",
"version-string": "0.8",
"port-version": 5,
"port-version": 6,
"description": "An open source library for multiview geometry and structure from motion",
"homepage": "https://github.com/sweeneychris/TheiaSfM",
"dependencies": [
Expand Down
12 changes: 6 additions & 6 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2005,8 +2005,8 @@
"port-version": 0
},
"eigen3": {
"baseline": "3.3.9",
"port-version": 1
"baseline": "3.4.0",
"port-version": 0
},
"elfio": {
"baseline": "3.9",
Expand Down Expand Up @@ -5054,7 +5054,7 @@
},
"openmvg": {
"baseline": "2.0",
"port-version": 0
"port-version": 1
},
"openmvs": {
"baseline": "1.1.1",
Expand Down Expand Up @@ -6158,7 +6158,7 @@
},
"rtabmap": {
"baseline": "0.20.13",
"port-version": 2
"port-version": 3
},
"rtaudio": {
"baseline": "2021-11-16",
Expand Down Expand Up @@ -6374,7 +6374,7 @@
},
"shogun": {
"baseline": "6.1.4",
"port-version": 6
"port-version": 7
},
"signalrclient": {
"baseline": "1.0.0-beta1-9",
Expand Down Expand Up @@ -6810,7 +6810,7 @@
},
"theia": {
"baseline": "0.8",
"port-version": 5
"port-version": 6
},
"think-cell-range": {
"baseline": "498839d",
Expand Down
5 changes: 5 additions & 0 deletions versions/e-/eigen3.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7eac24bc6175f264f0cc8f8c86116f5d4de518ad",
"version-semver": "3.4.0",
"port-version": 0
},
{
"git-tree": "2b845a54aa220fa4099e97be4031cb63634665e3",
"version-string": "3.3.9",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openmvg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eea9187e35c87676d442453e6942a47417d7c2dd",
"version": "2.0",
"port-version": 1
},
{
"git-tree": "08113de9c7bc1b9201be4c3a01c1c3e5a1cf5acd",
"version": "2.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/r-/rtabmap.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cf41f524585ec0c2dd5b8c7d8b455a79265b62ea",
"version": "0.20.13",
"port-version": 3
},
{
"git-tree": "3dc228c0e837f979396a930bc24e8cf92f6190e3",
"version": "0.20.13",
Expand Down
Loading