1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs cmake-utils
8 DESCRIPTION="Common bricks library for building distributed machine learning."
9 HOMEPAGE="https://github.com/dmlc/dmlc-core"
11 if [[ ${PV} == *9999* ]] ; then
12 EGIT_REPO_URI="https://github.com/dmlc/${PN}.git"
16 EGIT_COMMIT="54db57d5d1b2a7b93319053011802888b827a539"
18 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
19 SRC_URI="${HOMEPAGE}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
25 # hdfs needs big java hdfs not yet in portage
26 # azure not yet in portage
27 IUSE="doc openmp s3 test"
28 RESTRICT="!test? ( test )"
30 RDEPEND="net-misc/curl[ssl]"
32 doc? ( app-doc/doxygen )
33 test? ( dev-cpp/gtest )
36 PATCHES=( "${FILESDIR}"/${PN}-install-dirs.patch )
39 [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
43 [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
47 cmake-utils_src_prepare
48 # respect user flags (SSE2 does nothing more than adding -msse2)
49 # also doc install everything so remove
51 -e '/check_cxx.*SSE2/d' \
52 -i CMakeLists.txt || die
53 # all these hacks below to allow testing
54 sed -e 's|-O3||' -e 's|-lm|-lm -L$(LD_LIBRARY_PATH) -ldmlc|g' -i Makefile || die
55 sed -e "s|libdmlc.a||g" \
56 -i test/dmlc_test.mk test/unittest/dmlc_unittest.mk || die
57 cat <<-EOF > config.mk
60 USE_OPENMP=$(use openmp && echo 1 || echo 0)
61 USE_S3=$(use s3 && echo 1 || echo 0)
62 BUILD_TEST=$(use test && echo 1 || echo 0)
63 DMLC_CFLAGS=${CXXFLAGS}
64 DMLC_LDFLAGS=${LDFLAGS}
70 -DBUILD_SHARED_LIBS=ON
72 -DUSE_OPENMP="$(usex openmp)"
74 cmake-utils_src_configure
78 cmake-utils_src_compile
80 doxygen doc/Doxyfile || die
86 export LD_LIBRARY_PATH="${BUILD_DIR}"
88 test/unittest/dmlc_unittest || die
92 cmake-utils_src_install
94 insinto /usr/share/doc/${PF}
95 doins -r doc/doxygen/html
96 docompress -x /usr/share/doc/${PF}/html