Merge pull request #233336 from smancill/shogun-fix-build

shogun: fix build
This commit is contained in:
Ryan Lahfa 2023-05-22 13:47:52 +02:00 committed by GitHub
commit b6beee67f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 14 deletions

View file

@ -50,21 +50,21 @@ let
srcs = {
toolbox = fetchFromGitHub {
owner = pname + "-toolbox";
repo = pname;
rev = pname + "_" + version;
sha256 = "05s9dclmk7x5d7wnnj4qr6r6c827m72a44gizcv09lxr28pr9inz";
owner = "shogun-toolbox";
repo = "shogun";
rev = "shogun_${version}";
sha256 = "sha256-38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc=";
fetchSubmodules = true;
};
# The CMake external projects expect the packed archives
rxcpp = fetchurl {
url = "https://github.com/Reactive-Extensions/RxCpp/archive/v${rxcppVersion}.tar.gz";
sha256 = "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh";
sha256 = "sha256-UOc5WrG8KgAA3xJsaSCjbdPE7gSnFJay9MEK31DWUXg=";
};
gtest = fetchurl {
url = "https://github.com/google/googletest/archive/release-${gtestVersion}.tar.gz";
sha256 = "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq";
sha256 = "sha256-WKb0J3yivIVlIis7vVihd2CenEiOinJkk1m6UUUNt9g=";
};
};
in
@ -77,13 +77,6 @@ stdenv.mkDerivation rec {
src = srcs.toolbox;
patches = [
# Fix compile errors with json-c
# https://github.com/shogun-toolbox/shogun/pull/4104
(fetchpatch {
url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s";
})
# Fix compile errors with GCC 9+
# https://github.com/shogun-toolbox/shogun/pull/4811
(fetchpatch {
@ -95,6 +88,20 @@ stdenv.mkDerivation rec {
sha256 = "sha256-AgJJKQA8vc5oKaTQDqMdwBR4hT4sn9+uW0jLe7GteJw=";
})
# Fix virtual destruction
(fetchpatch {
url = "https://github.com/shogun-toolbox/shogun/commit/ef0e4dc1cc4a33c9e6b17a108fa38a436de2d7ee.patch";
sha256 = "sha256-a9Rm0ytqkSAgC3dguv8m3SwOSipb+VByBHHdmV0d63w=";
})
./fix-virtual-destruction.patch
# Fix compile errors with json-c
# https://github.com/shogun-toolbox/shogun/pull/4104
(fetchpatch {
url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
sha256 = "sha256-OhEWwrHtD/sOcjHmPY/C9zJ8ruww8yXrRcTw38nGEJU=";
})
# Fix compile errors with Eigen 3.4
./eigen-3.4.patch
@ -126,6 +133,16 @@ stdenv.mkDerivation rec {
cmakeFlags = let
enableIf = cond: if cond then "ON" else "OFF";
excludeTestsRegex = lib.concatStringsSep "|" [
# sporadic segfault
"TrainedModelSerialization"
# broken by openblas 0.3.21
"mathematics_lapack"
# these take too long on CI
"evaluation_cross_validation"
"modelselection_combined_kernel"
"modelselection_grid_search"
];
in [
"-DBUILD_META_EXAMPLES=ON"
"-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON"
@ -134,7 +151,7 @@ stdenv.mkDerivation rec {
"-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=ON"
"-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=ON"
"-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=ON"
"-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;TrainedModelSerialization'" # Sporadic segfault
"-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;'${excludeTestsRegex}'"
"-DENABLE_TESTING=${enableIf doCheck}"
"-DDISABLE_META_INTEGRATION_TESTS=ON"
"-DTRAVIS_DISABLE_META_CPP=ON"

View file

@ -0,0 +1,20 @@
From: Sebastián Mancilla <smancill@smancill.dev>
Subject: Fix virtual destruction
---
src/shogun/solver/LDASolver.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shogun/solver/LDASolver.h b/src/shogun/solver/LDASolver.h
index 9300a85c5..d500eca5d 100644
--- a/src/shogun/solver/LDASolver.h
+++ b/src/shogun/solver/LDASolver.h
@@ -87,7 +87,7 @@ namespace shogun
compute_within_cov();
}
- ~LDASolver()
+ virtual ~LDASolver()
{
SG_UNREF(m_features)
SG_UNREF(m_labels)