lol

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

shogun: fix build

authored by

Ryan Lahfa and committed by
GitHub
b6beee67 101fe71a

+51 -14
+31 -14
pkgs/applications/science/machine-learning/shogun/default.nix
··· 50 50 51 51 srcs = { 52 52 toolbox = fetchFromGitHub { 53 - owner = pname + "-toolbox"; 54 - repo = pname; 55 - rev = pname + "_" + version; 56 - sha256 = "05s9dclmk7x5d7wnnj4qr6r6c827m72a44gizcv09lxr28pr9inz"; 53 + owner = "shogun-toolbox"; 54 + repo = "shogun"; 55 + rev = "shogun_${version}"; 56 + sha256 = "sha256-38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc="; 57 57 fetchSubmodules = true; 58 58 }; 59 59 60 60 # The CMake external projects expect the packed archives 61 61 rxcpp = fetchurl { 62 62 url = "https://github.com/Reactive-Extensions/RxCpp/archive/v${rxcppVersion}.tar.gz"; 63 - sha256 = "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh"; 63 + sha256 = "sha256-UOc5WrG8KgAA3xJsaSCjbdPE7gSnFJay9MEK31DWUXg="; 64 64 }; 65 65 gtest = fetchurl { 66 66 url = "https://github.com/google/googletest/archive/release-${gtestVersion}.tar.gz"; 67 - sha256 = "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"; 67 + sha256 = "sha256-WKb0J3yivIVlIis7vVihd2CenEiOinJkk1m6UUUNt9g="; 68 68 }; 69 69 }; 70 70 in ··· 77 77 src = srcs.toolbox; 78 78 79 79 patches = [ 80 - # Fix compile errors with json-c 81 - # https://github.com/shogun-toolbox/shogun/pull/4104 82 - (fetchpatch { 83 - url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch"; 84 - sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s"; 85 - }) 86 - 87 80 # Fix compile errors with GCC 9+ 88 81 # https://github.com/shogun-toolbox/shogun/pull/4811 89 82 (fetchpatch { ··· 95 88 sha256 = "sha256-AgJJKQA8vc5oKaTQDqMdwBR4hT4sn9+uW0jLe7GteJw="; 96 89 }) 97 90 91 + # Fix virtual destruction 92 + (fetchpatch { 93 + url = "https://github.com/shogun-toolbox/shogun/commit/ef0e4dc1cc4a33c9e6b17a108fa38a436de2d7ee.patch"; 94 + sha256 = "sha256-a9Rm0ytqkSAgC3dguv8m3SwOSipb+VByBHHdmV0d63w="; 95 + }) 96 + ./fix-virtual-destruction.patch 97 + 98 + # Fix compile errors with json-c 99 + # https://github.com/shogun-toolbox/shogun/pull/4104 100 + (fetchpatch { 101 + url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch"; 102 + sha256 = "sha256-OhEWwrHtD/sOcjHmPY/C9zJ8ruww8yXrRcTw38nGEJU="; 103 + }) 104 + 98 105 # Fix compile errors with Eigen 3.4 99 106 ./eigen-3.4.patch 100 107 ··· 126 133 127 134 cmakeFlags = let 128 135 enableIf = cond: if cond then "ON" else "OFF"; 136 + excludeTestsRegex = lib.concatStringsSep "|" [ 137 + # sporadic segfault 138 + "TrainedModelSerialization" 139 + # broken by openblas 0.3.21 140 + "mathematics_lapack" 141 + # these take too long on CI 142 + "evaluation_cross_validation" 143 + "modelselection_combined_kernel" 144 + "modelselection_grid_search" 145 + ]; 129 146 in [ 130 147 "-DBUILD_META_EXAMPLES=ON" 131 148 "-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON" ··· 134 151 "-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=ON" 135 152 "-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=ON" 136 153 "-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=ON" 137 - "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;TrainedModelSerialization'" # Sporadic segfault 154 + "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;'${excludeTestsRegex}'" 138 155 "-DENABLE_TESTING=${enableIf doCheck}" 139 156 "-DDISABLE_META_INTEGRATION_TESTS=ON" 140 157 "-DTRAVIS_DISABLE_META_CPP=ON"
+20
pkgs/applications/science/machine-learning/shogun/fix-virtual-destruction.patch
··· 1 + From: Sebastián Mancilla <smancill@smancill.dev> 2 + Subject: Fix virtual destruction 3 + 4 + --- 5 + src/shogun/solver/LDASolver.h | 2 +- 6 + 1 file changed, 1 insertion(+), 1 deletion(-) 7 + 8 + diff --git a/src/shogun/solver/LDASolver.h b/src/shogun/solver/LDASolver.h 9 + index 9300a85c5..d500eca5d 100644 10 + --- a/src/shogun/solver/LDASolver.h 11 + +++ b/src/shogun/solver/LDASolver.h 12 + @@ -87,7 +87,7 @@ namespace shogun 13 + compute_within_cov(); 14 + } 15 + 16 + - ~LDASolver() 17 + + virtual ~LDASolver() 18 + { 19 + SG_UNREF(m_features) 20 + SG_UNREF(m_labels)