From ebeda1e75c77dd9044f1b9902770896e3009ae55 Mon Sep 17 00:00:00 2001 From: "Wu, Ke" Date: Tue, 7 Oct 2014 17:41:19 -0400 Subject: Make synutils compile --- .gitignore | 1 + Makefile.am | 3 ++- configure.ac | 9 +++++---- utils/synutils/Makefile.am | 14 ++------------ utils/synutils/alignment.h | 2 +- utils/synutils/constituent_reorder_model.cc | 6 +++--- utils/synutils/srl_sentence.h | 5 ++++- utils/synutils/tree.h | 4 +++- utils/synutils/tsuruoka_maxent.h | 10 +++++----- utils/synutils/utility.h | 2 ++ 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 72f4997c..f9e17574 100644 --- a/.gitignore +++ b/.gitignore @@ -192,6 +192,7 @@ utils/phmt utils/reconstruct_weights utils/small_vector_test utils/sv_test +utils/synutils/const_reorder_model_trainer utils/ts utils/weights_test training/crf/mpi_adagrad_optimize diff --git a/Makefile.am b/Makefile.am index 88327477..ce49799a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,8 @@ # cyclic dependencies between these directories! SUBDIRS = \ utils \ + utils/synutils/maxent-3.0 \ + utils/synutils \ klm/util/double-conversion \ klm/util \ klm/util/stream \ @@ -21,4 +23,3 @@ EXTRA_DIST = corpus tests python/cdec python/tests python/examples compound-spli AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -D_GLIBCXX_PARALLEL -march=native -mtune=native -O2 -pipe -fomit-frame-pointer -Wall - diff --git a/configure.ac b/configure.ac index c5575f14..e1ec47ee 100644 --- a/configure.ac +++ b/configure.ac @@ -5,9 +5,9 @@ AM_INIT_AUTOMAKE AC_CONFIG_HEADERS(config.h) AC_PROG_LIBTOOL AC_PROG_LEX -case $LEX in -:) AC_MSG_ERROR([No lex (Flex, lex, etc.) program found]);; -esac +case $LEX in +:) AC_MSG_ERROR([No lex (Flex, lex, etc.) program found]);; +esac OLD_CXXFLAGS=$CXXFLAGS AC_PROG_CC AC_PROG_CXX @@ -208,6 +208,8 @@ fi # core cdec stuff AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([utils/Makefile]) +AC_CONFIG_FILES([utils/synutils/maxent-3.0/Makefile]) +AC_CONFIG_FILES([utils/synutils/Makefile]) AC_CONFIG_FILES([mteval/Makefile]) AC_CONFIG_FILES([mteval/meteor_jar.cc]) AC_CONFIG_FILES([decoder/Makefile]) @@ -240,4 +242,3 @@ AC_CONFIG_FILES([training/dtrain/Makefile]) AC_CONFIG_FILES([example_extff/Makefile]) AC_OUTPUT - diff --git a/utils/synutils/Makefile.am b/utils/synutils/Makefile.am index f87f1f8a..ac76be40 100644 --- a/utils/synutils/Makefile.am +++ b/utils/synutils/Makefile.am @@ -1,16 +1,6 @@ bin_PROGRAMS = const_reorder_model_trainer const_reorder_model_trainer_SOURCES = constituent_reorder_model.cc -const_reorder_model_trainer_LDADD = libfeature.a maxent-3.0/libtsuruoka_maxent.a -lgfortran +const_reorder_model_trainer_LDADD = maxent-3.0/libtsuruoka_maxent.a -noinst_LIBRARIES = libfeature.a - -libfeature_a_SOURCES = \ - alignment.h \ - srl_sentence.h \ - tree.h \ - utility.h \ - argument_reorder_model.h \ - tsuruoka_maxent.h - -AM_CPPFLAGS = -W -Wall -I$(top_srcdir) -I$(top_srcdir)/utils -I$(top_srcdir)/synutils/maxent-3.0 +AM_CPPFLAGS = -W -Wall -I$(top_srcdir) diff --git a/utils/synutils/alignment.h b/utils/synutils/alignment.h index c0648aab..6abd12bc 100644 --- a/utils/synutils/alignment.h +++ b/utils/synutils/alignment.h @@ -13,7 +13,7 @@ #include #include -#include "stringlib.h" +#include "utils/stringlib.h" using namespace std; diff --git a/utils/synutils/constituent_reorder_model.cc b/utils/synutils/constituent_reorder_model.cc index a4fb9627..78d61b90 100644 --- a/utils/synutils/constituent_reorder_model.cc +++ b/utils/synutils/constituent_reorder_model.cc @@ -12,12 +12,12 @@ #include "utility.h" #include "tsuruoka_maxent.h" -#include +#include using namespace std; -typedef std::tr1::unordered_map Map; -typedef std::tr1::unordered_map::iterator Iterator; +typedef std::unordered_map Map; +typedef std::unordered_map::iterator Iterator; namespace po = boost::program_options; diff --git a/utils/synutils/srl_sentence.h b/utils/synutils/srl_sentence.h index c08cc065..1afdec45 100644 --- a/utils/synutils/srl_sentence.h +++ b/utils/synutils/srl_sentence.h @@ -8,10 +8,13 @@ #ifndef SRL_SENTENCE_H_ #define SRL_SENTENCE_H_ -#include "tree.h" +#include #include +#include "tree.h" +#include "utils/stringlib.h" + using namespace std; struct SArgument { diff --git a/utils/synutils/tree.h b/utils/synutils/tree.h index 32521a3a..8070f828 100644 --- a/utils/synutils/tree.h +++ b/utils/synutils/tree.h @@ -8,10 +8,12 @@ #ifndef TREE_H_ #define TREE_H_ -#include #include #include +#include +#include + using namespace std; struct STreeItem { diff --git a/utils/synutils/tsuruoka_maxent.h b/utils/synutils/tsuruoka_maxent.h index b5a87404..89b06b97 100644 --- a/utils/synutils/tsuruoka_maxent.h +++ b/utils/synutils/tsuruoka_maxent.h @@ -7,19 +7,19 @@ #define TSURUOKA_MAXENT_H_ #include "utility.h" -#include "stringlib.h" -#include "maxent-3.0/maxent.h" +#include "utils/stringlib.h" +#include "utils/synutils/maxent-3.0/maxent.h" #include #include #include #include -#include +#include using namespace std; -typedef std::tr1::unordered_map Map; -typedef std::tr1::unordered_map::iterator Iterator; +typedef std::unordered_map Map; +typedef std::unordered_map::iterator Iterator; struct Tsuruoka_Maxent { Tsuruoka_Maxent(const char* pszModelFName) { diff --git a/utils/synutils/utility.h b/utils/synutils/utility.h index 791b2286..ef7b78b7 100644 --- a/utils/synutils/utility.h +++ b/utils/synutils/utility.h @@ -13,6 +13,8 @@ #include #include #include + +#include #include using namespace std; -- cgit v1.2.3