Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Dwojak <t.dwojak@amu.edu.pl>2016-10-04 13:45:15 +0300
committerTomasz Dwojak <t.dwojak@amu.edu.pl>2016-10-04 14:47:45 +0300
commit10bca74b56ca973ef56a41afbe71464400454f11 (patch)
treed1051675bb1b8b9d59cba7048af6350ef730b1af /CMakeLists.txt
parentddc1f2d7ed2692eb64152f3fcd423d4efdd2322f (diff)
Add NOCUDA option to force compilation without CUDA
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 20 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6ef7fba..b90df98c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,12 +1,20 @@
cmake_minimum_required(VERSION 3.5.1)
+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project(amunn CXX)
+
SET(CMAKE_CXX_FLAGS " -std=c++14 -m64 -flto -march=native -fPIC -g -O3 -Ofast -funroll-loops -ffinite-math-only -Wno-unused-result -Wno-deprecated -pthread")
include_directories(${amunmt_SOURCE_DIR})
-find_package(CUDA)
+set(NOCUDA OFF CACHE BOOL "Compile without CUDA")
+
+if(NOCUDA)
+ message("-- Forcing compilation without CUDA.")
+ add_definitions(-DNO_CUDA)
+else(NOCUDA)
+find_package(CUDA)
if(CUDA_FOUND)
LIST(APPEND CUDA_NVCC_FLAGS --default-stream per-thread; -std=c++11; -g; -O3; -arch=sm_35; -lineinfo; --use_fast_math;)
add_definitions(-DCUDA_API_PER_THREAD_DEFAULT_STREAM)
@@ -15,8 +23,9 @@ else(CUDA_FOUND)
add_definitions(-DNO_CUDA)
message("Cannot find CUDA libraries. Compiling without them." )
endif(CUDA_FOUND)
+endif(NOCUDA)
-find_package(Boost COMPONENTS system filesystem program_options timer iostreams thread)
+find_package(Boost COMPONENTS system filesystem program_options timer iostreams thread python)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
set(EXT_LIBS ${EXT_LIBS} ${Boost_LIBRARIES})
@@ -24,6 +33,15 @@ else(Boost_FOUND)
message(SEND_ERROR "Cannot find Boost libraries. Terminating." )
endif(Boost_FOUND)
+find_package(PythonLibs 2.7 REQUIRED)
+if(PYTHONLIBS_FOUND)
+ message("-- Found Python" )
+ include_directories(${PYTHON_INCLUDE_DIRS})
+ set(EXT_LIBS ${EXT_LIBS} ${PYTHON_LIBRARIES})
+else(PYTHONLIBS_FOUND)
+ message(SEND_ERROR "Cannot find python libraries. Terminating." )
+endif(PYTHONLIBS_FOUND)
+
find_package (BZip2)
if (BZIP2_FOUND)
include_directories(${BZIP2_INCLUDE_DIRS})