flann: enable OpenMP

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
This commit is contained in:
Timothy Gu 2014-08-11 11:25:40 -07:00
parent bc62054168
commit 4202b74cc1
2 changed files with 35 additions and 2 deletions

View File

@ -0,0 +1,33 @@
This file is part of MXE.
See index.html for further information.
From ce062a2d900aa215c301d327084a6d04da283005 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Mon, 11 Aug 2014 10:45:43 -0700
Subject: [PATCH] Fix OpenMP on MinGW
Based on patch by https://github.com/mariusmuja/flann/pull/104
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
---
src/cpp/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
index 7e6e353..0218f50 100644
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -68,6 +68,10 @@ if (BUILD_C_BINDINGS)
RUNTIME DESTINATION share/flann/matlab
)
endif(WIN32 AND BUILD_SHARED_LIBS)
+
+ if(MINGW AND USE_OPENMP)
+ target_link_libraries(flann -lgomp)
+ endif(MINGW AND USE_OPENMP)
endif()
install (
--
1.9.1

View File

@ -8,7 +8,7 @@ $(PKG)_CHECKSUM := e03d9d458757f70f6af1d330ff453e3621550a4f
$(PKG)_SUBDIR := flann-$($(PKG)_VERSION)-src
$(PKG)_FILE := flann-$($(PKG)_VERSION)-src.zip
$(PKG)_URL := http://people.cs.ubc.ca/~mariusm/uploads/FLANN/$($(PKG)_FILE)
$(PKG)_DEPS := gcc
$(PKG)_DEPS := gcc libgomp
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://people.cs.ubc.ca/~mariusm/index.php/FLANN/Changelog' | \
@ -27,6 +27,6 @@ define $(PKG)_BUILD
-DBUILD_CUDA_LIB=OFF \
-DBUILD_MATLAB_BINDINGS=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DUSE_OPENMP=OFF
-DUSE_OPENMP=ON
$(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1
endef