Skip to content

Commit

Permalink
Import v1.8.1 r1
Browse files Browse the repository at this point in the history
  • Loading branch information
kkm000 committed Jun 16, 2021
1 parent bdd67f9 commit dfb45be
Show file tree
Hide file tree
Showing 193 changed files with 1,608 additions and 1,681 deletions.
41 changes: 25 additions & 16 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0
Expand All @@ -23,6 +25,11 @@ config_setting(
values = {"define": "absl=1"},
)

DEFINES = select({
"@bazel_tools//src/conditions:windows": ["FST_NO_DYNAMIC_LINKING"],
"//conditions:default": [],
})

prefix_dir = "src/"

static_binary = 1
Expand Down Expand Up @@ -130,6 +137,7 @@ cc_library(
],
hdrs = PUBLIC_HEADERS,
copts = ["-Wno-sign-compare"],
defines = DEFINES,
includes = [prefix_dir + "include"],
linkopts = ["-lm"],
deps = [
Expand All @@ -148,6 +156,7 @@ cc_library(
cc_library(
name = "fst",
hdrs = PUBLIC_HEADERS,
defines = DEFINES,
includes = [prefix_dir + "include"],
deps = [
":fst-types",
Expand All @@ -164,18 +173,17 @@ cc_library(
cc_library(
name = "fst-types",
srcs = [prefix_dir + "lib/fst-types.cc"],
defines = DEFINES,
deps = [":lib_lite"],
alwayslink = 1, # because of registration
)

cc_library(
name = "symbol-table",
srcs = [prefix_dir + "lib/symbol-table.cc"],
hdrs = [
prefix_dir + "include/fst/symbol-table.h",
prefix_dir + "include/fst/windows_defs.inc",
],
hdrs = [prefix_dir + "include/fst/symbol-table.h"],
copts = ["-Wno-sign-compare"],
defines = DEFINES,
includes = [prefix_dir + "include"],
deps = [
":base",
Expand Down Expand Up @@ -203,6 +211,7 @@ cc_library(
prefix_dir + "include/fst/union-weight.h",
prefix_dir + "include/fst/weight.h",
],
defines = DEFINES,
includes = [prefix_dir + "include"],
linkopts = ["-lm"],
deps = [
Expand Down Expand Up @@ -277,14 +286,15 @@ cc_library(
prefix_dir + "include/fst/lock.h",
prefix_dir + "include/fst/log.h",
prefix_dir + "include/fst/types.h",
prefix_dir + "include/fst/windows_defs.inc",
],
defines = select({
":has_absl": ["OPENFST_HAS_ABSL=1"],
"//conditions:default": [],
}),
includes = [prefix_dir + "include"],
deps = select({
":has_absl": ["@io_abseil_cpp//absl/synchronization"],
":has_absl": ["@com_google_absl//absl/synchronization"],
"//conditions:default": [],
}),
)
Expand Down Expand Up @@ -713,7 +723,6 @@ cc_binary(
deps = [":fstscript_verify"],
)


# Extension: Fst ARchive a/k/a FAR (extensions/far/)

cc_library(
Expand Down Expand Up @@ -971,7 +980,7 @@ cc_library(
cc_library(
name = "%s-fst" % type,
srcs = [
prefix_dir + "extensions/compact/%s-fst.cc" % type
prefix_dir + "extensions/compact/%s-fst.cc" % type,
],
linkstatic = 1,
deps = [":fst"],
Expand Down Expand Up @@ -1041,7 +1050,7 @@ cc_binary(
cc_library(
name = "const%s-fst" % type,
srcs = [
prefix_dir + "extensions/const/const%s-fst.cc" % type
prefix_dir + "extensions/const/const%s-fst.cc" % type,
],
linkstatic = 1,
deps = [":fst"],
Expand All @@ -1057,17 +1066,17 @@ cc_binary(

cc_library(
name = "linear-fst",
srcs = [
prefix_dir + "extensions/linear/linear-classifier-fst.cc",
prefix_dir + "extensions/linear/linear-tagger-fst.cc",
],
hdrs = [
prefix_dir + "include/fst/extensions/linear/linear-fst-data-builder.h",
prefix_dir + "include/fst/extensions/linear/linear-fst-data.h",
prefix_dir + "include/fst/extensions/linear/linear-fst.h",
prefix_dir + "include/fst/extensions/linear/loglinear-apply.h",
prefix_dir + "include/fst/extensions/linear/trie.h",
],
srcs = [
prefix_dir + "extensions/linear/linear-classifier-fst.cc",
prefix_dir + "extensions/linear/linear-tagger-fst.cc",
],
linkstatic = 1,
deps = [
":fst",
Expand All @@ -1085,8 +1094,8 @@ cc_library(
includes = [prefix_dir + "include"],
deps = [
":base",
":linear-fst",
":fstscript_base",
":linear-fst",
],
)

Expand All @@ -1112,7 +1121,7 @@ cc_library(
cc_library(
name = "%s_lookahead-fst" % type,
srcs = [
prefix_dir + "extensions/lookahead/%s_lookahead-fst.cc" % type
prefix_dir + "extensions/lookahead/%s_lookahead-fst.cc" % type,
],
linkstatic = 1,
deps = [":fst"],
Expand All @@ -1130,10 +1139,10 @@ cc_library(
cc_library(
name = "%s-fst" % type,
srcs = [
prefix_dir + "include/fst/extensions/special/%s-fst.h" % type
prefix_dir + "include/fst/extensions/special/%s-fst.h" % type,
],
hdrs = [
prefix_dir + "extensions/special/%s-fst.cc" % type
prefix_dir + "extensions/special/%s-fst.cc" % type,
],
linkstatic = 1,
deps = [":fst"],
Expand Down
6 changes: 4 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.16.2 from Makefile.am.
# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2020 Free Software Foundation, Inc.
Expand Down Expand Up @@ -202,6 +202,8 @@ am__relativize = \
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
Expand Down Expand Up @@ -668,7 +670,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
Expand Down
7 changes: 6 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
OpenFst: Release 1.7
OpenFst: Release 1.8
* Expands smart-pointer use (1.8.1)
* Expands std::string_view use (1.8.1)
* Removes SymbolTableReadOptions (1.8.1)
* Adds farconvert (1.8.0)
* Migration to C++17 (1.8.0)
* Updates Bazel build (1.8.0)
Expand All @@ -7,6 +10,8 @@ OpenFst: Release 1.7
* Improves display of properties masks in pywrapfst (1.8.0)
* Internal reference-counting/smart pointer improvements (1.8.0)
* Deprecates PROJECT_(IN|OUT)PUT in favor of scoped enum ProjectType (1.8.0)

OpenFst: Release 1.7
* TokenType is now a scoped enum (1.7.8)
* pywrapfst is now Python 3-only (1.7.8)
* fstproject now has --project_type flag (1.7.8)
Expand Down
8 changes: 4 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ OpenFst is a library for constructing, combining, optimizing, and searching
weighted finite-state transducers (FSTs).

REQUIREMENTS:
This version is known to work under Linux using g++ (>= 7) and OS X using
XCode (>= 9). It is expected to work wherever adequate POSIX (dlopen,
This version is known to work under Linux using g++ (>= 4.9) and OS X using
XCode (>= 5). It is expected to work wherever adequate POSIX (dlopen,
ssize_t, basename), C99 (snprintf, strtoll, <stdint.h>), and C++17
(<unordered_set>, <unordered_map>, <forward_list>, constexpr-if) support
is available.
(constexpr-if, <forward_list>, <string_view>, <unordered_map>,
<unordered_set>) support is available.

INSTALLATION:
Follow the generic GNU build system instructions in ./INSTALL. We
Expand Down
4 changes: 3 additions & 1 deletion WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ workspace(name = "openfst")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_abseil_cpp",
# Name has to match workspace name in:
# https://github.com/abseil/abseil-cpp/blob/master/WORKSPACE
name = "com_google_absl",
strip_prefix = "abseil-cpp-master",
urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
)
Expand Down
23 changes: 10 additions & 13 deletions aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
# generated automatically by aclocal 1.16.3 -*- Autoconf -*-

# Copyright (C) 1996-2020 Free Software Foundation, Inc.

Expand Down Expand Up @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.2], [],
m4_if([$1], [1.16.3], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])

Expand All @@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.2])dnl
[AM_AUTOMAKE_VERSION([1.16.3])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
Expand Down Expand Up @@ -763,12 +763,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
Expand Down Expand Up @@ -940,12 +935,14 @@ AC_DEFUN([AM_PATH_PYTHON],
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
else
dnl Query Python for its version number. Getting [:3] seems to be
dnl the best way to do this; it's what "site.py" does in the standard
dnl library.
dnl Query Python for its version number. Although site.py simply uses
dnl sys.version[:3], printing that failed with Python 3.10, since the
dnl trailing zero was eliminated. So now we output just the major
dnl and minor version numbers, as numbers. Apparently the tertiary
dnl version is not of interest.
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
[am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
[am_cv_python_version=`$PYTHON -c "import sys; print('%u.%u' % sys.version_info[[:2]])"`])
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
dnl Use the values of $prefix and $exec_prefix for the corresponding
Expand Down
Loading

0 comments on commit dfb45be

Please sign in to comment.