early-access version 2853
This commit is contained in:
11
externals/vcpkg/ports/shogun/cmake-config.in.patch
vendored
Executable file
11
externals/vcpkg/ports/shogun/cmake-config.in.patch
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
diff --git a/cmake/ShogunConfig.cmake.in b/cmake/ShogunConfig.cmake.in
|
||||
index e8e8035..a5097cb 100644
|
||||
--- a/cmake/ShogunConfig.cmake.in
|
||||
+++ b/cmake/ShogunConfig.cmake.in
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
set_and_check(shogun_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
|
||||
|
||||
-include("@PACKAGE_CONFIG_PACKAGE_DIR@/ShogunTargets.cmake")
|
||||
+include("@PACKAGE_CONFIG_PACKAGE_DIR@/../../../share/shogun/ShogunTargets.cmake")
|
||||
check_required_components(shogun)
|
||||
73
externals/vcpkg/ports/shogun/cmake.patch
vendored
Executable file
73
externals/vcpkg/ports/shogun/cmake.patch
vendored
Executable file
@@ -0,0 +1,73 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 6c48bed..6f97c8b 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -60,8 +60,8 @@ SET(SYSTEM_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
SET(SYSTEM_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UC)
|
||||
IF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION"))
|
||||
- SET(CMAKE_C_FLAGS "")
|
||||
- SET(CMAKE_CXX_FLAGS "")
|
||||
+# SET(CMAKE_C_FLAGS "")
|
||||
+# SET(CMAKE_CXX_FLAGS "")
|
||||
ENDIF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION"))
|
||||
|
||||
# CCACHE
|
||||
@@ -184,12 +184,12 @@ SET(SWIG_CXX_COMPILER_FLAGS "-O0 -g")
|
||||
SET(CMAKE_C_FLAGS "${COMPILER_WARNINGS} ${CMAKE_C_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${COMPILER_WARNINGS} ${CMAKE_CXX_FLAGS}")
|
||||
IF(MSVC)
|
||||
- SET(CMAKE_C_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}")
|
||||
- SET(CMAKE_CXX_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}")
|
||||
- SET(CMAKE_C_FLAGS_DISTRIBUTION "/Ot")
|
||||
- SET(CMAKE_CXX_FLAGS_DISTRIBUTION "/Ot")
|
||||
- SET(CMAKE_C_FLAGS_DEBUG "/DEBUG /Od /Zi")
|
||||
- SET(CMAKE_CXX_FLAGS_DEBUG "/DEBUG /Od /Zi")
|
||||
+ # SET(CMAKE_C_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}")
|
||||
+ # SET(CMAKE_CXX_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}")
|
||||
+ # SET(CMAKE_C_FLAGS_DISTRIBUTION "/Ot")
|
||||
+ # SET(CMAKE_CXX_FLAGS_DISTRIBUTION "/Ot")
|
||||
+ # SET(CMAKE_C_FLAGS_DEBUG "/DEBUG /Od /Zi")
|
||||
+ # SET(CMAKE_CXX_FLAGS_DEBUG "/DEBUG /Od /Zi")
|
||||
add_compile_options("/bigobj")
|
||||
ELSE()
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}")
|
||||
diff --git a/cmake/version.cmake b/cmake/version.cmake
|
||||
index fbca111..f6847f7 100644
|
||||
--- a/cmake/version.cmake
|
||||
+++ b/cmake/version.cmake
|
||||
@@ -5,7 +5,7 @@ SET(MAINVERSION ${VERSION})
|
||||
|
||||
SET(EXTRA "")
|
||||
|
||||
-IF(EXISTS "${ROOT_DIR}/.git/")
|
||||
+IF(EXISTS "${ROOT_DIR}/.git/" AND FALSE)
|
||||
FIND_PACKAGE(Git QUIET)
|
||||
IF (NOT GIT_FOUND)
|
||||
MESSAGE(FATAL_ERROR "The source is checked out from a git repository, but cannot find git executable!")
|
||||
diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt
|
||||
index 9e79786..fd76961 100644
|
||||
--- a/src/shogun/CMakeLists.txt
|
||||
+++ b/src/shogun/CMakeLists.txt
|
||||
@@ -145,7 +145,7 @@ endif()
|
||||
# add target for static library if enabled
|
||||
if (LIBSHOGUN_BUILD_STATIC)
|
||||
add_library(shogun-static STATIC $<TARGET_OBJECTS:libshogun> ${CMAKE_CURRENT_BINARY_DIR}/lib/config.h)
|
||||
- set_property(TARGET shogun-static PROPERTY OUTPUT_NAME shogun)
|
||||
+ set_property(TARGET shogun-static PROPERTY OUTPUT_NAME libshogun)
|
||||
target_include_directories(shogun-static PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||
@@ -492,10 +492,12 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
# set the desidered targets to be installed
|
||||
+if(NOT INSTALL_TARGETS)
|
||||
set(INSTALL_TARGETS shogun)
|
||||
if (LIBSHOGUN_BUILD_STATIC)
|
||||
LIST(APPEND INSTALL_TARGETS shogun-static)
|
||||
endif()
|
||||
+endif()
|
||||
|
||||
INSTALL(
|
||||
TARGETS ${INSTALL_TARGETS}
|
||||
65
externals/vcpkg/ports/shogun/eigen-3.4.patch
vendored
Executable file
65
externals/vcpkg/ports/shogun/eigen-3.4.patch
vendored
Executable file
@@ -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);
|
||||
+ 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;
|
||||
12
externals/vcpkg/ports/shogun/fix-ASSERT-not-found.patch
vendored
Executable file
12
externals/vcpkg/ports/shogun/fix-ASSERT-not-found.patch
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
diff --git a/src/shogun/base/Parallel.cpp b/src/shogun/base/Parallel.cpp
|
||||
index 78ba319..53ac6c0 100644
|
||||
--- a/src/shogun/base/Parallel.cpp
|
||||
+++ b/src/shogun/base/Parallel.cpp
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <shogun/lib/RefCount.h>
|
||||
#include <shogun/lib/config.h>
|
||||
#include <shogun/lib/memory.h>
|
||||
+#include <shogun/io/SGIO.h>
|
||||
|
||||
#ifdef HAVE_CXX11
|
||||
#include <thread>
|
||||
13
externals/vcpkg/ports/shogun/fix-cblas-path.patch
vendored
Executable file
13
externals/vcpkg/ports/shogun/fix-cblas-path.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/shogun/mathematics/lapack.h b/src/shogun/mathematics/lapack.h
|
||||
index 6ba466f..f5de479 100644
|
||||
--- a/src/shogun/mathematics/lapack.h
|
||||
+++ b/src/shogun/mathematics/lapack.h
|
||||
@@ -38,7 +38,7 @@ extern "C" {
|
||||
#include <vecLib/cblas.h>
|
||||
#endif
|
||||
#else
|
||||
-#include <cblas.h>
|
||||
+#include <openblas/cblas.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ACML
|
||||
17
externals/vcpkg/ports/shogun/fix-dirent.patch
vendored
Executable file
17
externals/vcpkg/ports/shogun/fix-dirent.patch
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt
|
||||
index fd76961..396251c 100644
|
||||
--- a/src/shogun/CMakeLists.txt
|
||||
+++ b/src/shogun/CMakeLists.txt
|
||||
@@ -170,10 +170,10 @@ IF(MSVC)
|
||||
ENDIF()
|
||||
|
||||
# bundle dirent
|
||||
- include(external/MSDirent)
|
||||
+ find_path(MSDIRENT_INCLUDE_DIR NAMES dirent.h)
|
||||
SHOGUN_INCLUDE_DIRS(SCOPE PUBLIC
|
||||
$<BUILD_INTERFACE:${MSDIRENT_INCLUDE_DIR}>
|
||||
- $<INSTALL_INTERFACE:include/shogun/lib/external/MSDirent>
|
||||
+ $<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
target_link_libraries(shogun PUBLIC winmm)
|
||||
61
externals/vcpkg/ports/shogun/portfile.cmake
vendored
Executable file
61
externals/vcpkg/ports/shogun/portfile.cmake
vendored
Executable file
@@ -0,0 +1,61 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO shogun-toolbox/shogun
|
||||
REF ab274e7ab6bf24dd598c1daf1e626cb686d6e1cc
|
||||
SHA512 fb90e5bf802c6fd59bf35ab7bbde5e8cfcdc5d46c69c52097140b30c6b29e28b8341dd1ece7f8a1f9d9123f4bc06d44d288584ce7dfddccf3d33fe05106884ae
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
cmake.patch
|
||||
cmake-config.in.patch
|
||||
eigen-3.4.patch
|
||||
fix-dirent.patch
|
||||
fix-ASSERT-not-found.patch
|
||||
fix-cblas-path.patch
|
||||
)
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
||||
vcpkg_add_to_path(${PYTHON3_DIR})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBUILD_META_EXAMPLES=OFF
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DUSE_SVMLIGHT=OFF
|
||||
-DENABLE_TESTING=OFF
|
||||
-DLICENSE_GPL_SHOGUN=OFF
|
||||
-DLIBSHOGUN_BUILD_STATIC=ON
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_JSON=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_GLPK=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_CPLEX=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_LpSolve=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_ColPack=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_ARPREC=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Ctags=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_CCache=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_CURL=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE
|
||||
-DINSTALL_TARGETS=shogun-static
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/shogun)
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
# This directory is empty given the settings above
|
||||
${CURRENT_PACKAGES_DIR}/include/shogun/mathematics/linalg/backend
|
||||
${CURRENT_PACKAGES_DIR}/debug/include
|
||||
${CURRENT_PACKAGES_DIR}/debug/share
|
||||
)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
22
externals/vcpkg/ports/shogun/vcpkg.json
vendored
Executable file
22
externals/vcpkg/ports/shogun/vcpkg.json
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "shogun",
|
||||
"version-string": "6.1.4",
|
||||
"port-version": 7,
|
||||
"description": "Unified and efficient Machine Learning",
|
||||
"homepage": "https://github.com/shogun-toolbox/shogun",
|
||||
"dependencies": [
|
||||
"blas",
|
||||
"bzip2",
|
||||
"curl",
|
||||
"dirent",
|
||||
"eigen3",
|
||||
"liblzma",
|
||||
"libxml2",
|
||||
"lzo",
|
||||
"nlopt",
|
||||
"protobuf",
|
||||
"rxcpp",
|
||||
"snappy",
|
||||
"zlib"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user