summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2014-01-20 20:00:16 -0500
committerChris Dyer <redpony@gmail.com>2014-01-20 20:00:16 -0500
commit44a54840b888a9cdd6444472da88f480ceafced2 (patch)
treee518550aae77a88c4f4078884a3d0648ff00fb4e
parent02a764cc553f238cdd0be4c6dee4ea144cda84ba (diff)
fix for build
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac5
-rw-r--r--extractor/Makefile.am11
-rw-r--r--extractor/extract.cc6
-rw-r--r--extractor/run_extractor.cc4
-rw-r--r--extractor/sacompile.cc (renamed from extractor/compile.cc)0
-rw-r--r--m4/boost.m4100
7 files changed, 80 insertions, 49 deletions
diff --git a/Makefile.am b/Makefile.am
index 008dc704..598293d1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,11 +12,10 @@ SUBDIRS = \
klm/search \
decoder \
training \
- training/liblbfgs \
word-aligner \
+ extractor \
example_extff
-# extractor
EXTRA_DIST = corpus tests python/cdec python/tests python/examples compound-split environment
AUTOMAKE_OPTIONS = foreign
diff --git a/configure.ac b/configure.ac
index 8136a7c7..d5261b8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,5 @@
-AC_INIT([cdec],[2013-11-10])
+AC_CONFIG_MACRO_DIR([m4])
+AC_INIT([cdec],[2014-01-19])
AC_CONFIG_SRCDIR([decoder/cdec.cc])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
@@ -9,7 +10,7 @@ case $LEX in
esac
AC_PROG_CC
AC_PROG_CXX
-AX_CXX_COMPILE_STDCXX_11
+AX_CXX_COMPILE_STDCXX_11([],[mandatory])
AC_LANG_CPLUSPLUS
AC_OPENMP
BOOST_REQUIRE([1.44])
diff --git a/extractor/Makefile.am b/extractor/Makefile.am
index e5b439f9..40112e5e 100644
--- a/extractor/Makefile.am
+++ b/extractor/Makefile.am
@@ -1,7 +1,5 @@
-bin_PROGRAMS = compile run_extractor extract
-
-if HAVE_CXX11
+bin_PROGRAMS = sacompile run_extractor extract
EXTRA_PROGRAMS = alignment_test \
data_array_test \
@@ -114,8 +112,8 @@ vocabulary_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
noinst_LIBRARIES = libextractor.a
-compile_SOURCES = compile.cc
-compile_LDADD = libextractor.a
+sacompile_SOURCES = sacompile.cc
+sacompile_LDADD = libextractor.a
run_extractor_SOURCES = run_extractor.cc
run_extractor_LDADD = libextractor.a
extract_SOURCES = extract.cc
@@ -156,6 +154,5 @@ libextractor_a_SOURCES = \
translation_table.cc \
vocabulary.cc
-AM_CPPFLAGS = -W -Wall -Wno-sign-compare $(CXX11_SWITCH) -fopenmp $(GTEST_CPPFLAGS) $(GMOCK_CPPFLAGS)
+AM_CPPFLAGS = -W -Wall -Wno-sign-compare -fopenmp $(GTEST_CPPFLAGS) $(GMOCK_CPPFLAGS)
AM_LDFLAGS = -fopenmp
-endif
diff --git a/extractor/extract.cc b/extractor/extract.cc
index 387cbe9b..e5b6f6ff 100644
--- a/extractor/extract.cc
+++ b/extractor/extract.cc
@@ -8,7 +8,11 @@
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <boost/program_options/variables_map.hpp>
-#include <omp.h>
+#if HAVE_OPEN_MP
+ #include <omp.h>
+#else
+ const unsigned omp_get_num_threads() { return 1; }
+#endif
#include "alignment.h"
#include "data_array.h"
diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc
index f1aa5e35..00564a36 100644
--- a/extractor/run_extractor.cc
+++ b/extractor/run_extractor.cc
@@ -8,7 +8,11 @@
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <boost/program_options/variables_map.hpp>
+#if HAVE_OPEN_MP
#include <omp.h>
+#else
+ const unsigned omp_get_num_threads() { return 1; }
+#endif
#include "alignment.h"
#include "data_array.h"
diff --git a/extractor/compile.cc b/extractor/sacompile.cc
index 3ee668ce..3ee668ce 100644
--- a/extractor/compile.cc
+++ b/extractor/sacompile.cc
diff --git a/m4/boost.m4 b/m4/boost.m4
index 027e039b..c8eb65ae 100644
--- a/m4/boost.m4
+++ b/m4/boost.m4
@@ -22,7 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_define([_BOOST_SERIAL], [m4_translit([
-# serial 16
+# serial 18
], [#
], [])])
@@ -403,15 +403,25 @@ dnl generated only once above (before we start the for loops).
LDFLAGS=$boost_save_LDFLAGS
LIBS=$boost_save_LIBS
if test x"$Boost_lib" = xyes; then
- # Because Boost is often installed in non-standard locations we want to
- # hardcode the path to the library (with rpath). Here we assume that
- # Libtool's macro was already invoked so we can steal its variable
- # hardcode_libdir_flag_spec in order to get the right flags for ld.
- boost_save_libdir=$libdir
- libdir=$boost_ldpath
- eval boost_rpath=\"$hardcode_libdir_flag_spec\"
- libdir=$boost_save_libdir
- Boost_lib_LDFLAGS="-L$boost_ldpath $boost_rpath"
+ # Check or used cached result of whether or not using -R or -rpath makes sense.
+ # Some implementations of ld, such as for Mac OSX, require -rpath but
+ # -R is the flag known to work on other systems.
+ # https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_save_LIBS $Boost_lib_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
Boost_lib_LDPATH="$boost_ldpath"
break 6
else
@@ -496,21 +506,21 @@ BOOST_DEFUN([Chrono],
# added as of 1.35.0. If we have a version <1.35, we must not attempt to
# find Boost.System as it didn't exist by then.
if test $boost_major_version -ge 135; then
- BOOST_SYSTEM([$1])
+BOOST_SYSTEM([$1])
fi # end of the Boost.System check.
-boost_system_save_LIBS=$LIBS
-boost_system_save_LDFLAGS=$LDFLAGS
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
LIBS="$LIBS $BOOST_SYSTEM_LIBS"
LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
BOOST_FIND_LIB([chrono], [$1],
- [boost/chrono.hpp],
- [boost::chrono::system_clock::time_point d = boost::chrono::system_clock::now();])
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;])
if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
- AC_SUBST([BOOST_SYSTEM_LIBS], ["$BOOST_SYSTEM_LIBS $BOOST_SYSTEM_LIBS"])
+ AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"])
fi
-LIBS=$boost_system_save_LIBS
-LDFLAGS=$boost_system_save_LDFLAGS
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
])# BOOST_CHRONO
@@ -524,6 +534,14 @@ BOOST_FIND_HEADER([boost/lexical_cast.hpp])
])# BOOST_CONVERSION
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
# BOOST_DATE_TIME([PREFERRED-RT-OPT])
# -----------------------------------
# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
@@ -534,25 +552,6 @@ BOOST_DEFUN([Date_Time],
[boost::posix_time::ptime t;])
])# BOOST_DATE_TIME
-# BOOST_TIMER([PREFERRED-RT-OPT])
-# -----------------------------------
-# Look for Boost.Timer. For the documentation of PREFERRED-RT-OPT, see the
-# documentation of BOOST_FIND_LIB above.
-BOOST_DEFUN([Timer],
-[#check for Boost.System
-BOOST_SYSTEM([$1])
-boost_system_save_LIBS=$LIBS
-boost_system_save_LDFLAGS=$LDFLAGS
-m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
-LIBS="$LIBS $BOOST_SYSTEM_LIBS"
-LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
-BOOST_FIND_LIB([timer], [$1],
- [boost/timer/timer.hpp],
- [boost::timer::auto_cpu_timer t;])
-AC_SUBST([BOOST_SYSTEM_LIBS], ["$BOOST_SYSTEM_LIBS $BOOST_SYSTEM_LIBS"])
-LIBS=$boost_system_save_LIBS
-LDFLAGS=$boost_system_save_LDFLAGS
-])# BOOST_TIMER
# BOOST_FILESYSTEM([PREFERRED-RT-OPT])
# ------------------------------------
@@ -607,6 +606,14 @@ BOOST_DEFUN([Function],
[BOOST_FIND_HEADER([boost/function.hpp])])
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
# BOOST_GRAPH([PREFERRED-RT-OPT])
# -------------------------------
# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
@@ -802,6 +809,14 @@ BOOST_DEFUN([Signals],
])# BOOST_SIGNALS
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
# BOOST_SMART_PTR()
# -----------------
# Look for Boost.SmartPtr
@@ -949,6 +964,17 @@ BOOST_DEFUN([Variant],
[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
BOOST_FIND_HEADER([boost/variant.hpp])])
+# BOOST_POINTERCONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTERCONTAINER
# BOOST_WAVE([PREFERRED-RT-OPT])
# ------------------------------