From 66c20862c60fa289501af0c217492bcad4eb1c05 Mon Sep 17 00:00:00 2001 From: pranathivemuri Date: Sun, 24 Jan 2016 01:32:20 -0600 Subject: [PATCH] external libraries required for netmets added through Cmake --- CMakeLists.txt | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ FindANN.cmake | 44 ++++++++++++++++++++++++++++++++++++++++++++ FindSTIM.cmake | 9 +++++++++ 3 files changed, 110 insertions(+), 0 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 FindANN.cmake create mode 100644 FindSTIM.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8ede322 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,57 @@ +#Specify the version being used aswell as the language +cmake_minimum_required(VERSION 2.8.11) + +#Name your project here +project(netMets) + +#set the module directory +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") + +#set up CUDA +find_package(CUDA REQUIRED) + +#find the STIM library +find_package(STIM REQUIRED) + +#find BOOST +find_package(Boost REQUIRED) + +#find the pthreads package +find_package(Threads) + +#find the X11 package +find_package(X11) + + +#find the Approximate Nearest Neighbor Library +find_package(ANN REQUIRED) + +include_directories( + ${STIM_INCLUDE_DIRS} + ${ANN_INCLUDE_DIR} + ${Boost_INCLUDE_DIR} + ) + +#Assign source files to the appropriate variables +file(GLOB SRC_CPP "*.cpp") +file(GLOB SRC_H "*.h") +file(GLOB SRC_CU "*.cu") +file(GLOB SRC_CUH "*.cuh") + +#create an executable file +cuda_add_executable(netmets + ${SRC_H} + ${SRC_CPP} + ${SRC_CU} + ${SRC_CUH} + ) + +#set the link libraries +target_link_libraries(netmets + #${CUDA_cufft_LIBRARY} + #${CUDA_cublas_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} + ${ANN_LIBRARY} + ${X11_LIBRARIES} + ) + diff --git a/FindANN.cmake b/FindANN.cmake new file mode 100644 index 0000000..0fa89ae --- /dev/null +++ b/FindANN.cmake @@ -0,0 +1,44 @@ +# - Try to find ANN +# Once done this will define +# +# ANN_FOUND - system has ANN +# ANN_INCLUDE_DIR - the ANN include directory +# ANN_LIBRARY - Link these to use ANN +# + +IF (ANN_INCLUDE_DIRS) + # Already in cache, be silent + SET(ANN_FIND_QUIETLY TRUE) +ENDIF (ANN_INCLUDE_DIRS) + +FIND_PATH( ANN_INCLUDE_DIR ANN/ANN.h + PATHS "/usr/include" "C:/libs/ANN/include") + +if( WIN32 ) + + set(ANN_LIBRARY $ENV{ANN_PATH}\\ANN.lib) + set(ANN_INCLUDE_DIR $ENV{ANN_PATH}) + + + + + # Store the library dir. May be used for linking to dll! + # GET_FILENAME_COMPONENT( ANN_LIBRARY_DIR ${ANN_LIBRARY} PATH ) + + find_package_handle_standard_args(ANN DEFAULT_MSG ANN_INCLUDE_DIR) + +else (WIN32) + + FIND_LIBRARY( ANN_LIBRARY + NAMES ann ANN + PATHS /lib /usr/lib /usr/lib64 /usr/local/lib ) + +endif( WIN32) + + +IF (ANN_INCLUDE_DIR AND ANN_LIBRARY) + SET(ANN_FOUND TRUE) +ELSE (ANN_INCLUDE_DIR AND ANN_LIBRARY) + SET( ANN_FOUND FALSE ) +ENDIF (ANN_INCLUDE_DIR AND ANN_LIBRARY) + diff --git a/FindSTIM.cmake b/FindSTIM.cmake new file mode 100644 index 0000000..700157d --- /dev/null +++ b/FindSTIM.cmake @@ -0,0 +1,9 @@ +include(FindPackageHandleStandardArgs) + +set(STIM_INCLUDE_DIR $ENV{STIMLIB_PATH}) + +find_package_handle_standard_args(STIM DEFAULT_MSG STIM_INCLUDE_DIR) + +if(STIM_FOUND) + set(STIM_INCLUDE_DIRS ${STIM_INCLUDE_DIR}) +endif() \ No newline at end of file -- libgit2 0.21.4