diff options
Diffstat (limited to 'sci-libs/libsvm')
-rw-r--r-- | sci-libs/libsvm/Manifest | 9 | ||||
-rw-r--r-- | sci-libs/libsvm/files/3.11-openmp.patch | 34 | ||||
-rw-r--r-- | sci-libs/libsvm/files/3.14-makefile.patch | 51 | ||||
-rw-r--r-- | sci-libs/libsvm/libsvm-3.21.ebuild | 117 | ||||
-rw-r--r-- | sci-libs/libsvm/libsvm-3.22.ebuild | 117 | ||||
-rw-r--r-- | sci-libs/libsvm/metadata.xml | 18 |
6 files changed, 346 insertions, 0 deletions
diff --git a/sci-libs/libsvm/Manifest b/sci-libs/libsvm/Manifest new file mode 100644 index 000000000000..2b40ffaba4d4 --- /dev/null +++ b/sci-libs/libsvm/Manifest @@ -0,0 +1,9 @@ +AUX 3.11-openmp.patch 943 SHA256 019c9c6d66384367d6d0dd8c1edb12e028a9260dd7268f2214e016b2905eba5a SHA512 17bcea4da6a6aa32192ce7fb66e7eefef5e037ca2afd968e67de385938555975abe2103ee2cc50d02cd21d9783e9334eac93de694d6e685f13af80c49e42af38 WHIRLPOOL 29de725824c2ec2fe55a5e2b272f6953b3b6b348b2e21c3d6ac5766748484f55b6e841e9cffaa4a18fa7f9fb31c562b2bc5bad206f948f4fc37756aefbcd41ec +AUX 3.14-makefile.patch 1634 SHA256 88aea720c824a5910c9bd9cf7e1e8eae8d3f0cbc9d12467734bb1156f7aedfb5 SHA512 f4c2e2f6556604bf3572e341176c855e87caf4c3db8c2b347ce4e7a7948d21b708a7df29d5bf9b741dd3f34e08a0750572b94bd5e94bb4052f1ba4b9ae50e918 WHIRLPOOL d5ada5b43ee143873f0a23d2ea0ecbb160202df29103e37eff93a759ae711c993d485865c16d287a668e002adce3147b51e403705d359fb1871860518417f675 +DIST libsvm-3.21.tar.gz 847291 SHA256 519e0bdc0e31ab8246e9035e7ca91f794c16084f80abe4dffe776261d23c772f SHA512 697a7505100e48746a87e3e4ab025524fa581856320da3a187ac501138ce0a5bc7885ff37454ae5e75d6b0eab94e368b6bcd36601ad18db3b2fb35d2f360520a WHIRLPOOL d0ef916d37a3cc24680b6eba62d29caca9c36fa41ae8f22445137e044c7cf66a754c3d12670697fce174b388fe30906b2a4dc437cb38e7c6f1dd8dde85f51b84 +DIST libsvm-3.22.tar.gz 850563 SHA256 6d81c67d3b13073eb5a25aa77188f141b242ec328518fad95367ede253d0a77d SHA512 80a22fd2c2a82f70b8279fa5d8c5a2838b10ee439cf6d725816d608f8e45990ba1780ae6750cad78b25c1c18daf2c2315b342b9e329affbd5729d6fd7da87f7a WHIRLPOOL 0a720edf30f874ace0a7c7dab02df634fa64a0b134cf8ec7c153f7ff6ac794b6ea0ebcef6cfa54ac298c67a3a79e251565bbb5f3a75019a446d04bd065cf8279 +EBUILD libsvm-3.21.ebuild 2677 SHA256 53f0547a1ca40b4b97f3954236a752d062461c736632f01929a315dccc348be0 SHA512 55c73ec430c94f618a7a193f1e6d4eb247c82757dbe0c84e384fb42dc6fb152d5d34378e9109ae130c8e47ca82ed08125719e06d06e9b4d3b5c532636da92d4c WHIRLPOOL 701707cce2aea5eea6a7719decc32f3b0270be96f043d12481cdcc9d46604faf6e483ef9b6af54475437b72e196b103922888d4bff8e4b37dcc9996b56b5d67e +EBUILD libsvm-3.22.ebuild 2687 SHA256 52caecca4ea9d4f9acea7e0b7520a95ab4c35011f5b1aeb47b64c99ff612f86e SHA512 41a98b039ced740ad00938512a3b89a4e3ef3a466dcdf8cdd998c95a14ca80ab072a083fa270376ac450941a50e013fe10c20d49aa8f939a00cc4b5bb48bec5d WHIRLPOOL 5e8d051be6890791448c6b21c1738f9469ff9b8609ca43df24a70f0bd1d950b39541c0be9f4526f828e4e0fcc87742ebb6087f9b1526106f9858f6686c5b38a1 +MISC ChangeLog 3699 SHA256 63c0e1a14e59adecf2f8668fa2aeec3ef5db566a3dac58ed9876300bf05a566b SHA512 80604f7c70d6227bc91fa5a343af1ce4ae8ec77ffca6bb4f628de23685db4ed5b5c1c633b55a848301231ae0d8735c34e19920ea4261e3da3330efc83e772e38 WHIRLPOOL 4fae00eded3d1d62c1d6f12f3fa6a3ef836fd79d8966da313c425cdbd4f38b01a0d4e5164b401d4f555b89afc8314ca96af87711f39a0b6f5d03643a97e1a5c3 +MISC ChangeLog-2015 6696 SHA256 b0d18d0fc93c7dac8feec1cfa57b5829bce2d94ea7d26c3a57ed6a6d0451b5ce SHA512 cbc6ba3a3b8c5f50ca95ef5365c3ab4f4e7e2ca5bf07a21f7fc662a6fcb343dec1c993b6defa6b88af70331640c752aad6d600ad56ef200f51604e8e4debcf71 WHIRLPOOL 24b65e64a10c8ed57b0f9bc23718c69110e98aa5031180b9323883ccb0c9f4278a612300f5e57e64a6b8409a21d159ebfe09d1833b55aa098b75e73f60492346 +MISC metadata.xml 815 SHA256 ca60b2fd80e5cf2bfe05e66e3ce3f46680b5a023c96d08bfcc968619be1a6724 SHA512 0e26fd0b3ddb08f769e92249819e93483cbca426465b8cd623703be2c242b5c8dd9731c978f6965e2c39d680229d5b15587ec0a16aea0b6fcf8172cf70e7f7ec WHIRLPOOL 2d874f253345ff8f7ad115c93133d42ba82bcc27e0522efbf91788ce3f3a5ff02db3d60a8e4bc04bd38f70f2d37a0a43f49a28f272fc98e08ab23f27d3fdfc71 diff --git a/sci-libs/libsvm/files/3.11-openmp.patch b/sci-libs/libsvm/files/3.11-openmp.patch new file mode 100644 index 000000000000..e07b03e57380 --- /dev/null +++ b/sci-libs/libsvm/files/3.11-openmp.patch @@ -0,0 +1,34 @@ +--- a/svm.cpp.orig 2011-05-27 04:32:19.000000000 +0100 ++++ b/svm.cpp 2011-12-29 19:17:07.000000000 +0000 +@@ -1281,6 +1281,9 @@ + int start, j; + if((start = cache->get_data(i,&data,len)) < len) + { ++#ifdef OPENMP ++#pragma omp parallel for private(j) ++#endif + for(j=start;j<len;j++) + data[j] = (Qfloat)(y[i]*y[j]*(this->*kernel_function)(i,j)); + } +@@ -2463,7 +2466,10 @@ + model->param.svm_type == NU_SVR) + { + double *sv_coef = model->sv_coef[0]; +- double sum = 0; ++ double sum = 0; int i; ++#ifdef OPENMP ++#pragma omp parallel for private(i) reduction(+:sum) ++#endif + for(i=0;i<model->l;i++) + sum += sv_coef[i] * Kernel::k_function(x,model->SV[i],model->param); + sum -= model->rho[0]; +@@ -2480,6 +2486,9 @@ + int l = model->l; + + double *kvalue = Malloc(double,l); ++#ifdef OPENMP ++#pragma omp parallel for private(i) ++#endif + for(i=0;i<l;i++) + kvalue[i] = Kernel::k_function(x,model->SV[i],model->param); + diff --git a/sci-libs/libsvm/files/3.14-makefile.patch b/sci-libs/libsvm/files/3.14-makefile.patch new file mode 100644 index 000000000000..e38dafc10b20 --- /dev/null +++ b/sci-libs/libsvm/files/3.14-makefile.patch @@ -0,0 +1,51 @@ +* respect CFLAGS and CXXFLAGS from user +* compile with CC for C and CXX for C++ files +* propagate and respect user's LDFLAGS +* PIC only used for the library +* link the shared version library +nov 2012 - bicatali@gentoo.org + +--- a/Makefile.orig 2012-11-29 10:39:07.149421728 -0800 ++++ b/Makefile 2012-11-29 10:57:19.727766521 -0800 +@@ -1,9 +1,12 @@ + CXX ?= g++ +-CFLAGS = -Wall -Wconversion -O3 -fPIC ++CC ?= gcc ++CFLAGS ?= -Wall -Wconversion -O3 ++CXXFLAGS ?= $(CFLAGS) + SHVER = 2 + OS = $(shell uname) ++PICFLAGS ?= -fPIC + +-all: svm-train svm-predict svm-scale ++all: svm-train svm-predict svm-scale lib + + lib: svm.o + if [ "$(OS)" = "Darwin" ]; then \ +@@ -11,15 +14,20 @@ + else \ + SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \ + fi; \ +- $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) ++ $(CXX) $(LDFLAGS) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) ; \ ++ ln -s libsvm.so.$(SHVER) libsvm.so + + svm-predict: svm-predict.c svm.o +- $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm ++ $(CC) $(CFLAGS) -c $@.c -o $@.o ++ $(CXX) $(LDFLAGS) $@.o svm.o -lm -o $@ + svm-train: svm-train.c svm.o +- $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm ++ $(CC) $(CFLAGS) -c $@.c -o $@.o ++ $(CXX) $(LDFLAGS) $@.o svm.o -lm -o $@ + svm-scale: svm-scale.c +- $(CXX) $(CFLAGS) svm-scale.c -o svm-scale ++ $(CC) $(CFLAGS) -c $@.c -o $@.o ++ $(CXX) $(LDFLAGS) $@.o -o $@ ++ + svm.o: svm.cpp svm.h +- $(CXX) $(CFLAGS) -c svm.cpp ++ $(CXX) $(CXXFLAGS) $(PICFLAGS) -c svm.cpp -o $@ + clean: +- rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) ++ rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) libsvm.so diff --git a/sci-libs/libsvm/libsvm-3.21.ebuild b/sci-libs/libsvm/libsvm-3.21.ebuild new file mode 100644 index 000000000000..b36a2fbf3219 --- /dev/null +++ b/sci-libs/libsvm/libsvm-3.21.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) + +inherit flag-o-matic java-pkg-opt-2 python-r1 toolchain-funcs + +DESCRIPTION="Library for Support Vector Machines" +HOMEPAGE="http://www.csie.ntu.edu.tw/~cjlin/libsvm/" +SRC_URI="http://www.csie.ntu.edu.tw/~cjlin/libsvm/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux" +IUSE="java openmp python tools" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + java? ( >=virtual/jdk-1.4 ) + python? ( ${PYTHON_DEPS} )" +RDEPEND=" + java? ( >=virtual/jre-1.4 ) + python? ( ${PYTHON_DEPS} ) + tools? ( sci-visualization/gnuplot )" + +PATCHES=( + "${FILESDIR}/3.11-openmp.patch" + "${FILESDIR}/3.14-makefile.patch" +) + +pkg_setup() { + if use openmp; then + if ! tc-has-openmp; then + ewarn "OpenMP is not supported by your currently selected compiler" + + if tc-is-clang; then + ewarn "OpenMP support in sys-devel/clang is provided by sys-libs/libomp," + ewarn "which you will need to build ${CATEGORY}/${PN} for USE=\"openmp\"" + fi + + die "need openmp capable compiler" + fi + + append-cflags -fopenmp + append-cxxflags -fopenmp + append-cppflags -DOPENMP + fi +} + +src_prepare() { + default + + sed -i -e "s@\.\./@${EPREFIX}/usr/bin/@g" tools/*.py \ + || die "Failed to fix paths in python files" + sed -i -e "s|./grid.py|${EPREFIX}/usr/bin/svm-grid|g" tools/*.py \ + || die "Failed to fix paths for svm-grid" + sed -i -e 's/grid.py/svm-grid/g' tools/grid.py \ + || die "Failed to rename grid.py to svm-grid" + + if use java; then + local JAVAC_FLAGS="$(java-pkg_javac-args)" + sed -i \ + -e "s/JAVAC_FLAGS =/JAVAC_FLAGS=${JAVAC_FLAGS}/g" \ + java/Makefile || die "Failed to fix java makefile" + fi + tc-export CXX CC +} + +src_compile() { + default + use java && emake -C java +} + +src_install() { + dobin svm-train svm-predict svm-scale + dolib.so *.so* + doheader svm.h + + DOCS=( README ) + + if use tools; then + local t + for t in tools/*.py; do + python_foreach_impl python_newscript ${t} svm-$(basename ${t} .py) + done + + mv tools/README{,.tools} || die + DOCS+=( tools/README.tools ) + + insinto /usr/share/doc/${PF}/examples + docompress -x /usr/share/doc/${PF}/examples + doins heart_scale + doins -r svm-toy + fi + + if use python ; then + installation() { + touch python/__init__.py || die + python_moduleinto libsvm + python_domodule python/*.py + } + python_foreach_impl installation + + mv python/README{,.python} || die + DOCS+=( python/README.python ) + fi + + HTML_DOCS=( FAQ.html ) + if use java; then + java-pkg_dojar java/libsvm.jar + HTML_DOCS+=( java/test_applet.html ) + fi + + einstalldocs +} diff --git a/sci-libs/libsvm/libsvm-3.22.ebuild b/sci-libs/libsvm/libsvm-3.22.ebuild new file mode 100644 index 000000000000..57d4bbb5185f --- /dev/null +++ b/sci-libs/libsvm/libsvm-3.22.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} ) + +inherit flag-o-matic java-pkg-opt-2 python-r1 toolchain-funcs + +DESCRIPTION="Library for Support Vector Machines" +HOMEPAGE="http://www.csie.ntu.edu.tw/~cjlin/libsvm/" +SRC_URI="http://www.csie.ntu.edu.tw/~cjlin/libsvm/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/2" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" +IUSE="java openmp python tools" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + java? ( >=virtual/jdk-1.4 ) + python? ( ${PYTHON_DEPS} )" +RDEPEND=" + java? ( >=virtual/jre-1.4 ) + python? ( ${PYTHON_DEPS} ) + tools? ( sci-visualization/gnuplot )" + +PATCHES=( + "${FILESDIR}/3.11-openmp.patch" + "${FILESDIR}/3.14-makefile.patch" +) + +pkg_setup() { + if use openmp; then + if ! tc-has-openmp; then + ewarn "OpenMP is not supported by your currently selected compiler" + + if tc-is-clang; then + ewarn "OpenMP support in sys-devel/clang is provided by sys-libs/libomp," + ewarn "which you will need to build ${CATEGORY}/${PN} for USE=\"openmp\"" + fi + + die "need openmp capable compiler" + fi + + append-cflags -fopenmp + append-cxxflags -fopenmp + append-cppflags -DOPENMP + fi +} + +src_prepare() { + default + + sed -i -e "s@\.\./@${EPREFIX}/usr/bin/@g" tools/*.py \ + || die "Failed to fix paths in python files" + sed -i -e "s|./grid.py|${EPREFIX}/usr/bin/svm-grid|g" tools/*.py \ + || die "Failed to fix paths for svm-grid" + sed -i -e 's/grid.py/svm-grid/g' tools/grid.py \ + || die "Failed to rename grid.py to svm-grid" + + if use java; then + local JAVAC_FLAGS="$(java-pkg_javac-args)" + sed -i \ + -e "s/JAVAC_FLAGS =/JAVAC_FLAGS=${JAVAC_FLAGS}/g" \ + java/Makefile || die "Failed to fix java makefile" + fi + tc-export CXX CC +} + +src_compile() { + default + use java && emake -C java +} + +src_install() { + dobin svm-train svm-predict svm-scale + dolib.so *.so* + doheader svm.h + + DOCS=( README ) + + if use tools; then + local t + for t in tools/*.py; do + python_foreach_impl python_newscript ${t} svm-$(basename ${t} .py) + done + + mv tools/README{,.tools} || die + DOCS+=( tools/README.tools ) + + insinto /usr/share/doc/${PF}/examples + docompress -x /usr/share/doc/${PF}/examples + doins heart_scale + doins -r svm-toy + fi + + if use python ; then + installation() { + touch python/__init__.py || die + python_moduleinto libsvm + python_domodule python/*.py + } + python_foreach_impl installation + + mv python/README{,.python} || die + DOCS+=( python/README.python ) + fi + + HTML_DOCS=( FAQ.html ) + if use java; then + java-pkg_dojar java/libsvm.jar + HTML_DOCS+=( java/test_applet.html ) + fi + + einstalldocs +} diff --git a/sci-libs/libsvm/metadata.xml b/sci-libs/libsvm/metadata.xml new file mode 100644 index 000000000000..7ba70023b93f --- /dev/null +++ b/sci-libs/libsvm/metadata.xml @@ -0,0 +1,18 @@ +<?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"> + The LIBSVM library is used to calculate Support Vector Machine + optimizations with a great variety of options. It includes + one-class, two-class, multiclass, regression-mode, and probablistic + output functionality. It is primarily of interest to machine-learning + researchers and artificial intelligence application developers. + </longdescription> + <use> + <flag name="tools">Install python based tool scripts for data selection and visualization with <pkg>sci-visualization/gnuplot</pkg></flag> + </use> +</pkgmetadata> |