-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing optionality for interpolation; it's now triggered by eigen Absorb common into main kenlm library Library files, also reduces required version
- Loading branch information
Showing
9 changed files
with
29 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,4 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
cmake_minimum_required(VERSION 2.6) | ||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
|
||
|
@@ -49,8 +38,6 @@ include_directories( | |
${Boost_INCLUDE_DIRS} | ||
) | ||
|
||
option(BUILD_INTERPOLATE "Build language model interpolation code" OFF) | ||
|
||
# Process subdirectories | ||
add_subdirectory(util) | ||
add_subdirectory(lm) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
|
||
|
@@ -24,7 +12,7 @@ add_definitions(-DKENLM_MAX_ORDER=${KENLM_MAX_ORDER}) | |
# that should be included in the kenlm library, | ||
# (this excludes any unit test files) | ||
# you should add them to the following list: | ||
set(KENLM_SOURCE | ||
set(KENLM_LM_SOURCE | ||
bhiksha.cc | ||
binary_format.cc | ||
config.cc | ||
|
@@ -48,11 +36,12 @@ set(KENLM_SOURCE | |
# Given add_library(foo OBJECT ${my_foo_sources}), | ||
# refer to these objects as $<TARGET_OBJECTS:foo> | ||
# | ||
add_library(kenlm OBJECT ${KENLM_SOURCE}) | ||
add_subdirectory(common) | ||
|
||
add_library(kenlm ${KENLM_LM_SOURCE} ${KENLM_LM_COMMON_SOURCE}) | ||
|
||
# This directory has children that need to be processed | ||
add_subdirectory(builder) | ||
add_subdirectory(common) | ||
add_subdirectory(filter) | ||
add_subdirectory(interpolate) | ||
|
||
|
@@ -63,27 +52,21 @@ set(EXE_LIST | |
build_binary | ||
) | ||
|
||
AddExes(EXES ${EXE_LIST} | ||
DEPENDS $<TARGET_OBJECTS:kenlm> $<TARGET_OBJECTS:kenlm_util> | ||
LIBRARIES ${Boost_LIBRARIES} pthread) | ||
set(LM_LIBS kenlm kenlm_util ${Boost_LIBRARIES} pthread) | ||
|
||
# Conditionally build the interpolation code | ||
if(BUILD_INTERPOLATE) | ||
add_subdirectory(interpolate) | ||
endif() | ||
AddExes(EXES ${EXE_LIST} | ||
LIBRARIES ${LM_LIBS}) | ||
|
||
if(BUILD_TESTING) | ||
|
||
set(KENLM_BOOST_TESTS_LIST left_test partial_test) | ||
AddTests(TESTS ${KENLM_BOOST_TESTS_LIST} | ||
DEPENDS $<TARGET_OBJECTS:kenlm> $<TARGET_OBJECTS:kenlm_util> | ||
LIBRARIES ${Boost_LIBRARIES} pthread | ||
LIBRARIES ${LM_LIBS} | ||
TEST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}/test.arpa) | ||
|
||
# model_test requires an extra command line parameter | ||
KenLMAddTest(TEST model_test | ||
DEPENDS $<TARGET_OBJECTS:kenlm> $<TARGET_OBJECTS:kenlm_util> | ||
LIBRARIES ${Boost_LIBRARIES} pthread | ||
LIBRARIES ${LM_LIBS} | ||
TEST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}/test.arpa | ||
${CMAKE_CURRENT_SOURCE_DIR}/test_nounk.arpa) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
# Explicitly list the source files for this subdirectory | ||
|
@@ -38,14 +26,14 @@ set(KENLM_BUILDER_SOURCE | |
# Given add_library(foo OBJECT ${my_foo_sources}), | ||
# refer to these objects as $<TARGET_OBJECTS:foo> | ||
# | ||
add_library(kenlm_builder OBJECT ${KENLM_BUILDER_SOURCE}) | ||
add_library(kenlm_builder ${KENLM_BUILDER_SOURCE}) | ||
|
||
|
||
# Compile the executable, linking against the requisite dependent object files | ||
add_executable(lmplz lmplz_main.cc $<TARGET_OBJECTS:kenlm> $<TARGET_OBJECTS:kenlm_common> $<TARGET_OBJECTS:kenlm_builder> $<TARGET_OBJECTS:kenlm_util>) | ||
add_executable(lmplz lmplz_main.cc) | ||
|
||
# Link the executable against boost | ||
target_link_libraries(lmplz ${Boost_LIBRARIES} pthread) | ||
target_link_libraries(lmplz kenlm_builder kenlm kenlm_util ${Boost_LIBRARIES} pthread) | ||
|
||
# Group executables together | ||
set_target_properties(lmplz PROPERTIES FOLDER executables) | ||
|
@@ -59,9 +47,5 @@ if(BUILD_TESTING) | |
) | ||
|
||
AddTests(TESTS ${KENLM_BOOST_TESTS_LIST} | ||
DEPENDS $<TARGET_OBJECTS:kenlm> | ||
$<TARGET_OBJECTS:kenlm_common> | ||
$<TARGET_OBJECTS:kenlm_util> | ||
$<TARGET_OBJECTS:kenlm_builder> | ||
LIBRARIES ${Boost_LIBRARIES} pthread) | ||
LIBRARIES kenlm_builder kenlm kenlm_util ${Boost_LIBRARIES} pthread) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
# Explicitly list the source files for this subdirectory | ||
|
@@ -23,18 +11,9 @@ cmake_minimum_required(VERSION 2.8.8) | |
# in case this variable is referenced by CMake files in the parent directory, | ||
# we prefix all files with ${CMAKE_CURRENT_SOURCE_DIR}. | ||
# | ||
set(KENLM_COMMON_SOURCE | ||
set(KENLM_LM_COMMON_SOURCE | ||
${CMAKE_CURRENT_SOURCE_DIR}/model_buffer.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/print.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/renumber.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/size_option.cc | ||
) | ||
|
||
|
||
# Group these objects together for later use. | ||
# | ||
# Given add_library(foo OBJECT ${my_foo_sources}), | ||
# refer to these objects as $<TARGET_OBJECTS:foo> | ||
# | ||
add_library(kenlm_common OBJECT ${KENLM_COMMON_SOURCE}) | ||
|
||
PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
# Explicitly list the source files for this subdirectory | ||
|
@@ -35,7 +23,7 @@ set(KENLM_FILTER_SOURCE | |
# Given add_library(foo OBJECT ${my_foo_sources}), | ||
# refer to these objects as $<TARGET_OBJECTS:foo> | ||
# | ||
add_library(kenlm_filter OBJECT ${KENLM_FILTER_SOURCE}) | ||
add_library(kenlm_filter ${KENLM_FILTER_SOURCE}) | ||
|
||
|
||
# Explicitly list the executable files to be compiled | ||
|
@@ -49,10 +37,10 @@ set(EXE_LIST | |
foreach(exe ${EXE_LIST}) | ||
|
||
# Compile the executable, linking against the requisite dependent object files | ||
add_executable(${exe} ${exe}_main.cc $<TARGET_OBJECTS:kenlm> $<TARGET_OBJECTS:kenlm_filter> $<TARGET_OBJECTS:kenlm_util>) | ||
add_executable(${exe} ${exe}_main.cc) | ||
|
||
# Link the executable against boost | ||
target_link_libraries(${exe} ${Boost_LIBRARIES} pthread) | ||
target_link_libraries(${exe} kenlm_filter kenlm kenlm_util ${Boost_LIBRARIES} pthread) | ||
|
||
# Group executables together | ||
set_target_properties(${exe} PROPERTIES FOLDER executables) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
|
||
|
@@ -52,7 +40,7 @@ add_subdirectory(stream) | |
# Given add_library(foo OBJECT ${my_foo_sources}), | ||
# refer to these objects as $<TARGET_OBJECTS:foo> | ||
# | ||
add_library(kenlm_util OBJECT ${KENLM_UTIL_DOUBLECONVERSION_SOURCE} ${KENLM_UTIL_STREAM_SOURCE} ${KENLM_UTIL_SOURCE}) | ||
add_library(kenlm_util ${KENLM_UTIL_DOUBLECONVERSION_SOURCE} ${KENLM_UTIL_STREAM_SOURCE} ${KENLM_UTIL_SOURCE}) | ||
|
||
|
||
|
||
|
@@ -71,12 +59,10 @@ if(BUILD_TESTING) | |
) | ||
|
||
AddTests(TESTS ${KENLM_BOOST_TESTS_LIST} | ||
DEPENDS $<TARGET_OBJECTS:kenlm_util> | ||
LIBRARIES ${Boost_LIBRARIES} pthread) | ||
LIBRARIES kenlm_util ${Boost_LIBRARIES} pthread) | ||
|
||
# file_piece_test requires an extra command line parameter | ||
KenLMAddTest(TEST file_piece_test | ||
DEPENDS $<TARGET_OBJECTS:kenlm_util> | ||
LIBRARIES ${Boost_LIBRARIES} pthread | ||
LIBRARIES kenlm_util ${Boost_LIBRARIES} pthread | ||
TEST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}/file_piece.cc) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
# Explicitly list the source files for this subdirectory | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.8.8) | ||
# | ||
# The KenLM cmake files make use of add_library(... OBJECTS ...) | ||
# | ||
# This syntax allows grouping of source files when compiling | ||
# (effectively creating "fake" libraries based on source subdirs). | ||
# | ||
# This syntax was only added in cmake version 2.8.8 | ||
# | ||
# see http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library | ||
|
||
|
||
# This CMake file was created by Lane Schwartz <[email protected]> | ||
|
||
# Explicitly list the source files for this subdirectory | ||
|
@@ -46,6 +34,5 @@ if(BUILD_TESTING) | |
) | ||
|
||
AddTests(TESTS ${KENLM_BOOST_TESTS_LIST} | ||
DEPENDS $<TARGET_OBJECTS:kenlm_util> | ||
LIBRARIES ${Boost_LIBRARIES} pthread) | ||
LIBRARIES kenlm_util ${Boost_LIBRARIES} pthread) | ||
endif() |