public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/flann/files/, sci-libs/flann/
@ 2019-02-17 12:39 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2019-02-17 12:39 UTC (permalink / raw
  To: gentoo-commits

commit:     10670e7e6bcefd2e396297bd4ea36e884af28198
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 17 12:26:59 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Feb 17 12:39:00 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10670e7e

sci-libs/flann: Fix build with CUDA > 9.0

Supposedly.

Closes: https://bugs.gentoo.org/678030
Package-Manager: Portage-2.3.60, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 sci-libs/flann/files/flann-1.9.1-cuda-9.patch | 22 ++++++++++++++++++++++
 sci-libs/flann/flann-1.9.1-r2.ebuild          |  5 ++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/sci-libs/flann/files/flann-1.9.1-cuda-9.patch b/sci-libs/flann/files/flann-1.9.1-cuda-9.patch
new file mode 100644
index 00000000000..561c379af9a
--- /dev/null
+++ b/sci-libs/flann/files/flann-1.9.1-cuda-9.patch
@@ -0,0 +1,22 @@
+From b9dd074526c18e7423085853518b58d602cb0b57 Mon Sep 17 00:00:00 2001
+From: "Petr A. Ermolaev" <petr.a.ermolaev@gmail.com>
+Date: Fri, 4 May 2018 07:50:24 +0000
+Subject: [PATCH] fix compilation via gcc and cuda 9.1 add missing #include
+ <thrust/gather> to kdtree_cuda_3d_index.cu
+
+---
+ src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu b/src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu
+index e9b05080..8465322e 100644
+--- a/src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu
++++ b/src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu
+@@ -32,6 +32,7 @@
+ #include <flann/util/cuda/result_set.h>
+ // #define THRUST_DEBUG 1
+ #include <cuda.h>
++#include <thrust/gather.h>
+ #include <thrust/copy.h>
+ #include <thrust/device_vector.h>
+ #include <vector_types.h>

diff --git a/sci-libs/flann/flann-1.9.1-r2.ebuild b/sci-libs/flann/flann-1.9.1-r2.ebuild
index 73e6a60c52b..c240ca1dcf1 100644
--- a/sci-libs/flann/flann-1.9.1-r2.ebuild
+++ b/sci-libs/flann/flann-1.9.1-r2.ebuild
@@ -32,7 +32,10 @@ RDEPEND="${DEPEND}"
 # readd dependencies for test suite,
 # requires multiple ruby dependencies
 
-PATCHES=( "${FILESDIR}"/flann-1.9.1-cmake-3.11.patch )
+PATCHES=(
+	"${FILESDIR}"/${P}-cmake-3.11.patch
+	"${FILESDIR}"/${P}-cuda-9.patch
+)
 
 pkg_pretend() {
 	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp


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

* [gentoo-commits] repo/gentoo:master commit in: sci-libs/flann/files/, sci-libs/flann/
@ 2019-05-19 21:19 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2019-05-19 21:19 UTC (permalink / raw
  To: gentoo-commits

commit:     9a4be0df9bfd7588f37b0721568571e614608a8f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun May 19 21:18:08 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun May 19 21:18:08 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a4be0df

sci-libs/flann: Add another fix for >=cmake-3.11 with cuda

Thanks-to: LE GARREC Vincent <gentoo.bugzilla <AT> le-garrec.fr>
Closes: https://bugs.gentoo.org/678030
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 sci-libs/flann/files/flann-1.9.1-cmake-3.11-1.patch | 11 +++++++++++
 sci-libs/flann/flann-1.9.1-r2.ebuild                |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/sci-libs/flann/files/flann-1.9.1-cmake-3.11-1.patch b/sci-libs/flann/files/flann-1.9.1-cmake-3.11-1.patch
new file mode 100644
index 00000000000..4cf8f3a990f
--- /dev/null
+++ b/sci-libs/flann/files/flann-1.9.1-cmake-3.11-1.patch
@@ -0,0 +1,11 @@
+--- a/src/cpp/CMakeLists.txt	2019-02-14 21:58:41.567625108 +0100
++++ b/src/cpp/CMakeLists.txt	2019-02-14 21:59:04.017920926 +0100
+@@ -34,7 +34,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AN
+     target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)
+ 
+     if (BUILD_CUDA_LIB)
+-	    cuda_add_library(flann_cuda SHARED "")
++	    cuda_add_library(flann_cuda SHARED "empty.cpp")
+         set_target_properties(flann_cuda PROPERTIES LINKER_LANGUAGE CXX)
+         target_link_libraries(flann_cuda -Wl,-whole-archive flann_cuda_s -Wl,-no-whole-archive)
+         set_property(TARGET flann_cpp_s PROPERTY COMPILE_DEFINITIONS FLANN_USE_CUDA)

diff --git a/sci-libs/flann/flann-1.9.1-r2.ebuild b/sci-libs/flann/flann-1.9.1-r2.ebuild
index b628b93c4ce..4b72bf9fbe2 100644
--- a/sci-libs/flann/flann-1.9.1-r2.ebuild
+++ b/sci-libs/flann/flann-1.9.1-r2.ebuild
@@ -33,7 +33,7 @@ RDEPEND="${DEPEND}"
 # requires multiple ruby dependencies
 
 PATCHES=(
-	"${FILESDIR}"/${P}-cmake-3.11.patch
+	"${FILESDIR}"/${P}-cmake-3.11{,-1}.patch # bug 678030
 	"${FILESDIR}"/${P}-cuda-9.patch
 )
 


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

* [gentoo-commits] repo/gentoo:master commit in: sci-libs/flann/files/, sci-libs/flann/
@ 2022-02-18  3:07 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2022-02-18  3:07 UTC (permalink / raw
  To: gentoo-commits

commit:     7e0b5dc2646707633bf113215c122a8f045476b1
Author:     Alexander Golubev <fatzer2 <AT> gmail <DOT> com>
AuthorDate: Wed Feb 16 22:05:23 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 18 03:05:14 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e0b5dc2

sci-libs/flann: revbump to fix MATLAB support

+ Avoid sed'ing cmake files
+ Install octave files to a more opropriate locationa
Bug: https://bugs.gentoo.org/830424

Signed-off-by: Alexander Golubev <fatzer2 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...uild-oct-rather-than-mex-files-for-octave.patch | 81 ++++++++++++++++++++
 sci-libs/flann/flann-1.9.1-r5.ebuild               | 88 ++++++++++++++++++++++
 2 files changed, 169 insertions(+)

diff --git a/sci-libs/flann/files/flann-1.9.1-build-oct-rather-than-mex-files-for-octave.patch b/sci-libs/flann/files/flann-1.9.1-build-oct-rather-than-mex-files-for-octave.patch
new file mode 100644
index 000000000000..f29aef41977c
--- /dev/null
+++ b/sci-libs/flann/files/flann-1.9.1-build-oct-rather-than-mex-files-for-octave.patch
@@ -0,0 +1,81 @@
+From 85d2acc120b0640d02d189089bf113d351c14bba Mon Sep 17 00:00:00 2001
+From: Alexander Golubev <fatzer2@gmail.com>
+Date: Wed, 16 Feb 2022 21:37:55 +0300
+Subject: [PATCH] build *.oct rather than *.mex files for octave
+
+ * build .oct filse rather than *.mex
+ * install the file to a sane location obtained from octave-config
+ * fix a build issue with a recent cmake doesn't like querying target
+   LOCATION
+
+Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
+---
+ src/matlab/CMakeLists.txt | 28 ++++++++++++++++++----------
+ 1 file changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/src/matlab/CMakeLists.txt b/src/matlab/CMakeLists.txt
+index a89b6b8..ebacaea 100755
+--- a/src/matlab/CMakeLists.txt
++++ b/src/matlab/CMakeLists.txt
+@@ -16,9 +16,6 @@ endif()
+ 
+ find_program(OCT_CMD mkoctfile)
+ 
+-get_property(FLANN_LIB_LOCATION TARGET flann_s PROPERTY LOCATION)
+-get_filename_component(FLANN_LIB_PATH ${FLANN_LIB_LOCATION} PATH)
+-
+ if(MEX_CMD AND MEXEXT_CMD)
+ 
+     get_filename_component(MEX_REAL_CMD ${MEX_CMD} ABSOLUTE)
+@@ -48,7 +45,7 @@ if(MEX_CMD AND MEXEXT_CMD)
+         ADD_CUSTOM_COMMAND(
+             OUTPUT ${MEX_FILE}
+             COMMAND ${MEX_REAL_CMD}
+-            ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp -I${PROJECT_SOURCE_DIR}/src/cpp -L${FLANN_LIB_PATH} -lflann_s ${MEX_BUILD_FLAGS}
++            ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp -I${PROJECT_SOURCE_DIR}/src/cpp -L${PROJECT_BINARY_DIR}/lib -lflann_s ${MEX_BUILD_FLAGS}
+             DEPENDS flann_s ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp
+             COMMENT "Building MEX extension ${MEX_FILE}"
+         )
+@@ -66,11 +63,11 @@ if(MEX_CMD AND MEXEXT_CMD)
+         set(BUILD_MATLAB_BINDINGS OFF) 
+     endif()
+ elseif(OCT_CMD)
+-  SET(MEX_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MEX_NAME}.mex)
++  SET(MEX_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MEX_NAME}.oct)
+   ADD_CUSTOM_COMMAND(
+     OUTPUT ${MEX_FILE}
+     COMMAND ${OCT_CMD}
+-    ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp -I${PROJECT_SOURCE_DIR}/src/cpp -L${FLANN_LIB_PATH} -DFLANN_STATIC -lflann_s -lgomp --mex
++    ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp -I${PROJECT_SOURCE_DIR}/src/cpp -L${PROJECT_BINARY_DIR}/lib -DFLANN_STATIC -lflann_s -lgomp
+     DEPENDS flann_s ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp
+     COMMENT "Building MEX extension ${MEX_FILE}"
+     )
+@@ -79,10 +76,21 @@ elseif(OCT_CMD)
+ 
+   FILE(GLOB MATLAB_SOURCES *.m)
+ 
+-  INSTALL (
+-    FILES ${MEX_FILE} ${MATLAB_SOURCES}
+-    DESTINATION share/flann/octave
+-    )
++  find_program(OCTAVE_CONFIG_EXECUTABLE NAMES octave-config)
++
++  if (OCTAVE_CONFIG_EXECUTABLE)
++    execute_process (COMMAND ${OCTAVE_CONFIG_EXECUTABLE} --m-site-dir
++                     OUTPUT_VARIABLE OCTAVE_M_SITE_DIR
++                     OUTPUT_STRIP_TRAILING_WHITESPACE)
++
++    execute_process (COMMAND ${OCTAVE_CONFIG_EXECUTABLE} --oct-site-dir
++                      OUTPUT_VARIABLE OCTAVE_OCT_SITE_DIR
++                      OUTPUT_STRIP_TRAILING_WHITESPACE)
++
++  endif()
++
++  INSTALL (FILES ${MEX_FILE} DESTINATION ${OCTAVE_OCT_SITE_DIR})
++  INSTALL (FILES ${MATLAB_SOURCES} DESTINATION ${OCTAVE_M_SITE_DIR})
+ else()
+     message(WARNING "Cannot find MATLAB or Octave instalation. Make sure that the 'bin' directory from the MATLAB instalation or that mkoctfile is in PATH")
+     set(BUILD_MATLAB_BINDINGS OFF) 
+-- 
+2.34.1
+

diff --git a/sci-libs/flann/flann-1.9.1-r5.ebuild b/sci-libs/flann/flann-1.9.1-r5.ebuild
new file mode 100644
index 000000000000..716c7a4fec72
--- /dev/null
+++ b/sci-libs/flann/flann-1.9.1-r5.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake cuda flag-o-matic toolchain-funcs
+
+DESCRIPTION="Fast approximate nearest neighbor searches in high dimensional spaces"
+HOMEPAGE="https://github.com/mariusmuja/flann"
+SRC_URI="https://github.com/mariusmuja/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="cuda doc examples mpi octave openmp"
+
+BDEPEND="
+	app-arch/unzip
+	doc? ( dev-tex/latex2html )
+"
+DEPEND="
+	app-arch/lz4:=
+	cuda? ( >=dev-util/nvidia-cuda-toolkit-5.5 )
+	mpi? (
+		dev-libs/boost:=[mpi]
+		sci-libs/hdf5[mpi]
+	)
+	!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=(
+	"${FILESDIR}"/${P}-cmake-3.11{,-1}.patch # bug 678030
+	"${FILESDIR}"/${P}-cuda-9.patch
+	"${FILESDIR}"/${P}-system-lz4.patch # bug 681898
+	"${FILESDIR}"/${P}-system-lz4-pkgconfig.patch # bug 827263
+	"${FILESDIR}"/${P}-build-oct-rather-than-mex-files-for-octave.patch # bug 830424
+)
+
+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
+
+	use cuda && cuda_src_prepare
+
+	cmake_src_prepare
+}
+
+src_configure() {
+	append-cxxflags -std=c++11
+
+	# python bindings are split off into dev-python/pyflann
+	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} )
+
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+	find "${D}" -name 'lib*.a' -delete || die
+}


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

end of thread, other threads:[~2022-02-18  3:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-17 12:39 [gentoo-commits] repo/gentoo:master commit in: sci-libs/flann/files/, sci-libs/flann/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2019-05-19 21:19 Andreas Sturmlechner
2022-02-18  3:07 Sam James

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