Commit 66c20862c60fa289501af0c217492bcad4eb1c05

Authored by pranathivemuri
1 parent 4f361e88

external libraries required for netmets added through Cmake

Showing 3 changed files with 110 additions and 0 deletions   Show diff stats
CMakeLists.txt 0 โ†’ 100644
  1 +#Specify the version being used aswell as the language
  2 +cmake_minimum_required(VERSION 2.8.11)
  3 +
  4 +#Name your project here
  5 +project(netMets)
  6 +
  7 +#set the module directory
  8 +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
  9 +
  10 +#set up CUDA
  11 +find_package(CUDA REQUIRED)
  12 +
  13 +#find the STIM library
  14 +find_package(STIM REQUIRED)
  15 +
  16 +#find BOOST
  17 +find_package(Boost REQUIRED)
  18 +
  19 +#find the pthreads package
  20 +find_package(Threads)
  21 +
  22 +#find the X11 package
  23 +find_package(X11)
  24 +
  25 +
  26 +#find the Approximate Nearest Neighbor Library
  27 +find_package(ANN REQUIRED)
  28 +
  29 +include_directories(
  30 + ${STIM_INCLUDE_DIRS}
  31 + ${ANN_INCLUDE_DIR}
  32 + ${Boost_INCLUDE_DIR}
  33 + )
  34 +
  35 +#Assign source files to the appropriate variables
  36 +file(GLOB SRC_CPP "*.cpp")
  37 +file(GLOB SRC_H "*.h")
  38 +file(GLOB SRC_CU "*.cu")
  39 +file(GLOB SRC_CUH "*.cuh")
  40 +
  41 +#create an executable file
  42 +cuda_add_executable(netmets
  43 + ${SRC_H}
  44 + ${SRC_CPP}
  45 + ${SRC_CU}
  46 + ${SRC_CUH}
  47 + )
  48 +
  49 +#set the link libraries
  50 +target_link_libraries(netmets
  51 + #${CUDA_cufft_LIBRARY}
  52 + #${CUDA_cublas_LIBRARY}
  53 + ${CMAKE_THREAD_LIBS_INIT}
  54 + ${ANN_LIBRARY}
  55 + ${X11_LIBRARIES}
  56 + )
  57 +
... ...
FindANN.cmake 0 โ†’ 100644
  1 +# - Try to find ANN
  2 +# Once done this will define
  3 +#
  4 +# ANN_FOUND - system has ANN
  5 +# ANN_INCLUDE_DIR - the ANN include directory
  6 +# ANN_LIBRARY - Link these to use ANN
  7 +#
  8 +
  9 +IF (ANN_INCLUDE_DIRS)
  10 + # Already in cache, be silent
  11 + SET(ANN_FIND_QUIETLY TRUE)
  12 +ENDIF (ANN_INCLUDE_DIRS)
  13 +
  14 +FIND_PATH( ANN_INCLUDE_DIR ANN/ANN.h
  15 + PATHS "/usr/include" "C:/libs/ANN/include")
  16 +
  17 +if( WIN32 )
  18 +
  19 + set(ANN_LIBRARY $ENV{ANN_PATH}\\ANN.lib)
  20 + set(ANN_INCLUDE_DIR $ENV{ANN_PATH})
  21 +
  22 +
  23 +
  24 +
  25 + # Store the library dir. May be used for linking to dll!
  26 + # GET_FILENAME_COMPONENT( ANN_LIBRARY_DIR ${ANN_LIBRARY} PATH )
  27 +
  28 + find_package_handle_standard_args(ANN DEFAULT_MSG ANN_INCLUDE_DIR)
  29 +
  30 +else (WIN32)
  31 +
  32 + FIND_LIBRARY( ANN_LIBRARY
  33 + NAMES ann ANN
  34 + PATHS /lib /usr/lib /usr/lib64 /usr/local/lib )
  35 +
  36 +endif( WIN32)
  37 +
  38 +
  39 +IF (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  40 + SET(ANN_FOUND TRUE)
  41 +ELSE (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  42 + SET( ANN_FOUND FALSE )
  43 +ENDIF (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  44 +
... ...
FindSTIM.cmake 0 โ†’ 100644
  1 +include(FindPackageHandleStandardArgs)
  2 +
  3 +set(STIM_INCLUDE_DIR $ENV{STIMLIB_PATH})
  4 +
  5 +find_package_handle_standard_args(STIM DEFAULT_MSG STIM_INCLUDE_DIR)
  6 +
  7 +if(STIM_FOUND)
  8 + set(STIM_INCLUDE_DIRS ${STIM_INCLUDE_DIR})
  9 +endif()
0 10 \ No newline at end of file
... ...