Unbodge kenlm by moving compilation to kenlm/ instead of kenlm/lm. Changing the headers every

time I copied to Moses was getting annoying.  



git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3587 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
heafield 2010-09-28 16:26:55 +00:00
parent d99066e4e9
commit 770df2a92d
37 changed files with 105 additions and 105 deletions

View File

@ -11,4 +11,4 @@ endif
if WITH_SERVER
SERVER = server
endif
SUBDIRS = moses/src moses-chart/src OnDiskPt/src kenlm/lm moses-cmd/src misc moses-chart-cmd/src CreateOnDisk/src $(MERT) $(SERVER)
SUBDIRS = moses/src moses-chart/src OnDiskPt/src kenlm moses-cmd/src misc moses-chart-cmd/src CreateOnDisk/src $(MERT) $(SERVER)

View File

@ -174,14 +174,14 @@ fi
if test "x$with_kenlm" != 'xno'
then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I${with_kenlm}/lm"
CPPFLAGS="$CPPFLAGS -I${with_kenlm}"
AC_CHECK_HEADER(ngram.hh,
AC_CHECK_HEADER(lm/ngram.hh,
[AC_DEFINE([HAVE_KENLM], [], [flag for KENLM])],
[AC_MSG_ERROR([Cannot find KEN-LM in ${with_kenlm}])])
LIB_KENLM="-lkenlm"
LDFLAGS="$LDFLAGS -L${with_kenlm}/lm"
LDFLAGS="$LDFLAGS -L${with_kenlm}"
LIBS="$LIBS $LIB_KENLM"
FMTLIBS="$FMTLIBS libkenlm.a"
AM_CONDITIONAL([KEN_LM], true)
@ -228,6 +228,6 @@ fi
LIBS="$LIBS -lz"
AC_CONFIG_FILES(Makefile OnDiskPt/src/Makefile moses/src/Makefile moses-chart/src/Makefile moses-cmd/src/Makefile moses-chart-cmd/src/Makefile misc/Makefile mert/Makefile server/Makefile CreateOnDisk/src/Makefile kenlm/lm/Makefile)
AC_CONFIG_FILES(Makefile OnDiskPt/src/Makefile moses/src/Makefile moses-chart/src/Makefile moses-cmd/src/Makefile moses-chart-cmd/src/Makefile misc/Makefile mert/Makefile server/Makefile CreateOnDisk/src/Makefile kenlm/Makefile)
AC_OUTPUT()

27
kenlm/Makefile.am Normal file
View File

@ -0,0 +1,27 @@
lib_LIBRARIES = libkenlm.a
bin_PROGRAMS = query build_binary
AM_CPPFLAGS = -W -Wall -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES $(BOOST_CPPFLAGS)
libkenlm_a_SOURCES = \
lm/lm_exception.cc \
lm/ngram.cc \
lm/read_arpa.cc \
lm/virtual_interface.cc \
lm/vocab.cc \
util/string_piece.cc \
util/scoped.cc \
util/murmur_hash.cc \
util/mmap.cc \
util/file_piece.cc \
util/ersatz_progress.cc \
util/exception.cc \
util/string_piece.cc
query_SOURCES = lm/ngram_query.cc
query_DEPENDENCIES = libkenlm.a
query_LDADD = -L$(top_srcdir)/kenlm -lkenlm
build_binary_SOURCES = lm/ngram_build_binary.cc
build_binary_DEPENDENCIES = libkenlm.a
build_binary_LDADD = -L$(top_srcdir)/kenlm -lkenlm

View File

@ -1,27 +0,0 @@
lib_LIBRARIES = libkenlm.a
bin_PROGRAMS = query build_binary
AM_CPPFLAGS = -W -Wall -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES $(BOOST_CPPFLAGS)
libkenlm_a_SOURCES = \
virtual_interface.cc \
ngram.cc \
exception.cc \
read_arpa.cc \
vocab.cc \
../util/string_piece.cc \
../util/scoped.cc \
../util/murmur_hash.cc \
../util/mmap.cc \
../util/file_piece.cc \
../util/ersatz_progress.cc \
../util/exception_util.cc \
../util/string_piece.cc
query_SOURCES = ngram_query.cc
query_DEPENDENCIES = libkenlm.a
query_LDADD = -L$(top_srcdir)/kenlm/lm -lkenlm
build_binary_SOURCES = ngram_build_binary.cc
build_binary_DEPENDENCIES = libkenlm.a
build_binary_LDADD = -L$(top_srcdir)/kenlm/lm -lkenlm

View File

@ -1,8 +1,8 @@
#ifndef LM_FACADE__
#define LM_FACADE__
#include "virtual_interface.hh"
#include "../util/string_piece.hh"
#include "lm/virtual_interface.hh"
#include "util/string_piece.hh"
#include <string>

View File

@ -1,4 +1,4 @@
#include "exception.hh"
#include "lm/lm_exception.hh"
#include<errno.h>
#include<stdio.h>

View File

@ -1,8 +1,8 @@
#ifndef LM_EXCEPTION__
#define LM_EXCEPTION__
#include "../util/exception_util.hh"
#include "../util/string_piece.hh"
#include "util/exception.hh"
#include "util/string_piece.hh"
#include <exception>
#include <string>

View File

@ -1,11 +1,11 @@
#include "ngram.hh"
#include "exception.hh"
#include "read_arpa.hh"
#include "../util/file_piece.hh"
#include "../util/joint_sort.hh"
#include "../util/murmur_hash.hh"
#include "../util/probing_hash_table.hh"
#include "lm/lm_exception.hh"
#include "lm/read_arpa.hh"
#include "util/file_piece.hh"
#include "util/joint_sort.hh"
#include "util/murmur_hash.hh"
#include "util/probing_hash_table.hh"
#include <algorithm>
#include <functional>

View File

@ -1,16 +1,16 @@
#ifndef LM_NGRAM__
#define LM_NGRAM__
#include "facade.hh"
#include "ngram_config.hh"
#include "vocab.hh"
#include "weights.hh"
#include "../util/key_value_packing.hh"
#include "../util/mmap.hh"
#include "../util/probing_hash_table.hh"
#include "../util/scoped.hh"
#include "../util/sorted_uniform.hh"
#include "../util/string_piece.hh"
#include "lm/facade.hh"
#include "lm/ngram_config.hh"
#include "lm/vocab.hh"
#include "lm/weights.hh"
#include "util/key_value_packing.hh"
#include "util/mmap.hh"
#include "util/probing_hash_table.hh"
#include "util/scoped.hh"
#include "util/sorted_uniform.hh"
#include "util/string_piece.hh"
#include <algorithm>
#include <vector>

View File

@ -1,4 +1,4 @@
#include "ngram.hh"
#include "lm/ngram.hh"
#include <iostream>

View File

@ -1,4 +1,4 @@
#include "ngram.hh"
#include "lm/ngram.hh"
#include <cstdlib>
#include <fstream>

View File

@ -1,4 +1,4 @@
#include "read_arpa.hh"
#include "lm/read_arpa.hh"
#include <cstdlib>
#include <ctype.h>

View File

@ -1,10 +1,10 @@
#ifndef LM_READ_ARPA__
#define LM_READ_ARPA__
#include "exception.hh"
#include "weights.hh"
#include "word_index.hh"
#include "../util/file_piece.hh"
#include "lm/lm_exception.hh"
#include "lm/weights.hh"
#include "lm/word_index.hh"
#include "util/file_piece.hh"
#include <cstddef>
#include <vector>

View File

@ -1,5 +1,5 @@
#include "exception.hh"
#include "sri.hh"
#include "lm/lm_exception.hh"
#include "lm/sri.hh"
#include <Ngram.h>
#include <Vocab.h>

View File

@ -1,8 +1,8 @@
#ifndef LM_SRI__
#define LM_SRI__
#include "facade.hh"
#include "../util/murmur_hash.hh"
#include "lm/facade.hh"
#include "util/murmur_hash.hh"
#include <cmath>
#include <exception>

View File

@ -1,4 +1,4 @@
#include "sri.hh"
#include "lm/sri.hh"
#include <stdlib.h>

View File

@ -1,5 +1,5 @@
#include "virtual_interface.hh"
#include "exception.hh"
#include "lm/virtual_interface.hh"
#include "lm/lm_exception.hh"
namespace lm {
namespace base {

View File

@ -1,8 +1,8 @@
#ifndef LM_VIRTUAL_INTERFACE__
#define LM_VIRTUAL_INTERFACE__
#include "word_index.hh"
#include "../util/string_piece.hh"
#include "lm/word_index.hh"
#include "util/string_piece.hh"
#include <string>

View File

@ -1,9 +1,9 @@
#include "vocab.hh"
#include "lm/vocab.hh"
#include "weights.hh"
#include "../util/joint_sort.hh"
#include "../util/murmur_hash.hh"
#include "../util/probing_hash_table.hh"
#include "lm/weights.hh"
#include "util/joint_sort.hh"
#include "util/murmur_hash.hh"
#include "util/probing_hash_table.hh"
#include <string>

View File

@ -1,11 +1,11 @@
#ifndef LM_VOCAB__
#define LM_VOCAB__
#include "virtual_interface.hh"
#include "../util/key_value_packing.hh"
#include "../util/probing_hash_table.hh"
#include "../util/sorted_uniform.hh"
#include "../util/string_piece.hh"
#include "lm/virtual_interface.hh"
#include "util/key_value_packing.hh"
#include "util/probing_hash_table.hh"
#include "util/sorted_uniform.hh"
#include "util/string_piece.hh"
namespace lm {

View File

@ -1,4 +1,4 @@
#include "ersatz_progress.hh"
#include "util/ersatz_progress.hh"
#include <algorithm>
#include <ostream>

View File

@ -1,4 +1,4 @@
#include "exception_util.hh"
#include "util/exception.hh"
#include <errno.h>
#include <string.h>

View File

@ -1,7 +1,7 @@
#ifndef UTIL_EXCEPTION__
#define UTIL_EXCEPTION__
#include "string_piece.hh"
#include "util/string_piece.hh"
#include <exception>
#include <sstream>

View File

@ -1,6 +1,6 @@
#include "file_piece.hh"
#include "util/file_piece.hh"
#include "exception.hh"
#include "util/exception.hh"
#include <iostream>
#include <string>

View File

@ -1,11 +1,11 @@
#ifndef UTIL_FILE_PIECE__
#define UTIL_FILE_PIECE__
#include "ersatz_progress.hh"
#include "exception.hh"
#include "mmap.hh"
#include "scoped.hh"
#include "string_piece.hh"
#include "util/ersatz_progress.hh"
#include "util/exception.hh"
#include "util/mmap.hh"
#include "util/scoped.hh"
#include "util/string_piece.hh"
#include <string>

View File

@ -1,4 +1,4 @@
#include "file_piece.hh"
#include "util/file_piece.hh"
#define BOOST_TEST_MODULE FilePieceTest
#include <boost/test/unit_test.hpp>

View File

@ -5,7 +5,7 @@
* also permuting another range the same way.
*/
#include "proxy_iterator.hh"
#include "util/proxy_iterator.hh"
#include <algorithm>
#include <functional>

View File

@ -1,4 +1,4 @@
#include "joint_sort.hh"
#include "util/joint_sort.hh"
#define BOOST_TEST_MODULE JointSortTest
#include <boost/test/unit_test.hpp>

View File

@ -1,4 +1,4 @@
#include "key_value_packing.hh"
#include "util/key_value_packing.hh"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>

View File

@ -1,6 +1,6 @@
#include "exception.hh"
#include "mmap.hh"
#include "scoped.hh"
#include "util/exception.hh"
#include "util/mmap.hh"
#include "util/scoped.hh"
#include <assert.h>
#include <err.h>

View File

@ -2,7 +2,7 @@
#define UTIL_MMAP__
// Utilities for mmaped files.
#include "scoped.hh"
#include "util/scoped.hh"
#include <cstddef>

View File

@ -9,7 +9,7 @@
* default option = 0 for seed
*/
#include "murmur_hash.hh"
#include "util/murmur_hash.hh"
namespace util {

View File

@ -1,6 +1,6 @@
#include "probing_hash_table.hh"
#include "util/probing_hash_table.hh"
#include "key_value_packing.hh"
#include "util/key_value_packing.hh"
#define BOOST_TEST_MODULE ProbingHashTableTest
#include <boost/test/unit_test.hpp>

View File

@ -1,4 +1,4 @@
#include "scoped.hh"
#include "util/scoped.hh"
#include <err.h>
#include <unistd.h>

View File

@ -1,6 +1,6 @@
#include "sorted_uniform.hh"
#include "util/sorted_uniform.hh"
#include "key_value_packing.hh"
#include "util/key_value_packing.hh"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>

View File

@ -28,7 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Copied from strings/stringpiece.cc with modifications
#include "../util/string_piece.hh"
#include "util/string_piece.hh"
#ifdef USE_BOOST
#include <boost/functional/hash/hash.hpp>

View File

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <limits>
#include <iostream>
#include <fstream>
#include "ngram.hh"
#include "lm/ngram.hh"
#include "LanguageModelKen.h"
#include "TypeDef.h"