CMakeLists.txt 1.71 KB
Newer Older
qon's avatar
qon committed
1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
PROJECT( BioEM )
qon's avatar
qon committed
3

4
5
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
qon's avatar
qon committed
6

7
FIND_PACKAGE(CUDA)
qon's avatar
qon committed
8

9
FIND_PACKAGE(PkgConfig REQUIRED)
qon's avatar
qon committed
10

11
12
PKG_CHECK_MODULES(FFTW fftw3 REQUIRED)
INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIRS})
qon's avatar
qon committed
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
FIND_PACKAGE(Boost 1.54 REQUIRED)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})

FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
	SET( CMAKE_CXX_FLAGS ${OpenMP_CXX_FLAGS})
	ADD_DEFINITIONS(-DWITH_OPENMP)
ENDIF()

SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native -fopenmp -fweb -mfpmath=sse -frename-registers -minline-all-stringops -ftracer -funroll-loops -fpeel-loops -fprefetch-loop-arrays -ffast-math -ggdb" )
SET( CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_35;--use_fast_math;-ftz=true;-O4;-Xptxas -O4" )

INCLUDE_DIRECTORIES( include $HOME/usr/include )

IF(CUDA_FOUND)
	ADD_DEFINITIONS(-DWITH_CUDA)
	CUDA_ADD_EXECUTABLE( bioEM bioem.cpp  main.cpp  map.cpp  model.cpp  param.cpp cmodules/timer.cpp bioem_cuda.cu )
ELSE()
	ADD_EXECUTABLE( bioEM bioem.cpp  main.cpp  map.cpp  model.cpp  param.cpp cmodules/timer.cpp )
ENDIF()
TARGET_LINK_LIBRARIES(bioEM -L${FFTW_LIBDIR} -lfftw3 -lfftw3f)
TARGET_LINK_LIBRARIES(bioEM -L${Boost_LIBRARY_DIRS} -lboost_program_options)

SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-vla -Wno-unused-result -pedantic" )

message(STATUS "FFTW library: ${FFTW_LIBDIR}")
message(STATUS "Boost directory: ${Boost_LIBRARY_DIRS}")
message(STATUS "FFTW includedir: ${FFTW_INCLUDEDIR}")

#get_cmake_property(_variableNames VARIABLES)
#foreach (_variableName ${_variableNames})
#message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()