You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.3 KiB
95 lines
2.3 KiB
5 years ago
|
# Copyright 1999-2020 Gentoo Authors
|
||
6 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=7
|
||
|
|
||
5 years ago
|
inherit cmake cuda flag-o-matic toolchain-funcs
|
||
6 years ago
|
|
||
|
DESCRIPTION="Fast approximate nearest neighbor searches in high dimensional spaces"
|
||
5 years ago
|
HOMEPAGE="https://github.com/mariusmuja/flann"
|
||
6 years ago
|
SRC_URI="https://github.com/mariusmuja/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||
|
|
||
|
LICENSE="BSD"
|
||
|
SLOT="0"
|
||
6 years ago
|
KEYWORDS="amd64 ~arm arm64 ~ppc x86 ~amd64-linux ~x86-linux"
|
||
5 years ago
|
IUSE="cuda doc examples mpi octave openmp"
|
||
6 years ago
|
|
||
|
BDEPEND="
|
||
|
app-arch/unzip
|
||
|
doc? ( dev-tex/latex2html )
|
||
|
"
|
||
|
DEPEND="
|
||
5 years ago
|
app-arch/lz4:=
|
||
6 years ago
|
cuda? ( >=dev-util/nvidia-cuda-toolkit-5.5 )
|
||
|
mpi? (
|
||
|
dev-libs/boost:=[mpi]
|
||
5 years ago
|
sci-libs/hdf5[mpi]
|
||
6 years ago
|
)
|
||
|
!mpi? ( !sci-libs/hdf5[mpi] )
|
||
|
octave? ( >=sci-mathematics/octave-3.6.4-r1 )
|
||
|
"
|
||
|
RDEPEND="${DEPEND}"
|
||
|
# TODO:
|
||
|
# readd dependencies for test suite,
|
||
|
# requires multiple ruby dependencies
|
||
|
|
||
|
PATCHES=(
|
||
6 years ago
|
"${FILESDIR}"/${P}-cmake-3.11{,-1}.patch # bug 678030
|
||
6 years ago
|
"${FILESDIR}"/${P}-cuda-9.patch
|
||
5 years ago
|
"${FILESDIR}"/${P}-system-lz4.patch # bug 681898
|
||
6 years ago
|
)
|
||
|
|
||
|
pkg_pretend() {
|
||
|
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
||
|
}
|
||
|
|
||
|
pkg_setup() {
|
||
|
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
||
|
}
|
||
|
|
||
|
src_prepare() {
|
||
|
# bug #302621
|
||
|
use mpi && export CXX=mpicxx
|
||
|
# produce pure octave files
|
||
|
# octave gentoo installation for .m files respected
|
||
|
sed -i \
|
||
|
-e 's/--mex//' \
|
||
|
-e 's/\.mex/\.oct/' \
|
||
|
-e '/FILES/s/${MEX_FILE}//' \
|
||
|
-e 's:share/flann/octave:share/octave/site/m:' \
|
||
|
-e "/CUSTOM_TARGET/a\INSTALL(FILES \${MEX_FILE} DESTINATION libexec/octave/site/oct/${CHOST})" \
|
||
|
src/matlab/CMakeLists.txt || die
|
||
|
use cuda && cuda_src_prepare
|
||
|
|
||
5 years ago
|
cmake_src_prepare
|
||
6 years ago
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
append-cxxflags -std=c++11
|
||
|
|
||
5 years ago
|
# python bindings are split off into dev-python/pyflann
|
||
6 years ago
|
local mycmakeargs=(
|
||
|
-DBUILD_C_BINDINGS=ON
|
||
|
-DBUILD_PYTHON_BINDINGS=OFF
|
||
|
-DPYTHON_EXECUTABLE=
|
||
|
-DBUILD_CUDA_LIB=$(usex cuda)
|
||
|
-DBUILD_EXAMPLES=$(usex examples)
|
||
|
-DBUILD_DOC=$(usex doc)
|
||
|
-DBUILD_TESTS=OFF
|
||
|
-DBUILD_MATLAB_BINDINGS=$(usex octave)
|
||
|
-DUSE_MPI=$(usex mpi)
|
||
|
-DUSE_OPENMP=$(usex openmp)
|
||
|
)
|
||
|
use cuda && mycmakeargs+=(
|
||
|
-DCUDA_NVCC_FLAGS="${NVCCFLAGS} --linker-options \"-arsch\""
|
||
|
)
|
||
|
use doc && mycmakeargs+=( -DDOCDIR=share/doc/${PF} )
|
||
|
|
||
5 years ago
|
cmake_src_configure
|
||
6 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
5 years ago
|
cmake_src_install
|
||
|
find "${D}" -name 'lib*.a' -delete || die
|
||
6 years ago
|
}
|