Commit 1e449080 authored by David Rohr's avatar David Rohr
Browse files

Update CMake File, cleanup, add WITH_CUDA and WITH_OPENMP defines, add fftw3 float lib

parent 58122acc
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( BioEM )
FIND_PACKAGE(CUDA)
PROJECT( BioEM )
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" )
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
INCLUDE_DIRECTORIES( include $HOME/usr/include )
FIND_PACKAGE(CUDA)
CUDA_ADD_EXECUTABLE( bioEM bioem.cpp main.cpp map.cpp model.cpp param.cpp cmodules/timer.cpp bioem_cuda.cu )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-vla -Wno-unused-result -pedantic" )
FIND_PACKAGE(PkgConfig REQUIRED)
TARGET_LINK_LIBRARIES( bioEM -lfftw3 -fopenmp -lboost_program_options )
PKG_CHECK_MODULES(FFTW fftw3 REQUIRED)
INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIRS})
\ No newline at end of file
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()
......@@ -32,11 +32,13 @@ int main(int argc, char* argv[])
HighResTimer timer;
bioem* bio;
#ifdef WITH_CUDA
if (getenv("GPU") && atoi(getenv("GPU")))
{
bio = bioem_cuda_create();
}
else
#endif
{
bio = new bioem;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment