-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists_midway.txt
73 lines (56 loc) · 2.1 KB
/
CMakeLists_midway.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# CMake makefile.
# To build the program, do
# mkdir -p build/
# cd build/
# cmake ..
# make
cmake_minimum_required (VERSION 2.6)
project (MDengine)
# Set the version number
set (VERSION_MAJOR 0)
set (VERSION_MINOR 4)
# Activate debug output of called with -DDEBUG=1
if (DEBUG)
set (CMAKE_BUILD_TYPE "DEBUG")
set (CUDA_VERBOSE_BUILD ON)
set (CMAKE_VERBOSE_MAKEFILE ON)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -pedantic")
set (CUDA_NVCC_DEBUG_FLAGS -Xcompiler -Wall;)
endif (DEBUG)
if (CMAKE_BUILD_TYPE MATCHES "RELEASE")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif ()
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpic")
# Find CUDA
find_package(CUDA REQUIRED)
set (CUDA_PROPAGATE_HOST_FLAGS OFF)
set (custom_cuda_flags -std=c++11; -Xcompiler -fpic; --use_fast_math; --prec-div=true; --prec-sqrt=true;)
#set (custom_cuda_flags -std=c++11; -Xcompiler -fpic; )
list (APPEND CUDA_NVCC_FLAGS ${custom_cuda_flags})
list (APPEND CUDA_NVCC_FLAGS ${CUDA_NVCC_DEBUG_FLAGS})
get_filename_component (CUDA_CUFFT_LIBRARY_PATH ${CUDA_CUFFT_LIBRARIES} DIRECTORY)
# Find Python libraries
#set (PYTHON_LIBRARY "/software/python-2.7-2014q1-el6-x86_64/lib")
set (PYTHON_INCLUDE_DIR "/software/python-2.7-2014q1-el6-x86_64/include/python2.7")
set (PYTHON_LIBRARIES
"/software/python-2.7-2014q1-el6-x86_64/lib/libpython2.7.so")
#find_package (PythonLibs 2.7 REQUIRED)
include_directories (${PYTHON_INCLUDE_DIR}) #removed an S here
#get_filename_component (PYTHON_LIBRARY_PATH ${PYTHON_LIBRARIES} DIRECTORY)
# Find boost
find_package (Boost 1.62.0 COMPONENTS python REQUIRED)
message (STATUS "Building MD_engine Version ${VERSION_MAJOR}.${VERSION_MINOR}")
# Create configuration file
configure_file (
"${PROJECT_SOURCE_DIR}/Config.h.in"
"${PROJECT_BINARY_DIR}/Config.h"
)
include_directories ("${PROJECT_BINARY_DIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
set (MD_ENGINE_LIB_NAME DASH)
add_subdirectory (src)
#add src directory
# Install Python library
add_subdirectory (python)
# Add tests