modfied cmake files to build marian executables,

This commit is contained in:
Marcin Junczys-Dowmunt 2017-03-23 19:19:01 +01:00
parent 6fcdd81f68
commit c73e09a31b
3 changed files with 20 additions and 13 deletions

View File

@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project(amunn C CXX)
project(amunmt C CXX)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_FLAGS_RELEASE "-std=c++14 -fPIC -O3 -Ofast -m64 -march=native -funroll-loops -ffinite-math-only -Wno-unused-result -Wno-deprecated -pthread")
set(CMAKE_CXX_FLAGS_DEBUG "-std=c++14 -fPIC -g -O0 -m64 -march=native -funroll-loops -ffinite-math-only -Wno-unused-result -Wno-deprecated -pthread")
@ -29,6 +33,13 @@ if(CUDA)
add_definitions(-DCUDA)
SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
message("-- Compiling with CUDA support")
if (MARIAN)
execute_process(COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(marian)
endif(MARIAN)
else(CUDA_FOUND)
add_definitions(-DNO_CUDA)
message("-- Cannot find CUDA libraries. Compiling without them." )
@ -38,10 +49,6 @@ else(CUDA)
add_definitions(-DNO_CUDA)
endif(CUDA)
if (MARIAN)
add_subdirectory(marian)
endif(MARIAN)
find_package(Boost COMPONENTS system filesystem program_options timer iostreams python thread)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
@ -69,11 +76,11 @@ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
FIND_PACKAGE(Git)
IF(GIT_FOUND)
EXECUTE_PROCESS(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE "AMUNMT_BUILD_VERSION"
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE "AMUNMT_BUILD_VERSION"
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
MESSAGE( STATUS "Git version: ${AMUNMT_BUILD_VERSION}" )
ELSE(GIT_FOUND)
SET(AMUNMT_BUILD_VERSION 0)

View File

@ -18,5 +18,5 @@ endif(OPENMP_FOUND)
add_executable(fast_align src/fast_align.cc src/ttables.cc)
add_executable(atools src/alignment_io.cc src/atools.cc)
set_target_properties(fast_align PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set_target_properties(atools PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set_target_properties(fast_align PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set_target_properties(atools PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")

View File

@ -145,7 +145,7 @@ foreach(exec ${EXES})
else(CUDA_FOUND)
target_link_libraries(${exec} ${EXT_LIBS})
endif(CUDA_FOUND)
set_target_properties(${exec} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set_target_properties(${exec} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
endforeach(exec)
add_subdirectory(3rd_party)