shogun: 6.0.0 -> 6.1.4
Also migrate to opencv3 to address #72739, the PR didn't build for me. Disable testing and ccache since they were broken. Co-authored-by: Robert Scott <code@humanleg.org.uk>
This commit is contained in:
parent
922648ecb2
commit
9b6faedb18
|
@ -1,8 +1,8 @@
|
||||||
{ stdenv, lib, fetchFromGitHub, fetchpatch, ccache, cmake, ctags, swig
|
{ stdenv, lib, fetchFromGitHub, fetchpatch, fetchurl, cmake, ctags, swig
|
||||||
# data, compression
|
# data, compression
|
||||||
, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
|
, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
|
||||||
# maths
|
# maths
|
||||||
, openblasCompat, eigen, nlopt, lp_solve, colpack
|
, openblasCompat, eigen, nlopt, lp_solve, colpack, liblapack, glpk
|
||||||
# libraries
|
# libraries
|
||||||
, libarchive, libxml2
|
, libarchive, libxml2
|
||||||
# extra support
|
# extra support
|
||||||
|
@ -13,47 +13,79 @@
|
||||||
assert pythonSupport -> pythonPackages != null;
|
assert pythonSupport -> pythonPackages != null;
|
||||||
assert opencvSupport -> opencv != null;
|
assert opencvSupport -> opencv != null;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
pname = "shogun";
|
pname = "shogun";
|
||||||
version = "6.0.0";
|
version = "6.1.4";
|
||||||
|
rxcppVersion = "4.0.0";
|
||||||
src = fetchFromGitHub {
|
gtestVersion = "1.8.0";
|
||||||
owner = pname + "-toolbox";
|
srcs = {
|
||||||
repo = pname;
|
toolbox = fetchFromGitHub {
|
||||||
rev = pname + "_" + version;
|
owner = pname + "-toolbox";
|
||||||
sha256 = "0f2zwzvn5apvwypkfkq371xp7c5bdb4g1fwqfh8c2d57ysjxhmgf";
|
repo = pname;
|
||||||
fetchSubmodules = true;
|
rev = pname + "_" + version;
|
||||||
|
sha256 = "38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc=";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
# we need the packed archive
|
||||||
|
rxcpp = fetchurl {
|
||||||
|
url = "https://github.com/Reactive-Extensions/RxCpp/archive/v${rxcppVersion}.tar.gz";
|
||||||
|
sha256 = "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh";
|
||||||
|
};
|
||||||
|
gtest = fetchurl {
|
||||||
|
url = "https://github.com/google/googletest/archive/release-${gtestVersion}.tar.gz";
|
||||||
|
sha256 = "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
|
||||||
|
inherit pname version;
|
||||||
|
|
||||||
|
src = srcs.toolbox;
|
||||||
|
|
||||||
|
postUnpack = ''
|
||||||
|
mkdir -p $sourceRoot/third_party/{rxcpp,gtest}
|
||||||
|
ln -s ${srcs.rxcpp} $sourceRoot/third_party/rxcpp/v${rxcppVersion}.tar.gz
|
||||||
|
ln -s ${srcs.gtest} $sourceRoot/third_party/gtest/release-${gtestVersion}.tar.gz
|
||||||
|
'';
|
||||||
|
|
||||||
|
# broken
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
(fetchpatch {
|
|
||||||
name = "Fix-meta-example-parser-bug-in-parallel-builds.patch";
|
|
||||||
url = "https://github.com/shogun-toolbox/shogun/commit/ecd6a8f11ac52748e89d27c7fab7f43c1de39f05.patch";
|
|
||||||
sha256 = "1hrwwrj78sxhwcvgaz7n4kvh5y9snfcc4jf5xpgji5hjymnl311n";
|
|
||||||
})
|
|
||||||
(fetchpatch {
|
(fetchpatch {
|
||||||
url = "https://github.com/awild82/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
|
url = "https://github.com/awild82/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
|
||||||
sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s";
|
sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
CCACHE_DISABLE="1";
|
||||||
CCACHE_DIR=".ccache";
|
CCACHE_DIR=".ccache";
|
||||||
|
|
||||||
buildInputs = with lib; [
|
buildInputs = with lib; [
|
||||||
openblasCompat bzip2 ccache cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
|
openblasCompat bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
|
||||||
protobuf nlopt snappy swig (libarchive.dev) libxml2
|
protobuf nlopt snappy swig (libarchive.dev) libxml2 liblapack glpk
|
||||||
]
|
]
|
||||||
++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
|
++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
|
||||||
++ optional (opencvSupport) opencv;
|
++ optional (opencvSupport) opencv;
|
||||||
|
|
||||||
cmakeFlags = with lib; []
|
NIX_CFLAGS_COMPILE="-faligned-new";
|
||||||
++ (optional (pythonSupport) "-DPythonModular=ON")
|
|
||||||
++ (optional (opencvSupport) "-DOpenCV=ON")
|
|
||||||
;
|
|
||||||
|
|
||||||
# Previous attempts to fix parallel builds (see patch above) were not entirely successful.
|
cmakeFlags =
|
||||||
# Sporadic build failures still exist. Dislable parallel builds for now.
|
let
|
||||||
enableParallelBuilding = false;
|
onOff = b: if b then "ON" else "OFF";
|
||||||
|
flag = n: b: "-D"+n+"="+onOff b;
|
||||||
|
in
|
||||||
|
with lib; [
|
||||||
|
(flag "ENABLE_TESTING" doCheck)
|
||||||
|
(flag "BUILD_META_EXAMPLES" doCheck)
|
||||||
|
(flag "CMAKE_VERBOSE_MAKEFILE:BOOL" doCheck)
|
||||||
|
(flag "PythonModular" pythonSupport)
|
||||||
|
(flag "OpenCV" opencvSupport)
|
||||||
|
];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "A toolbox which offers a wide range of efficient and unified machine learning methods";
|
description = "A toolbox which offers a wide range of efficient and unified machine learning methods";
|
||||||
|
|
|
@ -20608,6 +20608,15 @@ in
|
||||||
|
|
||||||
shogun = callPackage ../applications/science/machine-learning/shogun {
|
shogun = callPackage ../applications/science/machine-learning/shogun {
|
||||||
stdenv = gcc8Stdenv;
|
stdenv = gcc8Stdenv;
|
||||||
|
|
||||||
|
# Workaround for the glibc abi version mismatch.
|
||||||
|
# Please note that opencv builds are by default disabled.
|
||||||
|
opencv = opencv3.override {
|
||||||
|
stdenv = gcc8Stdenv;
|
||||||
|
openexr = openexr.override {
|
||||||
|
stdenv = gcc8Stdenv;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
sky = callPackage ../applications/networking/instant-messengers/sky {};
|
sky = callPackage ../applications/networking/instant-messengers/sky {};
|
||||||
|
|
Loading…
Reference in New Issue