public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Maxim Koltsov" <maksbotan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/maksbotan:master commit in: dev-libs/caffe/
Date: Fri, 13 Mar 2015 17:18:09 +0000 (UTC)	[thread overview]
Message-ID: <1426266987.58b733cf90a98c542be4b42dda16c0cd2bb37311.maksbotan@gentoo> (raw)

commit:     58b733cf90a98c542be4b42dda16c0cd2bb37311
Author:     Maxim <kolmax94 <AT> gmail <DOT> com>
AuthorDate: Fri Mar 13 16:58:47 2015 +0000
Commit:     Maxim Koltsov <maksbotan <AT> gentoo <DOT> org>
CommitDate: Fri Mar 13 17:16:27 2015 +0000
URL:        https://gitweb.gentoo.org/dev/maksbotan.git/commit/?id=58b733cf

Add dev-libs/caffe-9999 ebuild

Package-Manager: portage-2.2.17

 dev-libs/caffe/Manifest          |   2 +
 dev-libs/caffe/caffe-9999.ebuild | 133 +++++++++++++++++++++++++++++++++++++++
 dev-libs/caffe/metadata.xml      |  11 ++++
 3 files changed, 146 insertions(+)

diff --git a/dev-libs/caffe/Manifest b/dev-libs/caffe/Manifest
new file mode 100644
index 0000000..fd218ac
--- /dev/null
+++ b/dev-libs/caffe/Manifest
@@ -0,0 +1,2 @@
+EBUILD caffe-9999.ebuild 2849 SHA256 158e1ed5ebe1c861dcff44d474cfd3a785f2af25226c66ac1e96bc68a07e03d0 SHA512 f8bd7462bb8c8af0537a87cb33c5ddcc55d499556f1554f92326cac689a9542eca90619c15950855a87316b6f9888e6d4fcff2f8dbe93b030492a170a4a6e992 WHIRLPOOL 9205c209bd6c7675d09dc4d44ad998eb82d50fc80a89a10daf52ef15ab5a87718104f971ff7b4f02d2abec25ead60a434688c8d39c28d70177232ec9d55c66ef
+MISC metadata.xml 305 SHA256 bf868a44e6d34e3495a705d30149d16294c294141ae4b87eb0c7a2949df0d83c SHA512 a124af1bf9b9d853cd09e411b3a0558ba0b7b04b3e65c7c0625cacf5e4cbbf5e4bab747b0dab9318c2da042668ac9be79d47bb66049bf32f934221808101a2cc WHIRLPOOL 5be2ce659ffc4a20111c3ef3d827709b0ba150f7bc60aa17f1c17986aa7ac7670f775ded2850977f5f84054343a4efe52e828bfd4775003dc725ec4f43d772a1

diff --git a/dev-libs/caffe/caffe-9999.ebuild b/dev-libs/caffe/caffe-9999.ebuild
new file mode 100644
index 0000000..5472075
--- /dev/null
+++ b/dev-libs/caffe/caffe-9999.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+EGIT_REPO_URI="git://github.com/BVLC/caffe.git"
+PYTHON_COMPAT=( python2_7 )
+
+inherit toolchain-funcs multilib git-r3 python-single-r1
+# Can't use cuda.eclass as nvcc does not like --compiler-bindir set there for some reason
+
+DESCRIPTION="Deep learning framework by the BVLC"
+HOMEPAGE="http://caffe.berkeleyvision.org/"
+SRC_URI=""
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="cuda python"
+
+CDEPEND="
+	dev-libs/boost:=[python?]
+	media-libs/opencv:=
+	dev-libs/protobuf:=[python?]
+	dev-cpp/glog:=
+	dev-cpp/gflags:=
+	sci-libs/hdf5:=
+	dev-libs/leveldb:=
+	app-arch/snappy:=
+	dev-db/lmdb:=
+	cuda? (
+		dev-util/nvidia-cuda-toolkit
+	)
+	python? (
+		${PYTHON_DEPS}
+	)
+"
+DEPEND="
+	${CDEPEND}
+	sys-devel/bc
+"
+RDEPEND="
+	${CDEPEND}
+	python? (
+		dev-python/pandas[${PYTHON_USEDEP}]
+		dev-python/numpy[${PYTHON_USEDEP}]
+		media-gfx/pydot[${PYTHON_USEDEP}]
+		sci-libs/scikits_image[${PYTHON_USEDEP}]
+	)
+"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_configure() {
+	# Respect CFLAGS
+	sed -e '/COMMON_FLAGS/s/-O2//' -i Makefile
+
+	cat > Makefile.config << EOF
+BLAS := atlas
+BUILD_DIR := build
+DISTRIBUTE_DIR := distribute
+EOF
+
+	if use cuda; then
+		cat >> Makefile.config << EOF
+CUDA_DIR := "${EPREFIX}/opt/cuda"
+
+CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
+			 -gencode arch=compute_20,code=sm_21 \
+	         -gencode arch=compute_30,code=sm_30 \
+	         -gencode arch=compute_35,code=sm_35 \
+	         -gencode arch=compute_50,code=sm_50 \
+		     -gencode arch=compute_50,code=compute_50
+EOF
+
+		# This should be handled by Makefile itself, but somehow is broken
+		sed -e "/CUDA_LIB_DIR/s/lib/$(get_libdir)/" -i Makefile || die "sed failed"
+	else
+		echo "CPU_ONLY := 1" >> Makefile.config
+	fi
+
+	if use python; then
+		python_export PYTHON_INCLUDEDIR PYTHON_SITEDIR PYTHON_LIBPATH
+		cat >> Makefile.config << EOF
+PYTHON_INCLUDE := "${PYTHON_INCLUDEDIR}" "${PYTHON_SITEDIR}/numpy/core/include"
+PYTHON_LIB := "$(dirname ${PYTHON_LIBPATH})"
+WITH_PYTHON_LAYER := 1
+
+INCLUDE_DIRS += \$(PYTHON_INCLUDE)
+LIBRARY_DIRS += \$(PYTHON_LIB)
+EOF
+
+		local py_version=${EPYTHON#python}
+		sed -e "/PYTHON_LIBRARIES/s/python\s/python-${py_version} /g" \
+			-e '/blas/s/atlas//' \
+			-i Makefile || die "sed failed"
+	fi
+
+	tc-export CC CXX
+}
+
+src_compile() {
+	emake
+
+	use python && emake pycaffe
+}
+
+src_test() {
+	emake runtest
+
+	use python && emake pytest
+}
+
+src_install() {
+	emake distribute
+
+	for bin in distribute/bin/*; do
+		dobin ${bin}
+	done
+
+	insinto /usr
+	doins -r distribute/include/
+
+	dolib.a distribute/lib/libcaffe.a
+	dolib.so distribute/lib/libcaffe.so
+
+	rm distribute/python/caffe/_caffe.cpp || die "rm failed"
+	python_domodule distribute/python/caffe
+	for script in distribute/python/*.py; do
+		python_doscript ${script}
+	done
+}

diff --git a/dev-libs/caffe/metadata.xml b/dev-libs/caffe/metadata.xml
new file mode 100644
index 0000000..f6c645a
--- /dev/null
+++ b/dev-libs/caffe/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+	<email>maksbotan@gentoo.org</email>
+	<name>Maxim Koltsov</name>
+</maintainer>
+<use>
+	<flag name="cuda">Enable NVIDIA CUDA toolkit support</flag>
+</use>
+</pkgmetadata>


             reply	other threads:[~2015-03-13 17:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 17:18 Maxim Koltsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-13 17:24 [gentoo-commits] dev/maksbotan:master commit in: dev-libs/caffe/ Maxim Koltsov
2015-03-13 17:26 Maxim Koltsov
2015-07-28 19:53 Maxim Koltsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426266987.58b733cf90a98c542be4b42dda16c0cd2bb37311.maksbotan@gentoo \
    --to=maksbotan@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox