summaryrefslogtreecommitdiff
path: root/pcr/shogun
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2019-02-21 22:26:26 +0100
committerAndreas Grapentin <andreas@grapentin.org>2019-02-21 22:26:26 +0100
commit06f822fcf38a75025df0dba0209706e260f2ad5d (patch)
treeea87109f54cd4cbcea25ffd8518e8be580f03bc1 /pcr/shogun
parent4ab79b36e05d98ca24fb42a7b3236290c250ab24 (diff)
downloadabslibre-06f822fcf38a75025df0dba0209706e260f2ad5d.tar.gz
abslibre-06f822fcf38a75025df0dba0209706e260f2ad5d.tar.bz2
abslibre-06f822fcf38a75025df0dba0209706e260f2ad5d.zip
pcr/shogun: updated to 6.1.3
Diffstat (limited to 'pcr/shogun')
-rw-r--r--pcr/shogun/0001-Removed-is_error-macro-dependency-4098.patch169
-rw-r--r--pcr/shogun/PKGBUILD85
2 files changed, 236 insertions, 18 deletions
diff --git a/pcr/shogun/0001-Removed-is_error-macro-dependency-4098.patch b/pcr/shogun/0001-Removed-is_error-macro-dependency-4098.patch
new file mode 100644
index 000000000..89a7f9ffb
--- /dev/null
+++ b/pcr/shogun/0001-Removed-is_error-macro-dependency-4098.patch
@@ -0,0 +1,169 @@
+From 365ce4c4c700736d2eec8ba6c975327a5ac2cd9b Mon Sep 17 00:00:00 2001
+From: Andrew Wildman <apw4@uw.edu>
+Date: Mon, 22 Jan 2018 22:56:29 -0800
+Subject: [PATCH] Removed is_error macro dependency (#4098)
+
+---
+ src/shogun/io/NeuralNetworkFileReader.cpp | 4 ++--
+ src/shogun/io/SerializableJsonFile.cpp | 27 +++++++++++-----------
+ src/shogun/io/SerializableJsonReader00.cpp | 6 +++--
+ 3 files changed, 19 insertions(+), 18 deletions(-)
+
+diff --git a/src/shogun/io/NeuralNetworkFileReader.cpp b/src/shogun/io/NeuralNetworkFileReader.cpp
+index be90fddf3..d4d5f5d4a 100644
+--- a/src/shogun/io/NeuralNetworkFileReader.cpp
++++ b/src/shogun/io/NeuralNetworkFileReader.cpp
+@@ -51,7 +51,7 @@ CNeuralNetwork* CNeuralNetworkFileReader::read_file(const char* file_path)
+ {
+ json_object* json_network = json_object_from_file(file_path);
+
+- if (is_error(json_network))
++ if (json_network == nullptr)
+ {
+ SG_ERROR("Error while opening file: %s!\n", file_path);
+ return NULL;
+@@ -68,7 +68,7 @@ CNeuralNetwork* CNeuralNetworkFileReader::read_string(const char* str)
+ {
+ json_object* json_network = json_tokener_parse(str);
+
+- if (is_error(json_network))
++ if (json_network == nullptr)
+ {
+ SG_ERROR("Error while parsing the given string\n");
+ return NULL;
+diff --git a/src/shogun/io/SerializableJsonFile.cpp b/src/shogun/io/SerializableJsonFile.cpp
+index 901c4bf44..af00971c0 100644
+--- a/src/shogun/io/SerializableJsonFile.cpp
++++ b/src/shogun/io/SerializableJsonFile.cpp
+@@ -42,7 +42,6 @@ CSerializableJsonFile::new_reader(char* dest_version, size_t n)
+ m_stack_stream.back(), STR_KEY_FILETYPE, &buf);
+
+ if (!success || buf == NULL
+- || is_error(buf)
+ || (ftype = json_object_get_string(buf)) == NULL)
+ return NULL;
+
+@@ -77,11 +76,10 @@ bool
+ CSerializableJsonFile::get_object(json_object** dest, json_object* src,
+ const char* key, json_type t)
+ {
+- bool success = true ;
+- success = json_object_object_get_ex(src, key, & *dest);
++ bool success = true;
++ success = json_object_object_get_ex(src, key, &*dest);
+
+- return success && *dest != NULL && !is_error(*dest)
+- && json_object_is_type(*dest, t);
++ return success && *dest != nullptr && json_object_is_type(*dest, t);
+ }
+
+ void
+@@ -97,7 +95,8 @@ CSerializableJsonFile::init(const char* fname)
+ switch (m_task) {
+ case 'r':
+ buf = json_object_from_file((char*) fname);
+- if (is_error(buf)) {
++ if (buf == nullptr)
++ {
+ SG_ERROR("Could not open file `%s' for reading!\n",
+ fname);
+ return;
+@@ -219,7 +218,7 @@ CSerializableJsonFile::write_scalar_wrapped(
+ break;
+ }
+
+- if (is_error(m_stack_stream.back()))
++ if (m_stack_stream.back() == nullptr)
+ return false;
+
+ return true;
+@@ -289,7 +288,7 @@ CSerializableJsonFile::write_sparse_begin_wrapped(
+ push_object(json_object_new_object());
+
+ json_object* buf = json_object_new_array();
+- if (is_error(buf))
++ if (buf == nullptr)
+ return false;
+
+ json_object_object_add(m_stack_stream.back(),
+@@ -319,7 +318,7 @@ CSerializableJsonFile::write_sparseentry_begin_wrapped(
+ push_object(buf);
+
+ buf = json_object_new_int(feat_index);
+- if (is_error(buf))
++ if (buf == nullptr)
+ return false;
+
+ json_object_object_add(m_stack_stream.back(),
+@@ -380,7 +379,7 @@ CSerializableJsonFile::write_sgserializable_begin_wrapped(
+
+ json_object* buf;
+ buf = json_object_new_string(sgserializable_name);
+- if (is_error(buf))
++ if (buf == nullptr)
+ return false;
+
+ json_object_object_add(m_stack_stream.back(),
+@@ -390,7 +389,7 @@ CSerializableJsonFile::write_sgserializable_begin_wrapped(
+ string_t buf_str;
+ TSGDataType::ptype_to_string(buf_str, generic, STRING_LEN);
+ buf = json_object_new_string(buf_str);
+- if (is_error(buf))
++ if (buf == nullptr)
+ return false;
+
+ json_object_object_add(m_stack_stream.back(),
+@@ -398,7 +397,7 @@ CSerializableJsonFile::write_sgserializable_begin_wrapped(
+ }
+
+ buf = json_object_new_object();
+- if (is_error(buf))
++ if (buf == nullptr)
+ return false;
+ json_object_object_add(m_stack_stream.back(), STR_KEY_INSTANCE,
+ buf);
+@@ -423,7 +422,7 @@ CSerializableJsonFile::write_type_begin_wrapped(
+ const TSGDataType* type, const char* name, const char* prefix)
+ {
+ json_object* buf = json_object_new_object();
+- if (is_error(buf))
++ if (buf == nullptr)
+ return false;
+
+ json_object_object_add(m_stack_stream.back(), name, buf);
+@@ -432,7 +431,7 @@ CSerializableJsonFile::write_type_begin_wrapped(
+ string_t str_buf;
+ type->to_string(str_buf, STRING_LEN);
+ buf = json_object_new_string(str_buf);
+- if (is_error(buf))
++ if (buf == nullptr)
+ return false;
+
+ json_object_object_add(m_stack_stream.back(), STR_KEY_TYPE, buf);
+diff --git a/src/shogun/io/SerializableJsonReader00.cpp b/src/shogun/io/SerializableJsonReader00.cpp
+index 06a602b6e..a885c787e 100644
+--- a/src/shogun/io/SerializableJsonReader00.cpp
++++ b/src/shogun/io/SerializableJsonReader00.cpp
+@@ -151,7 +151,8 @@ SerializableJsonReader00::read_stringentry_begin_wrapped(
+ json_object* m = m_file->m_stack_stream.back();
+
+ json_object* buf = json_object_array_get_idx(m, y);
+- if (is_error(buf)) return false;
++ if (buf == nullptr)
++ return false;
+
+ m_file->push_object(buf);
+ return true;
+@@ -199,7 +200,8 @@ SerializableJsonReader00::read_sparseentry_begin_wrapped(
+
+ json_object* buf_obj
+ = json_object_array_get_idx(m, y);
+- if (is_error(buf_obj)) return false;
++ if (buf_obj == nullptr)
++ return false;
+ if (!json_object_is_type(buf_obj, json_type_object)) return false;
+
+ json_object* buf;
+--
+2.20.0
+
diff --git a/pcr/shogun/PKGBUILD b/pcr/shogun/PKGBUILD
index 89cc68a0d..e9fa7eb3e 100644
--- a/pcr/shogun/PKGBUILD
+++ b/pcr/shogun/PKGBUILD
@@ -1,29 +1,78 @@
-# Maintainer (Arch): Zdeněk Janeček <jan.zdenek@gmail.com>
+# Maintainer (AUR): Christian Pfeiffer <xpipe at hotmail dot de>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
pkgname=shogun
-pkgver=4.0.0
-pkgrel=2
-pkgdesc="Shogun - A Large Scale Machine Learning Toolbox with the python interface"
+pkgver=6.1.3
+pkgrel=1
+pkgdesc="A Large Scale Machine Learning Toolbox"
arch=('i686' 'x86_64')
-url="http://www.shogun-toolbox.org"
-license=('GPLv3')
-depends=('cblas' 'lapack' 'swig' 'python-numpy' 'libcl')
-makedepends=('cmake')
-source=(http://shogun-toolbox.org/archives/shogun/releases/4.0/sources/$pkgname-$pkgver.tar.bz2)
-md5sums=('57370e869f3b24f74ce9c7b8741000b0')
+url="http://shogun.ml/"
+license=('GPL3')
+depends=('arpack' 'cblas' 'glpk' 'hdf5' 'lapacke' 'libxml2'
+ 'json-c' 'lua' 'openblas' 'ocl-icd' 'python' 'r' 'snappy')
+makedepends=('cmake' 'ctags' 'doxygen' 'eigen3' 'gdb' 'opencv' 'pandoc' 'protobuf'
+ 'python-numpy' 'python-ply' 'python-sphinx' 'swig' 'rxcpp')
+optdepends=('opencv: OpenCV support'
+ 'python-numpy: Python bindings'
+ 'python-ply: Python bindings')
+source=($pkgname-$pkgver.tar.gz::https://github.com/shogun-toolbox/shogun/archive/shogun_$pkgver.tar.gz
+ $pkgname-gpl-$pkgver.tar.gz::https://github.com/shogun-toolbox/shogun-gpl/archive/v$pkgver.tar.gz
+ 0001-Removed-is_error-macro-dependency-4098.patch)
+sha256sums=('75f4d555efe06eaa7c4c12a1dc942f6e4d41a8ed495777a790b9bd9df936c19c'
+ 'e8e2fea9804d3e0924a318b00a764bbf9d751c29d32adeeffbb83aec9fbca966'
+ '571172d9f31554c1e41cf1e3467cec38c527f1ccf9a2866bf49acfa0c1a84ac4')
+
+prepare() {
+ mkdir build
+ mv -T "${pkgname}-gpl-${pkgver}" "${srcdir}/${pkgname}-${pkgname}_${pkgver}/src/gpl"
+
+ cd "${srcdir}/${pkgname}-${pkgname}_${pkgver}"
+ patch -p1 -i ../0001-Removed-is_error-macro-dependency-4098.patch
+}
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
- mkdir build && cd build
- DISABLE_SSE=
+ cd build
+
+ cmake_args=()
if [ "${CARCH}" != "x86_64" ]; then
- DISABLE_SSE+="-DDISABLE_SSE=ON"
+ cmake_args+=("-DDISABLE_SSE=ON")
fi
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DPythonModular=ON ${DISABLE_SSE} ..
+
+ cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_ARPREC=OFF \
+ -DBUILD_EXAMPLES=OFF -DBUILD_META_EXAMPLES=OFF \
+ -DENABLE_ARPACK=ON -DENABLE_BZIP2=ON \
+ -DENABLE_COLPACK=OFF -DENABLE_VIENNACL=OFF \
+ -DENABLE_EIGEN_LAPACK=ON \
+ -DENABLE_CPLEX=OFF -DENABLE_MOSEK=OFF \
+ -DENABLE_NLOPT=OFF -DENABLE_GLPK=ON -DENABLE_LPSOLVE=ON \
+ -DENABLE_CURL=ON -DENABLE_HDF5=ON -DENABLE_JSON=ON \
+ -DENABLE_LDGOLD=ON -DENABLE_LTO=ON \
+ -DENABLE_PROTOBUF=ON -DENABLE_LIBXML2=ON \
+ -DENABLE_BZIP2=ON -DENABLE_LIBLZMA=ON -DENABLE_LZO=ON \
+ -DENABLE_SNAPPY=ON -DENABLE_ZLIB=ON \
+ -DLICENSE_GPL_SHOGUN=ON \
+ -DOpenCV=ON \
+ -DUSE_CPLEX=OFF -DUSE_MOSEK=OFF \
+ -DUSE_GLPK=ON -DUSE_LPSOLVE=ON -DUSE_BZIP2=ON \
+ -DUSE_GZIP=ON -DUSE_LZMA=ON -DUSE_LZO=ON -DUSE_SNAPPY=ON \
+ -DUSE_SVMLIGHT=ON -DUSE_SWIG_DIRECTORS=ON \
+ -DINTERFACE_LUA=ON \
+ -DINTERFACE_PYTHON=ON -DINTERFACE_R=ON \
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=ON \
+ -DBUILD_SHARED_LIBS=ON \
+ -DLAPACK_lapack_LIBRARY="/usr/lib/liblapack.so\;/usr/lib/liblapacke.so\;/usr/lib/libcblas.so" \
+ "${cmake_args[@]}" \
+ "${srcdir}/${pkgname}-${pkgname}_${pkgver}"
+
+ make
}
package() {
- cd "${srcdir}/${pkgname}-${pkgver}/build"
- make DESTDIR="$pkgdir/" install
-}
+ cd build
+ make DESTDIR="${pkgdir}" install
+ # The minimal example is always being installed
+ rm -r "${pkgdir}/usr/share/shogun/examples"
+
+ # Shogun will install some empty directories
+ find "${pkgdir}" -type d -empty -delete
+}