public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/shogun/, sci-libs/shogun/files/
@ 2017-01-15 19:35 Justin Lecher
  0 siblings, 0 replies; 2+ messages in thread
From: Justin Lecher @ 2017-01-15 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     e395a02c43d71ee8ea422d5092a4cc3ec3a1fe4c
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 15 19:34:44 2017 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 19:35:10 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e395a02c

sci-libs/shogun: Backport fix for eigen-3.3

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=604670

Package-Manager: Portage-2.3.3, Repoman-2.3.1
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 sci-libs/shogun/files/shogun-4.1.0-eigen-3.3.patch | 190 +++++++++++++++++++++
 sci-libs/shogun/shogun-4.1.0.ebuild                |   3 +-
 2 files changed, 192 insertions(+), 1 deletion(-)

diff --git a/sci-libs/shogun/files/shogun-4.1.0-eigen-3.3.patch b/sci-libs/shogun/files/shogun-4.1.0-eigen-3.3.patch
new file mode 100644
index 00000000..ed57cec
--- /dev/null
+++ b/sci-libs/shogun/files/shogun-4.1.0-eigen-3.3.patch
@@ -0,0 +1,190 @@
+From 57cd0958b153accf12f535ab9406dc8511bf22ec Mon Sep 17 00:00:00 2001
+From: Viktor Gal <viktor.gal@maeth.com>
+Date: Wed, 18 May 2016 06:35:28 +0200
+Subject: [PATCH] Fixing eigen 3.3 related errors
+
+porting fix for #3141 from lisitsyn/tapkee@7c74473d12809e4122527b6e003c74a942d8a25c
+fix #3140: provide a workaround for the eigen bug for calculating log of mapped matrices
+---
+ src/shogun/lib/tapkee/defines.hpp                  |  4 +--
+ src/shogun/mathematics/eigen3.h                    |  7 +++++
+ .../logdet/opfunc/DenseMatrixExactLog.cpp          |  5 ++++
+ .../SerialComputationEngine_unittest.cc            |  5 ++++
+ .../linalg/DenseExactLogJob_unittest.cc            |  5 ++++
+ .../linalg/RationalApproximation_unittest.cc       | 10 ++++++++
+ .../linalg/SparseMatrixOperator_unittest.cc        | 30 ++++++++++++----------
+ 7 files changed, 51 insertions(+), 15 deletions(-)
+
+diff --git a/src/shogun/lib/tapkee/defines.hpp b/src/shogun/lib/tapkee/defines.hpp
+index fd02636..1be45fe 100644
+--- a/src/shogun/lib/tapkee/defines.hpp
++++ b/src/shogun/lib/tapkee/defines.hpp
+@@ -49,12 +49,12 @@ namespace tapkee
+ 		TapkeeOutput(const tapkee::DenseMatrix& e, const tapkee::ProjectingFunction& p) :
+ 			embedding(), projection(p)
+ 		{
+-			embedding.swap(e);
++			embedding = e;
+ 		}
+ 		TapkeeOutput(const TapkeeOutput& that) :
+ 			embedding(), projection(that.projection)
+ 		{
+-			this->embedding.swap(that.embedding);
++			this->embedding = that.embedding;
+ 		}
+ 		tapkee::DenseMatrix embedding;
+ 		tapkee::ProjectingFunction projection;
+diff --git a/src/shogun/mathematics/eigen3.h b/src/shogun/mathematics/eigen3.h
+index 0fb8522..734be6c 100644
+--- a/src/shogun/mathematics/eigen3.h
++++ b/src/shogun/mathematics/eigen3.h
+@@ -61,6 +61,13 @@
+ 
+ 	#endif	//EIGEN_VERSION_AT_LEAST(3,0,93)
+ 
++#if ((EIGEN_WORLD_VERSION == 3) && (EIGEN_MAJOR_VERSION == 2) && \
++	((EIGEN_MINOR_VERSION == 91) || (EIGEN_MINOR_VERSION == 92)))
++	// Regression has been introduced to eigen develop (3.3alpha1+):
++	// http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1229
++	// until this is not fixed we need to copy the matrix and calculate the log
++	#define EIGEN_WITH_LOG_BUG_1229 1
++#endif
+ namespace shogun
+ {
+ template<class T> class SGSparseMatrix;
+diff --git a/src/shogun/mathematics/linalg/ratapprox/logdet/opfunc/DenseMatrixExactLog.cpp b/src/shogun/mathematics/linalg/ratapprox/logdet/opfunc/DenseMatrixExactLog.cpp
+index a7918e6..1002a6c 100644
+--- a/src/shogun/mathematics/linalg/ratapprox/logdet/opfunc/DenseMatrixExactLog.cpp
++++ b/src/shogun/mathematics/linalg/ratapprox/logdet/opfunc/DenseMatrixExactLog.cpp
+@@ -62,7 +62,12 @@ void CDenseMatrixExactLog::precompute()
+ 	Map<MatrixXd> mat(m.matrix, m.num_rows, m.num_cols);
+ 	SGMatrix<float64_t> log_m(m.num_rows, m.num_cols);
+ 	Map<MatrixXd> log_mat(log_m.matrix, log_m.num_rows, log_m.num_cols);
++#if EIGEN_WITH_LOG_BUG_1229
++	MatrixXd tmp = mat;
++	log_mat=tmp.log();
++#else
+ 	log_mat=mat.log();
++#endif
+ 
+ 	// the log(C) is also a linear operator here
+ 	// reset the operator of this function with log(C)
+diff --git a/tests/unit/lib/computation/SerialComputationEngine_unittest.cc b/tests/unit/lib/computation/SerialComputationEngine_unittest.cc
+index c41a69a..7f96df1 100644
+--- a/tests/unit/lib/computation/SerialComputationEngine_unittest.cc
++++ b/tests/unit/lib/computation/SerialComputationEngine_unittest.cc
+@@ -40,7 +40,12 @@ TEST(SerialComputationEngine, dense_log_det)
+ 	mat(1,1)=3.0;
+ 	Map<MatrixXd> m(mat.matrix, mat.num_rows, mat.num_cols);
+ 	Map<MatrixXd> log_m(log_mat.matrix, log_mat.num_rows, log_mat.num_cols);
++#if EIGEN_WITH_LOG_BUG_1229
++	MatrixXd tmp = m;
++	log_m=tmp.log();
++#else
+ 	log_m=m.log();
++#endif
+ 
+ 	// create linear operator and aggregator
+ 	CDenseMatrixOperator<float64_t>* log_op=new CDenseMatrixOperator<float64_t>(log_mat);
+diff --git a/tests/unit/mathematics/linalg/DenseExactLogJob_unittest.cc b/tests/unit/mathematics/linalg/DenseExactLogJob_unittest.cc
+index a5a12cf..60daf40 100644
+--- a/tests/unit/mathematics/linalg/DenseExactLogJob_unittest.cc
++++ b/tests/unit/mathematics/linalg/DenseExactLogJob_unittest.cc
+@@ -38,7 +38,12 @@ TEST(DenseExactLogJob, log_det)
+ 	mat(1,1)=3.0;
+ 	Map<MatrixXd> m(mat.matrix, mat.num_rows, mat.num_cols);
+ 	Map<MatrixXd> log_m(log_mat.matrix, log_mat.num_rows, log_mat.num_cols);
++#if EIGEN_WITH_LOG_BUG_1229
++	MatrixXd tmp = m;
++	log_m=tmp.log();
++#else
+ 	log_m=m.log();
++#endif
+ 
+ 	// create linear operator and aggregator
+ 	CDenseMatrixOperator<float64_t>* log_op=new CDenseMatrixOperator<float64_t>(log_mat);
+diff --git a/tests/unit/mathematics/linalg/RationalApproximation_unittest.cc b/tests/unit/mathematics/linalg/RationalApproximation_unittest.cc
+index f401d06..682ed66 100644
+--- a/tests/unit/mathematics/linalg/RationalApproximation_unittest.cc
++++ b/tests/unit/mathematics/linalg/RationalApproximation_unittest.cc
+@@ -182,7 +182,12 @@ TEST(RationalApproximation, trace_accuracy)
+ #if EIGEN_VERSION_AT_LEAST(3,1,0)
+ 	// compute the trace of log(m) using Eigen3 that uses Schur-Parlett algorithm
+ 	Map<MatrixXd> eig_m(m.matrix, m.num_rows, m.num_cols);
++#if EIGEN_WITH_LOG_BUG_1229
++	MatrixXd tmp = eig_m;
++	float64_t trace_log_m=tmp.log().diagonal().sum();
++#else
+ 	float64_t trace_log_m=eig_m.log().diagonal().sum();
++#endif
+ #else
+ 	float64_t trace_log_m=-11.51292546497021618279;
+ #endif // EIGEN_VERSION_AT_LEAST(3,1,0)
+@@ -364,7 +369,12 @@ TEST(RationalApproximation, trace_accuracy_cg_m)
+ #if EIGEN_VERSION_AT_LEAST(3,1,0)
+ 	// compute the trace of log(m) using Eigen3 that uses Schur-Parlett algorithm
+ 	Map<MatrixXd> eig_m(m.matrix, m.num_rows, m.num_cols);
++#if EIGEN_WITH_LOG_BUG_1229
++	MatrixXd tmp = eig_m;
++	float64_t trace_log_m=tmp.log().diagonal().sum();
++#else
+ 	float64_t trace_log_m=eig_m.log().diagonal().sum();
++#endif
+ #else
+ 	float64_t trace_log_m=-11.51292546497021618279;
+ #endif // EIGEN_VERSION_AT_LEAST(3,1,0)
+diff --git a/tests/unit/mathematics/linalg/SparseMatrixOperator_unittest.cc b/tests/unit/mathematics/linalg/SparseMatrixOperator_unittest.cc
+index 4d30724..9d171cc 100644
+--- a/tests/unit/mathematics/linalg/SparseMatrixOperator_unittest.cc
++++ b/tests/unit/mathematics/linalg/SparseMatrixOperator_unittest.cc
+@@ -219,33 +219,37 @@ TEST(SparseMatrixOperator, get_set_diagonal_realloc_complex128)
+ 
+ TEST(SparseMatrixOperator, get_sparsity_structure)
+ {
+-	const int size=9;
+-	const int max_pow=10;
++	const int32_t size=9;
++	const int32_t max_pow=10;
+ 
+-	SGMatrix<double> m(size, size);
++	SGMatrix<float64_t> m(size, size);
+ 
+ 	m.set_const(0.0);
+-	for (int i=0; i<size; ++i)
++	for (int32_t i=0; i<size; ++i)
+ 		m(i,i)=2.0;
+-	for (int i=0; i<size; i+=4)
++	for (int32_t i=0; i<size; i+=4)
+ 		m(i,size-1)=2.0;
+-	for (int i=0; i<size; i+=4)
++	for (int32_t i=0; i<size; i+=4)
+ 		m(size-1,i)=2.0;
+ 
+-	CSparseFeatures<double> feat(m);
+-	SGSparseMatrix<double> sm=feat.get_sparse_feature_matrix();
+-	CSparseMatrixOperator<double> op(sm);
++	CSparseFeatures<float64_t> feat(m);
++	SGSparseMatrix<float64_t> sm=feat.get_sparse_feature_matrix();
++	CSparseMatrixOperator<float64_t> op(sm);
+ 	CSparseMatrixOperator<bool>* b_op
+ 		=static_cast<CSparseMatrixOperator<bool>*>(op);
+ 
+-	SparseMatrix<bool, RowMajor, int> sp
++	SparseMatrix<bool, RowMajor, int32_t> sp
+ 		=EigenSparseUtil<bool>::toEigenSparse(b_op->get_matrix_operator());
+-	SparseMatrix<double, RowMajor, int> sm2
+-		=EigenSparseUtil<double>::toEigenSparse(sm);
++	SparseMatrix<float64_t, RowMajor, int32_t> sm2
++		=EigenSparseUtil<float64_t>::toEigenSparse(sm);
+ 
+ 	// compute direct matrix power and then the sparsity structure
+-	for (int i=2; i<=max_pow; ++i)
++	for (int32_t i=2; i<=max_pow; ++i)
++#if EIGEN_VERSION_AT_LEAST(3,2,91)
++		sp=(sp.cast<float64_t>()*sm2).cast<bool>();
++#else
+ 		sp=sp*sm2;
++#endif
+ 
+ 	int32_t* outerIndexPtr=const_cast<int32_t*>(sp.outerIndexPtr());
+ 	int32_t* innerIndexPtr=const_cast<int32_t*>(sp.innerIndexPtr());

diff --git a/sci-libs/shogun/shogun-4.1.0.ebuild b/sci-libs/shogun/shogun-4.1.0.ebuild
index 3258b84..3f31f9d 100644
--- a/sci-libs/shogun/shogun-4.1.0.ebuild
+++ b/sci-libs/shogun/shogun-4.1.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -79,6 +79,7 @@ DEPEND="${RDEPEND}
 PATCHES=(
 	"${FILESDIR}"/${P}-fix-buildsystem.patch
 	"${FILESDIR}"/${P}-remove-C-linkage.patch
+	"${FILESDIR}"/${P}-eigen-3.3.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sci-libs/shogun/, sci-libs/shogun/files/
@ 2017-02-04 21:07 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2017-02-04 21:07 UTC (permalink / raw
  To: gentoo-commits

commit:     8d85f22fd38976093c4b3d3a9f5d30954e689c14
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  4 21:02:10 2017 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Feb  4 21:07:06 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d85f22f

sci-libs/shogun: Version bump to 5.0.0

Gentoo-bug: 550134, 570014, 587324, 593310,
            602534, 604670, 606770, 607122

Package-Manager: Portage-2.3.3, Repoman-2.3.1
Closes: https://github.com/gentoo/gentoo/pull/3782

 sci-libs/shogun/Manifest                           |   1 +
 .../files/shogun-5.0.0-fix-buildsystem.patch       |  72 ++++++++++
 sci-libs/shogun/metadata.xml                       |  55 +++----
 sci-libs/shogun/shogun-5.0.0.ebuild                | 160 +++++++++++++++++++++
 4 files changed, 261 insertions(+), 27 deletions(-)

diff --git a/sci-libs/shogun/Manifest b/sci-libs/shogun/Manifest
index 0469645..b92de5f 100644
--- a/sci-libs/shogun/Manifest
+++ b/sci-libs/shogun/Manifest
@@ -1,2 +1,3 @@
 DIST shogun-4.1.0.tar.bz2 2908955 SHA256 0eb313a95606edee046768a4577d63f32f7ccce340bed7bf0ff0d69225567185 SHA512 01950d5186a94735df5331752e1b97a5464015973ddba38a70bc977f9872b3aad02b162ae87919631cce56d1f10b0bea1fa7b463bf959816e5a15a726214f52a WHIRLPOOL 300bd0d887fe8ee4a1ac2aca7f3fbaebd4344dcffe2b20f9b5bb05e83d6973e8a98e54a216d99329c03eea2c02666c557a3c50ff7e11556298d119b8c262f762
+DIST shogun-5.0.0.tar.bz2 2448509 SHA256 e82c6a58db9db6624192b018750b0e41f793481791fdc9a6d328bf278d0ae70d SHA512 fa8d9dee4596acce12022540a6927cbdb62e08f8468c8be3790de07ebf3a53055032bcc532b28334ca83284c38f2b0153602634f12bafe4019acb9121b9ff236 WHIRLPOOL 532058c44680909f3717785035c13fb3cf48efec22924101975d80990cb2a9e151814c673ad1a03fa33e363abbaf21fc9edc99d7d25686cc67e907547217bf69
 DIST shogun-data-0.9.tar.bz2 287533841 SHA256 691dd37ccc9bdd4f56d6b7a8e061e80567c241219d70210f8148bc4b7b815559 SHA512 ab501640e2db650603899c857866b451fac5c7bbbc7b4ef98559581928869cea49aa326dfca1bb398eee7ebc8843dcc8ee3105c9f462718f1af672aac6b9340a WHIRLPOOL 19aa7a6d84be9ac7d8aaf7fb12747e17e0ba5a7ec8770b83cc1833b07cd1c6c397684a96eb8ebe709d544967ffaf23bcfbeea52dc8ddedf487fcf54a6d2b3ef7

diff --git a/sci-libs/shogun/files/shogun-5.0.0-fix-buildsystem.patch b/sci-libs/shogun/files/shogun-5.0.0-fix-buildsystem.patch
new file mode 100644
index 00000000..1eb7cd0
--- /dev/null
+++ b/sci-libs/shogun/files/shogun-5.0.0-fix-buildsystem.patch
@@ -0,0 +1,72 @@
+* Remove setting of user flags
+* Remove erroneous bundling of Eigen
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -33,15 +33,6 @@
+ SET(EIGEN_VERSION_MINIMUM 3.1.2)
+ SET(VIENNACL_VERSION_MINIMUM 1.5.0)
+ 
+-# Store system's or distribution's C[XX]FLAGS.
+-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 "")
+-ENDIF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION"))
+-
+ # CCACHE
+ OPTION(ENABLE_CCACHE "Enable ccache for compilation" ON)
+ FIND_PACKAGE(CCache)
+@@ -174,24 +165,6 @@
+ 	SET(COMPILER_WARNINGS "-Wall -Wno-unused-parameter -Wformat -Wformat-security -Wparentheses -Wshadow -Wno-unknown-pragmas -Wno-deprecated")
+ ENDIF()
+ 
+-IF(CMAKE_COMPILER_IS_GNUCXX)
+-	SET(RELEASE_COMPILER_FLAGS "-fexpensive-optimizations -frerun-cse-after-loop -fcse-follow-jumps -finline-functions -fschedule-insns2 -fthread-jumps -fforce-addr -fstrength-reduce -funroll-loops")
+-	IF (${MACHINE} MATCHES "x86_64" OR ${MACHINE} MATCHES "i686")
+-		SET(RELEASE_COMPILER_FLAGS "${RELEASE_COMPILER_FLAGS} -mfpmath=sse")
+-	ENDIF()
+-ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+-	SET(RELEASE_COMPILER_FLAGS "-funroll-loops")
+-ENDIF()
+-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}")
+-SET(CMAKE_C_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}")
+-SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}")
+-SET(CMAKE_C_FLAGS_DISTRIBUTION "-O2")
+-SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O2")
+-SET(CMAKE_C_FLAGS_DEBUG "-g")
+-SET(CMAKE_CXX_FLAGS_DEBUG "-g")
+-
+ OPTION(ENABLE_COVERAGE "Enable code coverage" OFF)
+ IF(ENABLE_COVERAGE)
+ 	IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+@@ -617,13 +590,6 @@
+ 	include(external/Eigen3)
+ 	LIST(APPEND SYSTEM_INCLUDES ${EIGEN_INCLUDE_DIR})
+ ELSE()
+-    # eigen3 bug related to aliasing operators and self-storing.
+-    # TODO put in proper reference and version from when this is fixed
+-    IF(${EIGEN_VERSION} VERSION_GREATER 3.2.90)
+-        MESSAGE(WARNING "The system Eigen3 version ${EIGEN_VERSION} is buggy, manually bundling.")
+-        include(external/Eigen3)
+-    ENDIF()
+-
+ 	LIST(APPEND SYSTEM_INCLUDES ${EIGEN_INCLUDE_DIR})
+ ENDIF()
+ 
+@@ -957,11 +923,6 @@
+ # Respect system's or distribution's C[XX]FLAGS.
+ OPTION(SWIG_WITH_SYSTEM_CFLAGS "Enable system's C[XX]FLAGS for compilation of swig-binaries" ON)
+ 
+-IF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION"))
+-	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SYSTEM_C_FLAGS}")
+-	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYSTEM_CXX_FLAGS}")
+-ENDIF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION"))
+-
+ IF(SWIG_WITH_SYSTEM_CFLAGS)
+ 	SET(SWIG_CXX_COMPILER_FLAGS "${SWIG_CXX_COMPILER_FLAGS} ${SYSTEM_CXX_FLAGS}")
+ ENDIF(SWIG_WITH_SYSTEM_CFLAGS)

diff --git a/sci-libs/shogun/metadata.xml b/sci-libs/shogun/metadata.xml
index fd2f5a4..88454ce 100644
--- a/sci-libs/shogun/metadata.xml
+++ b/sci-libs/shogun/metadata.xml
@@ -1,31 +1,32 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-  <maintainer type="project">
-    <email>sci@gentoo.org</email>
-    <name>Gentoo Science Project</name>
-  </maintainer>
-  <longdescription lang="en">
-  SHOGUN - is a new machine learning toolbox with focus on large
-  scale kernel methods and especially on Support Vector Machines
-  (SVM) with focus to bioinformatics. It provides a generic SVM
-  object interfacing to several different SVM implementations. Each
-  of the SVMs can be combined with a variety of the many kernels
-  implemented. It can deal with weighted linear combination of a
-  number of sub-kernels, each of which not necessarily working on the
-  same domain, where  an optimal sub-kernel weighting can be learned
-  using Multiple Kernel Learning.  Apart from SVM 2-class
-  classification and regression problems, a number of linear methods
-  like Linear Discriminant Analysis (LDA), Linear Programming Machine
-  (LPM), (Kernel) Perceptrons and also algorithms to train hidden
-  markov models are implemented. The input feature-objects can be
-  dense, sparse or strings and of type int/short/double/char and can
-  be converted into different feature types. Chains of preprocessors
-  (e.g. substracting the mean) can be attached to each feature object
-  allowing for on-the-fly pre-processing.
-</longdescription>
-  <use>
-    <flag name="R">Enable support for <pkg>dev-lang/R</pkg></flag>
-    <flag name="octave">Enable support for <pkg>sci-mathematics/octave</pkg></flag>
-  </use>
+	<maintainer type="project">
+		<email>sci@gentoo.org</email>
+		<name>Gentoo Science Project</name>
+	</maintainer>
+	<longdescription lang="en">
+	SHOGUN - is a new machine learning toolbox with focus on large
+	scale kernel methods and especially on Support Vector Machines
+	(SVM) with focus to bioinformatics. It provides a generic SVM
+	object interfacing to several different SVM implementations. Each
+	of the SVMs can be combined with a variety of the many kernels
+	implemented. It can deal with weighted linear combination of a
+	number of sub-kernels, each of which not necessarily working on the
+	same domain, where	an optimal sub-kernel weighting can be learned
+	using Multiple Kernel Learning.	Apart from SVM 2-class
+	classification and regression problems, a number of linear methods
+	like Linear Discriminant Analysis (LDA), Linear Programming Machine
+	(LPM), (Kernel) Perceptrons and also algorithms to train hidden
+	markov models are implemented. The input feature-objects can be
+	dense, sparse or strings and of type int/short/double/char and can
+	be converted into different feature types. Chains of preprocessors
+	(e.g. substracting the mean) can be attached to each feature object
+	allowing for on-the-fly pre-processing.
+	</longdescription>
+	<use>
+		<flag name="R">Enable support for <pkg>dev-lang/R</pkg></flag>
+		<flag name="octave">Enable support for <pkg>sci-mathematics/octave</pkg></flag>
+		<flag name="opencl">Enable support for building against OpenCL</flag>
+	</use>
 </pkgmetadata>

diff --git a/sci-libs/shogun/shogun-5.0.0.ebuild b/sci-libs/shogun/shogun-5.0.0.ebuild
new file mode 100644
index 00000000..b3984db
--- /dev/null
+++ b/sci-libs/shogun/shogun-5.0.0.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5} )
+
+inherit cmake-utils flag-o-matic python-single-r1 toolchain-funcs versionator
+
+MYPV=$(get_version_component_range 1-2)
+MYPD=${PN}-data-0.9
+
+DESCRIPTION="Large Scale Machine Learning Toolbox"
+HOMEPAGE="http://shogun-toolbox.org/"
+SRC_URI="
+	ftp://shogun-toolbox.org/shogun/releases/${MYPV}/sources/${P}.tar.bz2
+	test? ( ftp://shogun-toolbox.org/shogun/data/${MYPD}.tar.bz2 )
+	examples? ( ftp://shogun-toolbox.org/shogun/data/${MYPD}.tar.bz2 )"
+
+LICENSE="GPL-3 free-noncomm"
+SLOT="0/16"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="cpu_flags_x86_sse doc examples lua octave opencl python R ruby static-libs test"
+
+REQUIRED_USE="
+	python? ( ${PYTHON_REQUIRED_USE} )
+	test? ( python )"
+
+RDEPEND="
+	app-arch/bzip2
+	app-arch/gzip
+	app-arch/lzma
+	app-arch/snappy
+	dev-libs/lzo
+	dev-cpp/eigen:3
+	dev-libs/json-c:=
+	dev-libs/libxml2
+	dev-libs/protobuf:=
+	net-misc/curl
+	sci-libs/arpack
+	sci-libs/arprec
+	sci-libs/colpack
+	sci-libs/hdf5:=
+	sci-libs/nlopt
+	sci-mathematics/glpk:=
+	sci-mathematics/lpsolve:=
+	sys-libs/readline:0=
+	sys-libs/zlib
+	virtual/blas
+	virtual/cblas
+	virtual/lapack
+	lua? ( dev-lang/lua:0 )
+	octave? ( >=sci-mathematics/octave-4.2.0:=[hdf5] )
+	opencl? ( virtual/opencl )
+	python? ( dev-python/numpy[${PYTHON_USEDEP}] )
+	R? ( dev-lang/R )
+	ruby? ( dev-ruby/narray )"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	doc? (
+		>=app-doc/doxygen-1.8.13-r1[dot]
+		dev-python/sphinx
+	)
+	lua? ( >=dev-lang/swig-3.0.12 )
+	octave? ( >=dev-lang/swig-3.0.12 )
+	python? (
+		>=dev-lang/swig-3.0.12
+		test? (
+			sci-libs/scipy
+		)
+	)
+	R? ( >=dev-lang/swig-3.0.12 )
+	ruby? ( >=dev-lang/swig-3.0.12 )
+	test? (
+		dev-python/jinja[${PYTHON_USEDEP}]
+		dev-cpp/gmock
+	)"
+
+# javamodular needs jblas (painful to package properly)
+# permodular work in progress (as 3.2.0)
+# could actually support multiple pythons, multiple rubys
+# feel free to do work for it
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-5.0.0-fix-buildsystem.patch
+	"${FILESDIR}"/${PN}-4.1.0-remove-C-linkage.patch
+)
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+	export ATLAS_LIBRARY="$($(tc-getPKG_CONFIG) --libs cblas lapack)"
+	export CBLAS_LIBRARY="$($(tc-getPKG_CONFIG) --libs cblas)"
+	export ATLAS_LIBRARIES="$($(tc-getPKG_CONFIG) --libs blas cblas lapack)"
+	export LAPACK_LIBRARIES="$($(tc-getPKG_CONFIG) --libs lapack)"
+
+	append-cppflags "$($(tc-getPKG_CONFIG) --cflags cblas)"
+
+	local mycmakeargs=(
+		-DCMAKE_SKIP_RPATH=ON
+		-DCMAKE_SKIP_INSTALL_RPATH=ON
+		-DLIB_INSTALL_DIR=$(get_libdir)
+		-DENABLE_TESTING=$(usex test)
+		-DBUILD_EXAMPLES=$(usex examples)
+		-DDISABLE_SSE=$(usex !cpu_flags_x86_sse)
+		-DCMAKE_DISABLE_FIND_PACKAGE_Pandoc=ON
+		$(cmake-utils_use_find_package doc Sphinx)
+		$(cmake-utils_use_find_package doc Doxygen)
+
+		# Features:
+		-DENABLE_COVERAGE=OFF
+		-DENABLE_COLPACK=ON
+		-DENABLE_PROTOBUF=ON
+		-DENABLE_PYTHON_DEBUG=OFF
+		-DENABLE_VIENNACL=$(usex opencl)
+		-DUSE_ARPREC=ON
+		-DUSE_HDF5=ON
+
+		# Bindings:
+		-DJavaModular=OFF
+		-DPerlModular=OFF
+		-DCSharpModular=OFF
+		-DLuaModular=$(usex lua)
+		-DOctaveModular=$(usex octave)
+		-DPythonModular=$(usex python)
+		-DRModular=$(usex R)
+		-DRubyModular=$(usex ruby)
+
+		# Disable bundled libs
+		-DBUNDLE_COLPACK=OFF
+		-DBUNDLE_JSON=OFF
+		-DBUNDLE_NLOPT=OFF
+	)
+	cmake-utils_src_configure
+
+	# gentoo bug #302621
+	has_version 'sci-libs/hdf5[mpi]' && export CXX=mpicxx CC=mpicc
+}
+
+src_compile() {
+	cmake-utils_src_compile
+	use doc && cmake-utils_src_compile -C doc
+}
+
+src_install() {
+	cmake-utils_src_install
+
+	if use doc; then
+		local i
+		for i in lua octave python R ruby; do
+			if use $i; then
+				docinto html/${i,}_modular
+				dodoc -r "${BUILD_DIR}"/src/interfaces/${i,}_modular/modshogun/doxygen_xml/.
+			fi
+		done
+	fi
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-04 21:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-04 21:07 [gentoo-commits] repo/gentoo:master commit in: sci-libs/shogun/, sci-libs/shogun/files/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2017-01-15 19:35 Justin Lecher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox