Skip to content

Commit

Permalink
Unbodge kenlm by moving compilation to kenlm/ instead of kenlm/lm. Ch…
Browse files Browse the repository at this point in the history
…anging 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
  • Loading branch information
heafield committed Sep 28, 2010
1 parent d99066e commit 770df2a
Show file tree
Hide file tree
Showing 37 changed files with 105 additions and 105 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 4 additions & 4 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 changes: 27 additions & 0 deletions kenlm/Makefile.am
Original file line number Diff line number Diff line change
@@ -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

27 changes: 0 additions & 27 deletions kenlm/lm/Makefile.am

This file was deleted.

4 changes: 2 additions & 2 deletions kenlm/lm/facade.hh
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
2 changes: 1 addition & 1 deletion kenlm/lm/exception.cc → kenlm/lm/lm_exception.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "exception.hh"
#include "lm/lm_exception.hh"

#include<errno.h>
#include<stdio.h>
Expand Down
4 changes: 2 additions & 2 deletions kenlm/lm/exception.hh → kenlm/lm/lm_exception.hh
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
12 changes: 6 additions & 6 deletions kenlm/lm/ngram.cc
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
20 changes: 10 additions & 10 deletions kenlm/lm/ngram.hh
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/lm/ngram_build_binary.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ngram.hh"
#include "lm/ngram.hh"

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion kenlm/lm/ngram_query.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ngram.hh"
#include "lm/ngram.hh"

#include <cstdlib>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/lm/read_arpa.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "read_arpa.hh"
#include "lm/read_arpa.hh"

#include <cstdlib>
#include <ctype.h>
Expand Down
8 changes: 4 additions & 4 deletions kenlm/lm/read_arpa.hh
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
4 changes: 2 additions & 2 deletions kenlm/lm/sri.cc
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
4 changes: 2 additions & 2 deletions kenlm/lm/sri.hh
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/lm/sri_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "sri.hh"
#include "lm/sri.hh"

#include <stdlib.h>

Expand Down
4 changes: 2 additions & 2 deletions kenlm/lm/virtual_interface.cc
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions kenlm/lm/virtual_interface.hh
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
10 changes: 5 additions & 5 deletions kenlm/lm/vocab.cc
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
10 changes: 5 additions & 5 deletions kenlm/lm/vocab.hh
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/ersatz_progress.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ersatz_progress.hh"
#include "util/ersatz_progress.hh"

#include <algorithm>
#include <ostream>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/exception_util.cc → kenlm/util/exception.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "exception_util.hh"
#include "util/exception.hh"

#include <errno.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/exception_util.hh → kenlm/util/exception.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef UTIL_EXCEPTION__
#define UTIL_EXCEPTION__

#include "string_piece.hh"
#include "util/string_piece.hh"

#include <exception>
#include <sstream>
Expand Down
4 changes: 2 additions & 2 deletions kenlm/util/file_piece.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "file_piece.hh"
#include "util/file_piece.hh"

#include "exception.hh"
#include "util/exception.hh"

#include <iostream>
#include <string>
Expand Down
10 changes: 5 additions & 5 deletions kenlm/util/file_piece.hh
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/file_piece_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "file_piece.hh"
#include "util/file_piece.hh"

#define BOOST_TEST_MODULE FilePieceTest
#include <boost/test/unit_test.hpp>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/joint_sort.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* also permuting another range the same way.
*/

#include "proxy_iterator.hh"
#include "util/proxy_iterator.hh"

#include <algorithm>
#include <functional>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/joint_sort_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "joint_sort.hh"
#include "util/joint_sort.hh"

#define BOOST_TEST_MODULE JointSortTest
#include <boost/test/unit_test.hpp>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/key_value_packing_test.cc
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
6 changes: 3 additions & 3 deletions kenlm/util/mmap.cc
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/mmap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define UTIL_MMAP__
// Utilities for mmaped files.

#include "scoped.hh"
#include "util/scoped.hh"

#include <cstddef>

Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/murmur_hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* default option = 0 for seed
*/

#include "murmur_hash.hh"
#include "util/murmur_hash.hh"

namespace util {

Expand Down
4 changes: 2 additions & 2 deletions kenlm/util/probing_hash_table_test.cc
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion kenlm/util/scoped.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "scoped.hh"
#include "util/scoped.hh"

#include <err.h>
#include <unistd.h>
Expand Down
4 changes: 2 additions & 2 deletions kenlm/util/sorted_uniform_test.cc
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Loading

0 comments on commit 770df2a

Please sign in to comment.