aboutsummaryrefslogtreecommitdiff
path: root/math/flann
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2017-12-30 19:45:33 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2017-12-30 19:45:33 +0000
commit936f63cf4abecfb74483928cc0cca9b85839d714 (patch)
tree7a68a1f09c5768881c5a2db42944122fc257ccda /math/flann
parentd4fe4df264242abc78b1b615c8ae6f8a9f4b5c33 (diff)
Notes
Diffstat (limited to 'math/flann')
-rw-r--r--math/flann/Makefile30
-rw-r--r--math/flann/distinfo3
-rw-r--r--math/flann/files/patch-examples_CMakeLists.txt29
-rw-r--r--math/flann/files/patch-src_cpp_CMakeLists.txt29
-rw-r--r--math/flann/files/patch-src_cpp_flann_algorithms_kdtree__index.h19
-rw-r--r--math/flann/pkg-descr9
-rw-r--r--math/flann/pkg-plist58
7 files changed, 177 insertions, 0 deletions
diff --git a/math/flann/Makefile b/math/flann/Makefile
new file mode 100644
index 000000000000..a5a8908cb2a9
--- /dev/null
+++ b/math/flann/Makefile
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+PORTNAME= flann
+DISTVERSION= 1.8.4
+DISTVERSIONSUFFIX= -src
+CATEGORIES= math
+MASTER_SITES= http://people.cs.ubc.ca/~mariusm/uploads/FLANN/
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Library for fast nearest neighbor searches in high dimensional spaces
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+LIB_DEPENDS= libhdf5.so:science/hdf5 \
+ libsz.so:science/szip
+
+USES= cmake:outsource zip
+CMAKE_ARGS= -DBUILD_PYTHON_BINDINGS:BOOL=OFF \
+ -DBUILD_MATLAB_BINDINGS:BOOL=OFF \
+ -DEXAMPLES_SUBDIR:STRING="share/examples/flann" \
+ -DUSE_OPENMP:BOOL=OFF # OpenMP search is broken in cmake: https://gitlab.kitware.com/cmake/cmake/issues/17474
+USE_LDCONFIG= yes
+
+OPTIONS_DEFINE= DOCS EXAMPLES
+PLIST_SUB= SHL3=${DISTVERSION} SHL2=${DISTVERSION:R}
+
+EXAMPLES_CMAKE_BOOL= BUILD_EXAMPLES
+
+.include <bsd.port.mk>
diff --git a/math/flann/distinfo b/math/flann/distinfo
new file mode 100644
index 000000000000..1d03f49a3d4a
--- /dev/null
+++ b/math/flann/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1514618300
+SHA256 (flann-1.8.4-src.zip) = dfbb9321b0d687626a644c70872a2c540b16200e7f4c7bd72f91ae032f445c08
+SIZE (flann-1.8.4-src.zip) = 561057
diff --git a/math/flann/files/patch-examples_CMakeLists.txt b/math/flann/files/patch-examples_CMakeLists.txt
new file mode 100644
index 000000000000..372ca104959a
--- /dev/null
+++ b/math/flann/files/patch-examples_CMakeLists.txt
@@ -0,0 +1,29 @@
+--- examples/CMakeLists.txt.orig 2013-01-16 06:38:32 UTC
++++ examples/CMakeLists.txt
+@@ -7,7 +7,7 @@ if (BUILD_C_BINDINGS)
+ set_target_properties(flann_example_c PROPERTIES COMPILE_FLAGS -std=c99)
+
+ add_dependencies(examples flann_example_c)
+- install (TARGETS flann_example_c DESTINATION bin )
++ install (TARGETS flann_example_c DESTINATION ${EXAMPLES_SUBDIR})
+ endif()
+
+ if (HDF5_FOUND)
+@@ -20,7 +20,7 @@ if (HDF5_FOUND)
+ endif()
+
+ add_dependencies(examples flann_example_cpp)
+- install (TARGETS flann_example_cpp DESTINATION bin)
++ install (TARGETS flann_example_cpp DESTINATION ${EXAMPLES_SUBDIR})
+
+
+ if (USE_MPI AND HDF5_IS_PARALLEL)
+@@ -28,7 +28,7 @@ if (HDF5_FOUND)
+ target_link_libraries(flann_example_mpi flann_cpp ${HDF5_LIBRARIES} ${MPI_LIBRARIES} ${Boost_LIBRARIES})
+
+ add_dependencies(examples flann_example_mpi)
+- install (TARGETS flann_example_mpi DESTINATION bin)
++ install (TARGETS flann_example_mpi DESTINATION ${EXAMPLES_SUBDIR})
+ endif()
+ else()
+ message("hdf5 library not found, not compiling flann_example.cpp")
diff --git a/math/flann/files/patch-src_cpp_CMakeLists.txt b/math/flann/files/patch-src_cpp_CMakeLists.txt
new file mode 100644
index 000000000000..ea8e1156176c
--- /dev/null
+++ b/math/flann/files/patch-src_cpp_CMakeLists.txt
@@ -0,0 +1,29 @@
+--- src/cpp/CMakeLists.txt.orig 2013-01-16 06:38:32 UTC
++++ src/cpp/CMakeLists.txt
+@@ -8,7 +8,7 @@ file(GLOB_RECURSE C_SOURCES flann.cpp)
+ file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp)
+ file(GLOB_RECURSE CU_SOURCES *.cu)
+
+-add_library(flann_cpp_s STATIC ${CPP_SOURCES})
++add_library(flann_cpp_s SHARED ${CPP_SOURCES})
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ set_target_properties(flann_cpp_s PROPERTIES COMPILE_FLAGS -fPIC)
+ endif()
+@@ -24,7 +24,7 @@ if (BUILD_CUDA_LIB)
+ else()
+ set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-arch=sm_13" )
+ endif()
+- cuda_add_library(flann_cuda_s STATIC ${CU_SOURCES})
++ cuda_add_library(flann_cuda_s SHARED ${CU_SOURCES})
+ set_property(TARGET flann_cuda_s PROPERTY COMPILE_DEFINITIONS FLANN_STATIC)
+ endif()
+
+@@ -76,7 +76,7 @@ endif()
+
+
+ if (BUILD_C_BINDINGS)
+- add_library(flann_s STATIC ${C_SOURCES})
++ add_library(flann_s SHARED ${C_SOURCES})
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ set_target_properties(flann_s PROPERTIES COMPILE_FLAGS -fPIC)
+ endif()
diff --git a/math/flann/files/patch-src_cpp_flann_algorithms_kdtree__index.h b/math/flann/files/patch-src_cpp_flann_algorithms_kdtree__index.h
new file mode 100644
index 000000000000..27c54262e392
--- /dev/null
+++ b/math/flann/files/patch-src_cpp_flann_algorithms_kdtree__index.h
@@ -0,0 +1,19 @@
+--- src/cpp/flann/algorithms/kdtree_index.h.orig 2013-01-16 06:38:32 UTC
++++ src/cpp/flann/algorithms/kdtree_index.h
+@@ -36,6 +36,7 @@
+ #include <cassert>
+ #include <cstring>
+ #include <stdarg.h>
++#include <math.h>
+
+ #include "flann/general.h"
+ #include "flann/algorithms/nn_index.h"
+@@ -663,7 +664,7 @@ private:
+ ElementType max_span = 0;
+ size_t div_feat = 0;
+ for (size_t i=0;i<veclen_;++i) {
+- ElementType span = abs(point[i]-leaf_point[i]);
++ ElementType span = fabs(point[i]-leaf_point[i]);
+ if (span > max_span) {
+ max_span = span;
+ div_feat = i;
diff --git a/math/flann/pkg-descr b/math/flann/pkg-descr
new file mode 100644
index 000000000000..7f37a5846701
--- /dev/null
+++ b/math/flann/pkg-descr
@@ -0,0 +1,9 @@
+FLANN is a library for performing fast approximate nearest neighbor searches in
+high dimensional spaces. It contains a collection of algorithms we found to
+work best for nearest neighbor search and a system for automatically choosing
+the best algorithm and optimum parameters depending on the dataset.
+
+FLANN is written in C++ and contains bindings for the following languages: C,
+MATLAB and Python.
+
+WWW: https://www.cs.ubc.ca/research/flann
diff --git a/math/flann/pkg-plist b/math/flann/pkg-plist
new file mode 100644
index 000000000000..9e30fc268685
--- /dev/null
+++ b/math/flann/pkg-plist
@@ -0,0 +1,58 @@
+include/flann/algorithms/all_indices.h
+include/flann/algorithms/autotuned_index.h
+include/flann/algorithms/center_chooser.h
+include/flann/algorithms/composite_index.h
+include/flann/algorithms/dist.h
+include/flann/algorithms/hierarchical_clustering_index.h
+include/flann/algorithms/kdtree_cuda_3d_index.h
+include/flann/algorithms/kdtree_cuda_builder.h
+include/flann/algorithms/kdtree_index.h
+include/flann/algorithms/kdtree_single_index.h
+include/flann/algorithms/kmeans_index.h
+include/flann/algorithms/linear_index.h
+include/flann/algorithms/lsh_index.h
+include/flann/algorithms/nn_index.h
+include/flann/config.h
+include/flann/defines.h
+include/flann/flann.h
+include/flann/flann.hpp
+include/flann/general.h
+include/flann/io/hdf5.h
+include/flann/mpi/client.h
+include/flann/mpi/index.h
+include/flann/mpi/matrix.h
+include/flann/mpi/queries.h
+include/flann/mpi/server.h
+include/flann/nn/ground_truth.h
+include/flann/nn/index_testing.h
+include/flann/nn/simplex_downhill.h
+include/flann/util/allocator.h
+include/flann/util/any.h
+include/flann/util/cuda/heap.h
+include/flann/util/cuda/result_set.h
+include/flann/util/cutil_math.h
+include/flann/util/dynamic_bitset.h
+include/flann/util/heap.h
+include/flann/util/logger.h
+include/flann/util/lsh_table.h
+include/flann/util/matrix.h
+include/flann/util/object_factory.h
+include/flann/util/params.h
+include/flann/util/random.h
+include/flann/util/result_set.h
+include/flann/util/sampling.h
+include/flann/util/saving.h
+include/flann/util/serialization.h
+include/flann/util/timer.h
+lib/libflann.so
+lib/libflann.so.%%SHL2%%
+lib/libflann.so.%%SHL3%%
+lib/libflann_cpp.so
+lib/libflann_cpp.so.%%SHL2%%
+lib/libflann_cpp.so.%%SHL3%%
+lib/libflann_cpp_s.so
+lib/libflann_s.so
+libdata/pkgconfig/flann.pc
+%%PORTDOCS%%%%DOCSDIR%%/manual.pdf
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flann_example_c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flann_example_cpp