Skip to content

Commit

Permalink
testing/flann: add aport
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj authored and clandmeter committed Apr 11, 2018
1 parent 4284c82 commit fe5137a
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
36 changes: 36 additions & 0 deletions testing/flann/APKBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Contributor: Bradley J Chambers <brad.chambers@gmail.com>
# Maintainer: Bradley J Chambers <brad.chambers@gmail.com>
pkgname=flann
pkgver=1.9.1
pkgrel=0
pkgdesc="Fast Library for Approximate Nearest Neighbors"
url="https://www.cs.ubc.ca/research/flann/"
arch="all"
license="BSD-3-Clause"
# FLANN tests are broken, test data is invalid
options="!check"
depends=""
makedepends="cmake"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/mariusmuja/$pkgname/archive/$pkgver.tar.gz
cmake.patch"
builddir="$srcdir/$pkgname-$pkgver"

build() {
cd "$builddir"

mkdir build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON
make
}

package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}

sha512sums="0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7 flann-1.9.1.tar.gz
786558070bb50e60f4f133242d9b77ce72d248aaa45012345c1d768cf648d9d083698663c4ba54f63ae301fc2fe09859a32b12ef0bff20c53e45d57b424c9f48 cmake.patch"
68 changes: 68 additions & 0 deletions testing/flann/cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
index 49c53f0..9f19406 100644
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -28,25 +28,25 @@ if (BUILD_CUDA_LIB)
set_property(TARGET flann_cuda_s PROPERTY COMPILE_DEFINITIONS FLANN_STATIC)
endif()

-if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
- add_library(flann_cpp SHARED "")
- set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX)
- 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 "")
- 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)
- # target_link_libraries(flann_cuda cudpp_x86_64)
- endif()
-else()
+#if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+# add_library(flann_cpp SHARED "")
+# set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX)
+# 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 "")
+# 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)
+# # target_link_libraries(flann_cuda cudpp_x86_64)
+# endif()
+#else()
add_library(flann_cpp SHARED ${CPP_SOURCES})
if (BUILD_CUDA_LIB)
cuda_add_library(flann_cuda SHARED ${CPP_SOURCES})
set_property(TARGET flann_cpp PROPERTY COMPILE_DEFINITIONS FLANN_USE_CUDA)
endif()
-endif()
+#endif()

set_target_properties(flann_cpp PROPERTIES
VERSION ${FLANN_VERSION}
@@ -82,17 +82,17 @@ if (BUILD_C_BINDINGS)
endif()
set_property(TARGET flann_s PROPERTY COMPILE_DEFINITIONS FLANN_STATIC)

- if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
- add_library(flann SHARED "")
- set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
- target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive)
- else()
+ #if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+ # add_library(flann SHARED "")
+ # set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
+ # target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive)
+ #else()
add_library(flann SHARED ${C_SOURCES})

if(MINGW AND OPENMP_FOUND)
target_link_libraries(flann gomp)
endif()
- endif()
+ #endif()

set_target_properties(flann PROPERTIES
VERSION ${FLANN_VERSION}

0 comments on commit fe5137a

Please sign in to comment.