competition update

This commit is contained in:
nckcard
2025-07-02 12:18:09 -07:00
parent 9e17716a4a
commit 77dbcf868f
2615 changed files with 1648116 additions and 125 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
These files are subject to the SRILM Community Research License Version
1.0 (the "License"); you may not use these files except in compliance
with the License. A copy of the License is included in the SRILM root
directory in the "License" file. Software distributed under the License
is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
express or implied. See the License for the specific language governing
rights and limitations under the License.
This software is Copyright (c) 1995-2014 SRI International. All rights
reserved.
Portions of this software are
Copyright (c) 2002-2005 Jeff Bilmes
Copyright (c) 2009-2013 Tanel Alumae
Copyright (c) 2012-2013 Microsoft Corp.
SRILM also includes open-source software as listed in the
ACKNOWLEDGEMENTS file in the SRILM root directory.
If this software was obtained under a commercial license agreement with
SRI then the provisions therein govern the use of the software and the
above notice does not apply.

View File

@@ -0,0 +1,170 @@
Here is a brief guide on how to build the SRI LM tools and associated
libraries.
1 - Unpack. This should give a top-level directory with the subdirectories
listed in README, as well as a few documentation files and a Makefile.
For an overview of SRILM, see the paper in doc/paper.ps .
For reference information, look in man/html .
2 - Set the SRILM variable in the top-level Makefile to point to this
top-level directory (an absolute path).
3 - You need a Linux (i686/x86_64), Mac OSX, Solaris (i386 or amd64),
SunOS (Sparc or i386), IRIX 5.x, Alpha OSF, or CYGWIN platform to
compile out of the box. For other OS/cpu combinations you will have
to modify the sbin/machine-type script to detect (and name) the
platform type, and create a file common/Makefile.machine.<platform>
that defines platform-dependent makefile variables. As a
workaround, the MACHINE_TYPE variable can also be set on the make
comand line
make MACHINE_TYPE=foo ...
in which case no changes to sbin/machine-type are needed.
Some platform-specific notes may be found in doc/README.<platform>.
Even on the known platforms you might have to modify variables defined in
common/Makefile.machine.<platform> . Candidates for changes are
CC, CXX: choose compiler or compiler version. For example, you might
have to specify a directory path to the compiler driver.
PIC_FLAG: define if your compiler uses something other than -fPIC to
generate position-independent code. In particular, define this
to be empty if your compiler does not generate PIC, or does so
by default.
DEMANGLE_FILTER: If the "c++filt" program is not installed on your system
set this variable to empty.
TCL_INCLUDE, TCL_LIBRARY: to whatever is needed to find the Tcl header
files and library. If Tcl is not available, set NO_TCL=X
and leave the above variables empty.
NO_ICONV: Set this variable to anything to turn off 16-bit unicode support
and linking with the iconv library.
It is recommended that you record changes to platform dependent variables
in common/Makefile.site.<platform> and leave Makefile.machine.<platform>
unchanged. That makes it easier to upgrade SRILM to future releases
(just copy common/Makefile.site.<platform> to a new installation).
4 - You need the following free third-party software to build SRILM:
- gcc version 3.4.3 or higher, or Microsoft Visual Studio.
(older versions might work as well, but are no longer supported).
SRILM is occasionally tested with other compilers, see the
portability notes in the CHANGES file.
- Optionally, the libLBFGS optimization library if you want to build
maximum entropy models. If so, build and install libLBFGS separately
and set HAVE_LIBLBFGS=1 in the platform-specific makefile (see above).
- GNU make
- An iconv library, such as the GNU implementation, unless libiconv
is already part of your C library.
- John Ousterhout's Tcl toolkit, version 7.3 or higher
(this is currently used only for some test programs, but is needed
for the build to go through without manual intervention).
- Additional platform-dependent prerequisites are mentioned in
doc/README.<os>-<machinetype>, e.g., doc/README.windows-cygwin.
The following tools are needed at runtime only:
- GNU awk (gawk), to interpret many of the utility scripts
- gzip, to read/write compressed files
- bzip2, to read/write .bz2 compressed files (optional)
- p7zip, to read/write .7z compressed files (optional)
- xz, to read/write .xz compressed files (optional)
For Windows, you will need the CYGWIN UNIX compatibility
environment, which includes all of the above. The MinGW and Visual
C platforms will also work, but with some loss of functionality.
See doc/README.windows-* for more information.
Links to these packages can be found on the SRILM download page
(http://www.speech.sri.com/projects/srilm/download.html).
5 - In the top-level directory, run
gnumake World or
make World (if the GNU version is the system default)
This will create the directories
bin/
lib/
include/
build everything and install public commands, libraries and headers in
these directories. Binaries are actually installed in subdirectories
indicating the platform type.
To create binaries for a platform that is not the default on your system,
use make MACHINE_TYPE=xxx, e.g.
make MACHINE_TYPE=i686-m64 World # 64-bit binaries for Linux
make MACHINE_TYPE=msvc World # MS Visual C++ on Windows
6 - The result of the above should be a fair number of .h and .cc files in
include/, libraries in lib/$MACHINE_TYPE, and programs in
bin/$MACHINE_TYPE. In your shell, set the following environment
variables:
PATH add $SRILM/bin/$MACHINE_TYPE and $SRILM/bin
MANPATH add $SRILM/man
7 - To test the compiled tools, run
gnumake test
from the top-level directory.
This exercises the most important (though not all) functionality in
SRILM and compares the results to reference outputs. If discrepancies are
reported, examine the output files in $SRILM/<module>/test/output and
compare them to the corresponding files in $SRILM/<module>/test/reference,
where <module> is a subdirectory name (lm, flm, lattice).
8 - After a successful build, clean up the source directories of object and
binary files that are no longer needed:
gnumake cleanest
9 - (Optional) To build versions of the libraries and executables that are
optimized for space rather than speed, run
gnumake World OPTION=_c
gnumake cleanest OPTION=_c
The libraries will appear in ${SRILM}/lib/${MACHINE_TYPE}_c, with
executables in ${SRILM}/bin/${MACHINE_TYPE}_c . The data structures
used in these versions use sorted arrays rather than hash tables, which
wastes less memory, but is also somewhat slower. The directory suffix "_c"
stands for "compact".
Other versions of the binaries can be built in a similar manner.
The compile options currently supported are
OPTION=_c "compact" data structures
OPTION=_s "short" count representation
OPTION=_l "long long" count representation
OPTION=_g debuggable, non-optimized code
OPTION=_p profiling executables
In addition, if libraries with position-independent code are needed, add
MAKE_PIC=yes
to the make command line. This may incur a slight performance penalty but
is necessary for certain software projects that link against SRILM libs.
10 - Recent versions of gawk may not perform correct floating-point arithmetic
unless either
LC_NUMERIC=C or
LC_ALL=C
is set in the environment. This affects many of the scripts in utils/.
11 - Be sure to let me know if I left something out.
Andreas Stolcke
stolcke@speech.sri.com
$Date: 2014-03-24 17:57:28 $

View File

@@ -0,0 +1,230 @@
SRILM Research Community License
Version 1.0
1. DEFINITIONS
1.1. "Community" means the Initial Developer and each and every one of
You.
1.2. "Contributor" means each individual or legal entity that creates or
contributes to the creation of Modifications.
1.3. "Distribute" means to transfer, publish, or otherwise provide or
make available a copy of software to any third party.
1.4. "Distributor" means each individual or legal entity exercising a
right to Distribute Licensed Software under this License.
1.5. "Distributor Code" means, collectively, (a) the Original Source
Code and (b) the Licensed Software that is Distributed by a particular
Distributor.
1.6. "Distributor IP" means all patent claims, copyright, and trade
secrets owned or licensable by a Distributor that are embodied in or
necessarily practiced by the Distributor Code of that particular
Distributor.
1.7. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic transfer
of data.
1.8. "Executable" means software in any form other than Source Code.
1.9. "Initial Developer" means SRI International ("SRI"), a California
nonprofit public benefit corporation having offices in Menlo Park,
California.
1.10. "Initial Developer IP" means all patent claims, copyright, and
trade secrets owned or licensable by the Initial Developer which are
embodied in or necessarily practiced by the unmodified Original Source Code.
1.11. "License" means this agreement, the SRILM Research Community
License Version 1.0.
1.12. "Licensed Purpose" means the exercise of rights under this
License: (a) by an official governmental agency, strictly for
non-commercial, public benefit purposes, or (b) solely for non-commercial
research purposes in exchange for which no financially valuable
consideration (including but not limited to sales or license revenue,
service revenue, and advertising revenue, and further including but not
limited to monetary, equity, and in-kind forms of consideration) is
received, except for research funding received from an official government
agency sponsor.
1.13. "Licensed Software" means any copy of the Original Source Code,
the Modifications, and/or Executable versions thereof, as to which You are
exercising any rights under this License.
1.14. "Modifications" means any derivative work of either the Original
Source Code or of existing Modifications.Including header files or calls to
Licensed Software library functions or Executable programs in an application
program shall not in and of itself cause that application program to be
deemed a Modification, provided that the Licensed Software so included shall
in any case remain subject to the terms of this License.
1.15. "Original Source Code" means the Source Code for the SRI Language
Modeling Toolkit as made available for download by SRI International from
URL http://www.speech.sri.com/ or ftp://ftp.speech.sri.com/ as of July 1,
1999.
1.16. "Source Code" means the preferred form of software for making
modifications to it, including all modules it contains, plus any associated
interface definition files, scripts used to control compilation and
installation of an Executable, or a list of source code differential
comparisons against either the Original Source Code or another well known,
available Modification of the Contributor's choice. The Source Code can be
in a compressed or archival form, provided the appropriate decompression or
de-archiving software is widely available for no charge.
1.17. "You" means an individual or a legal entity exercising rights
under this License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of fifty percent (50%) or more of
the outstanding shares or beneficial ownership of such entity.
2. SOFTWARE LICENSE GRANTS
2.1. The Initial Developer Grant. The Initial Developer hereby grants
the Community worldwide, royalty-free, non-exclusive rights, solely for the
Licensed Purpose and subject to the terms and conditions of this
License(including without limitation the Contributor and Distributor grants
set forth in Section 2 and the Distribution Obligations set forth in Section
3), as follows:
(a) A license under the Initial Developer IP to modify, copy, use, and
Distribute the Original Source Code and Modifications.
(b) A license to copy, use and Distribute Executable versions of the
Original Source Code and Modifications.
2.2. Distributor Grant. If You are a Distributor, You hereby grant the
Community a worldwide, royalty-free, non-exclusive license under the
Distributor IP, solely for the Licensed Purpose and subject to the terms and
conditions of this License, to modify copy, use, and Distribute the
Distributor Code and Modifications.
2.3. Sublicenses. The license rights that are granted under this Section
2 may be sublicensed only by Distributing Licensed Software in compliance
with all applicable terms and conditions of this License. No other
sublicensing of intellectual property rights granted under this License is
permitted.
2.4. No Other Rights. Except as expressly set forth in this section 2,
no other license rights are implied or otherwise granted under this License.
3. DISTRIBUTION OBLIGATIONS
The right to Distribute Licensed Software set forth above, whether to a
government sponsor or to any other recipient, is subject to the following
obligations:
3.1. Notice of License to Recipients.Any publication or other
Distribution of Licensed Software must be made expressly subject to this
License.You must include a prominent copy of the notice set forth in Exhibit
A with all Licensed Software that you Distribute: (a) in all notices or
documentation in which You describe the origin or ownership of the software
or the recipient's rights thereto, and (b) in each Source Code file. You
hereby agree to indemnify the Initial Developer and every Contributor to the
Licensed Software for any and all liability or damages they may incur if
caused by Your violation of this Section. Except as expressly authorized by
this License, no right is granted to use the name of SRI in any advertising,
news release, other publication, or product documentation, without the prior
express written consent of SRI.
3.2. Required Availability of Source Code. If You Distribute Licensed
Software for which you are a Contributor, You must make the Source Code for
all Modifications to which you contribute publicly available to the
Community, under the terms of this License and at no additional restriction
or cost, via an accepted Electronic Distribution Mechanism for a period of
at least twelve (12) months following the date You first Distribute the
Licensed Software.You must also include with the Source Code a file
documenting any changes You made to create each Modification, and the dates
of such changes.
3.3. Licensee Registration. Before You Distribute any Licensed Software
under this License, You must first register by sending email to the Initial
Developer addressed to srilm@speech.sri.com, including a statement
confirming that you accept the terms and conditions of this License and
describing the specific Electronic Distribution Mechanism you are using
(e.g., identify the URL) to make Source Code available under Section 3.2
where applicable.
4. DISCLAIMER OF WARRANTY
LICENSED SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE
LICENSED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR
PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LICENSED SOFTWARE IS WITH YOU. SHOULD ANY LICENSED SOFTWARE PROVE
DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY CONTRIBUTOR)
ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS
DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE
OF ANY LICENSED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
DISCLAIMER.
5. LIMITATION OF LIABILITY
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY
CONTRIBUTOR, OR ANY DISTRIBUTOR OF LICENSED SOFTWARE, OR ANY SUPPLIER OF ANY
OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING,
WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER
FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES,
EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH
DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH
OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW
THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT
EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
6. RESPONSIBILITY FOR CLAIMS.
You are responsible for damages arising, directly or indirectly, out of Your
exercise of rights under this License, based on the number of copies of
Licensed Software you made available, the revenues you received from
utilizing such rights, and other relevant factors. You agree to work with
affected parties to distribute responsibility on an equitable basis.
7. U.S. GOVERNMENT END USERS.
The Licensed Software is a "commercial item," as that term is defined in 48
C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and
"commercial computer software documentation," as such terms are used in 48
C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users
acquire Licensed Software with only those rights set forth herein.
8. MISCELLANEOUS.
This License represents the complete agreement concerning subject matter
hereof. If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable. This License shall be governed by California law provisions
(except to the extent applicable law, if any, provides otherwise), excluding
its conflict-of-law provisions. With respect to disputes in which at least
one party is a citizen of, or an entity chartered or registered to do
business in, the United States of America any litigation relating to this
Agreement shall be subject to personal jurisdiction and venue in the Federal
Courts of the Northern District of California, and in the California state
courts of San Mateo County, California, with the losing party responsible
for costs, including without limitation, court costs and reasonable
attorneys fees and expenses. The application of the United Nations
Convention on Contracts for the International Sale of Goods is expressly
excluded. Any law or regulation which provides that the language of a
contract shall be construed against the drafter shall not apply to this
License.
EXHIBIT A.
The contents of this file are subject to the SRILM Community Research
License Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.speech.sri.com/srilm/. Software distributed under the License is
distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
express or implied. See the License for the specific language governing
rights and limitations under the License. Portions of the software are
Copyright (c) SRI International, 1995-2011. All rights reserved.

View File

@@ -0,0 +1,2 @@
include $(SRILM)/common/Makefile.test

View File

@@ -0,0 +1,7 @@
This directory contains regression tests for many of the SRILM tools.
tests/ contains the test definitions
outputs/ saved test outputs
reference/ reference output files

View File

@@ -0,0 +1 @@
1.7.1

View File

@@ -0,0 +1,2 @@
# Use this default location unless overridden on command line
MSVCDIR ?= C:\\Program Files\\Microsoft Visual Studio 8\\VC

View File

@@ -0,0 +1,2 @@
# Use this default location unless overridden on command line
MSVCDIR ?= C:\\Program Files\\Microsoft Visual Studio 9.0\\VC

View File

@@ -0,0 +1,2 @@
# Use this default location unless overridden on command line
MSVCDIR ?= C:\\Program Files\\Microsoft Visual Studio 10.0\\VC

View File

@@ -0,0 +1,2 @@
# Use this default location unless overridden on command line
MSVCDIR ?= C:\\Program Files\\Microsoft Visual Studio 11.0\\VC

View File

@@ -0,0 +1,15 @@
include $(SRILM)/common/Makefile.machine.msvc
# use 64 bit compilers if available or 32 bit cross-compiling binaries
# if not.
MSVC_BIN := "$(shell cygpath '$(MSVCDIR)/bin/amd64')"
ifeq ($(strip $(wildcard "$MSVC_BIN")),)
MSVC_BIN := "$(shell cygpath '$(MSVCDIR)/bin/x86_amd64')"
endif
# 64bit MSVC keeps sizeof(long) = sizeof(int), so tell it to use long long counts
ADDITIONAL_CFLAGS += -DUSE_LONGLONG_COUNTS
ADDITIONAL_CXXFLAGS += -DUSE_LONGLONG_COUNTS
# suppress warnings about info loss in conversion from long long to float/double
MSC_FLAGS += /wd4244

View File

@@ -0,0 +1,252 @@
#
# File: Makefile.common.targets
# Author: The SRI DECIPHER (TM) System
# Date: Tue Nov 3 23:45:49 1992
#
# Description:
# This file provides the common "make" targets shared by the
# DECIPHER (TM) subsystems. Include this file in the targets
# section of a makefile to use the shared definitions.
# (Typically, the "include" should be the last command in the
# makefile.)
#
# Copyright (c) 1992-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.common.targets,v 1.40 2013-10-22 23:33:59 frandsen Exp $
#
# Create the initial directory structure (assumes "src" exists).
init:
-cd ..; $(SRILM)/sbin/make-standard-directories
$(MAKE) $(OBJDIR_STAMP) $(BINDIR_STAMP)
# Delete all of the files which can be automatically regenerated.
#pristine:
# -cd ..; $(SRILM)/sbin/remove-standard-directories
# Make all, using optimize options.
optimize:
$(MAKE) OPTION=$(OPTIMIZE_OPTION) all
# Make all, using debug options.
debug:
$(MAKE) OPTION=$(DEBUG_OPTION) all
# Make all, using profile options.
profile:
$(MAKE) OPTION=$(PROFILE_OPTION) all
# Make all, using export options.
export:
$(MAKE) OPTION=$(EXPORT_OPTION) all
# Make programs, using purify
purify:
$(MAKE) OPTION=$(OPTION) BIN_OPTION=_pure LINK.c="$(PURIFY) $(PURIFY_FLAGS) $(LINK.c)" LINK.cc="$(PURIFY) $(PURIFY_FLAGS) $(LINK.cc)" PROGRAM_NAMES="$(PROGRAM_NAMES)" programs
.PHONY: libraries programs
# Make all libraries.
libraries: $(ALL_LIBRARIES)
# Make all programs.
programs: $(ALL_PROGRAMS)
# XXX -- This is disabled for now, since it frequently causes excess re-compilation.
# Make sure all objects depend on the makefiles.
#$(ALL_OBJECTS): Makefile \
# $(SRILM)/common/Makefile.common.variables \
# $(SRILM)/common/Makefile.common.targets
# Cancel the rules which put the compilation results in the source
# directory. (Note: This avoids problems with source files which
# have the same root name as make targets.)
%: %.c
%$(OBJ_SUFFIX): %.c
#
# These dependencies create the necessary target directories on demand,
# but avoid doing so only once per module.
#
OBJDIR_STAMP = $(OBJDIR)/STAMP
BINDIR_STAMP = $(BINDIR)/STAMP
$(ALL_OBJECTS): $(OBJDIR_STAMP)
$(ALL_PROGRAMS): $(BINDIR_STAMP)
$(OBJDIR_STAMP) $(BINDIR_STAMP):
-mkdir $(dir $@)
touch $@
# Default C compiling pattern-matching rule:
$(OBJDIR)/%$(OBJ_SUFFIX): $(SRCDIR)/%.c
$(COMPILE.c) $(OPTION_FLAGS) $(OUTPUT_OPTION) $<
# Support for C++ compilation
%: %.cc
%$(OBJ_SUFFIX): %.cc
# Default C compiling pattern-matching rule:
$(OBJDIR)/%$(OBJ_SUFFIX): $(SRCDIR)/%.cc
$(COMPILE.cc) $(OPTION_FLAGS) $(OUTPUT_OPTION) $<
# Hack to compile certain sources without optimization
# (workaround for compiler bugs)
NO_OPT_PATTERN = -O%
$(patsubst %,$(OBJDIR)/%$(OBJ_SUFFIX),$(NO_OPT_SOURCES)):
$(MAKE) NO_OPT_SOURCES= OPTION_FLAGS="$(filter-out $(NO_OPT_PATTERN), $(OPTION_FLAGS))" $@
# Program linking
# The heuristic here is that if any C++ source is present at all
# we use the C++ driver to link the whole thing, otherwise the C driver.
# The "test -f" at the end is to check for success in creating an
# output since otherwise failure can be hidden by the DEMANGLE_FILTER.
#
# Note that ADDITIONAL_LIBRARIES are sometimes modified in individual
# library or application Makefiles, and are then included in
# LIBRARIES; SYS_LIBRARIES are set only in Makefiles in this
# directory, and is used only in this link rule. The two are not used
# consistently.
#
$(BINDIR)/%$(EXE_SUFFIX): $(OBJDIR)/%$(OBJ_SUFFIX) $(filter-out -%, $(LIBRARIES))
ifeq ($(filter %.cc,$(ALL_SOURCES)), )
$(LINK.c) $(LD_OPTION_FLAGS) $(LD_OUTPUT_OPTION) $< $(LIBRARIES) $(SYS_LIBRARIES) $(DEMANGLE_FILTER)
else
$(LINK.cc) $(LD_OPTION_FLAGS) $(LD_OUTPUT_OPTION) $< $(LIBRARIES) $(SYS_LIBRARIES) $(DEMANGLE_FILTER)
endif
test -f $@
$(POST_LINK)
# revised release targets and dependencies:
.PHONY : release release-headers release-libraries release-programs release-scripts
RELEASED_HEADERS = $(EXPORTED_HEADERS:$(SRCDIR)/%=$(SRILM_INCDIR)/%)
release-headers: $(RELEASED_HEADERS)
$(SRILM_INCDIR)/%: $(SRCDIR)/%
-$(INSTALL) -p 0444 $^ $(SRILM_INCDIR)
RELEASED_LIBRARIES = $(EXPORTED_LIBRARIES:$(OBJDIR)/%$(LIB_SUFFIX)=$(SRILM_LIBDIR)/%$(LIB_SUFFIX))
# We want to re-install only only those binaries that have changed, and
# use make to figure out the things that need updating. However,
# gnumake isn't smart enough to process this dependency in
# conjunction with the rules for library creation. So we first make sure
# all libraries are uptodate, then do a recursive make to do the installation.
# And take care not to run $(MAKE) without arguments.
# Same applies to $(RELEASED_PROGRAMS) and $(RELEASED_SCRIPTS) below.
release-libraries: $(RELEASED_LIBRARIES) $(SRILM_LIBDIR)/SRILM_OPTIONS.mk
$(SRILM_LIBDIR)/%$(LIB_SUFFIX): $(OBJDIR)/%$(LIB_SUFFIX)
-$(INSTALL) 0644 $^ $(SRILM_LIBDIR)
$(RANLIB) $@ $(DEMANGLE_FILTER)
$(SRILM_LIBDIR)/SRILM_OPTIONS.mk: $(SRILM)/common/Makefile.common.variables $(RELEASED_LIBRARIES)
echo "SRILM_BUILD_LIB_DEPENDENCIES = $(EXPORT_SRILM_BUILD_LIB_DEPENDENCIES)" > $(SRILM_LIBDIR)/SRILM_OPTIONS.mk
echo "SRILM_BUILD_ADDITIONAL_CFLAGS = $(ADDITIONAL_CFLAGS)" >> $(SRILM_LIBDIR)/SRILM_OPTIONS.mk
echo "SRILM_BUILD_ADDITIONAL_CXXFLAGS = $(ADDITIONAL_CXXFLAGS)" >> $(SRILM_LIBDIR)/SRILM_OPTIONS.mk
RELEASED_PROGRAMS = $(EXPORTED_PROGRAMS:$(BINDIR)/%=$(SRILM_BINDIR)/%)
release-programs: $(RELEASED_PROGRAMS)
$(SRILM_BINDIR)/%: $(BINDIR)/%
-$(INSTALL) 0555 $^ $(SRILM_BINDIR)
RELEASED_SCRIPTS = $(EXPORTED_SCRIPTS:%=$(SRILM_BIN)/%)
release-scripts: $(RELEASED_SCRIPTS)
$(SRILM_BIN)/%: %
-$(INSTALL) 0555 $^ $(SRILM_BIN)
# Dependency tracing target
depend:
$(RM) $(DEPENDENCIES)
ifneq ($(filter %.c,$(ALL_SOURCES)), )
$(GEN_DEP) $(filter -D%,$(OPTION_FLAGS)) $(filter %.c,$(ALL_SOURCES)) | sed -e "s&^\([^ ]\)&$(BASE_OBJDIR)"'$$(OBJ_OPTION)'"/\1&g" -e "s&\.o&$(OBJ_SUFFIX)&g" >> $(DEPENDENCIES)
endif
ifneq ($(filter %.cc,$(ALL_SOURCES)), )
$(GEN_DEP.cc) $(filter -D%,$(OPTION_FLAGS)) $(filter %.cc,$(ALL_SOURCES)) | sed -e "s&^\([^ ]\)&$(BASE_OBJDIR)"'$$(OBJ_OPTION)'"/\1&g" -e "s&\.o&$(OBJ_SUFFIX)&g" >> $(DEPENDENCIES)
endif
$(SRILM)/sbin/generate-program-dependencies $(BASE_BINDIR) $(BASE_OBJDIR) "$(EXE_SUFFIX)" $(ALL_PROGRAM_NAMES) | sed -e "s&\.o&$(OBJ_SUFFIX)&g" >> $(DEPENDENCIES)
# Targets for cleaning up
clean: remove-objects
cleaner: clean remove-dependencies remove-libraries
cleanest: cleaner remove-programs
superclean: cleanest remove-exported-headers remove-exported-libraries remove-exported-programs remove-exported-scripts
# Delete bin and obj directories and files which can be automatically regenerated.
# Note that bin and obj directories are only removed when last
# machine-dependent subdirectory is removed
pristine: superclean remove-bin-directory remove-obj-directory
remove-objects:
-$(RM) $(OBJDIR)/*$(OBJ_SUFFIX) $(EXTRA_REMOVE_OBJECTS)
remove-dependencies:
-$(RM) Dependencies.$(MACHINE_TYPE) $(EXTRA_REMOVE_DEPENDENCIES)
remove-libraries:
-$(RM) $(ALL_LIBRARIES) $(EXTRA_REMOVE_LIBRARIES)
remove-programs:
-$(RM) $(ALL_PROGRAMS) $(EXTRA_REMOVE_PROGRAMS)
remove-exported-headers:
ifneq ($(RELEASED_HEADERS), )
-$(RM) $(RELEASED_HEADERS)
endif
remove-exported-libraries:
ifneq ($(RELEASED_LIBRARIES), )
-$(RM) $(RELEASED_LIBRARIES)
endif
remove-exported-programs:
ifneq ($(RELEASED_PROGRAMS), )
-$(RM) $(RELEASED_PROGRAMS)
endif
remove-exported-scripts:
ifneq ($(RELEASED_SCRIPTS), )
-$(RM) $(RELEASED_SCRIPTS)
endif
# bin and obj directories only removed when last machine-dependent subdirectory is removed:
remove-bin-directory:
-$(RM) $(BINDIR_STAMP)
-$(RMDIR) $(BINDIR)
-$(RMDIR) ../bin
remove-obj-directory:
-$(RM) $(OBJDIR_STAMP)
-$(RMDIR) $(OBJDIR)
-$(RMDIR) ../obj
sanitize:
$(SRILM)/sbin/sanitize-3rdparty /dev/null $(ALL_HEADERS) $(ALL_SOURCES)
desanitize:
$(SRILM)/sbin/desanitize-3rdparty /dev/null $(ALL_HEADERS) $(ALL_SOURCES)
# Default Lint pattern-matching rule:
$(SRCDIR)/%.lint: $(SRCDIR)/%.c
$(LINT) $(LINT_FLAGS) $< > $@
# Lint rules:
lint: $(ALL_LINT)
remove-lint:
$(RM) $(ALL_LINT)
# Include the dependencies generated by "make depend" if they exist.
ifeq ($(shell ls $(DEPENDENCIES) 2> /dev/null), $(DEPENDENCIES))
include $(DEPENDENCIES)
endif

View File

@@ -0,0 +1,226 @@
#
# File: Makefile.common.variables
# Author: The SRI DECIPHER (TM) System
# Date: Tue Nov 3 23:54:18 1992
#
# Description:
# This file provides the common "make" variables shared by the
# DECIPHER (TM) subsystems. Include this file in the variables
# a makefile to use the shared definitions. (Typically, the
# "include" should be the first command in the makefile.)
#
# Copyright (c) 1992-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.common.variables,v 1.38 2013-12-11 15:30:07 frandsen Exp $
#
# Define variables
# Store some outputs in variables to write to
# lib/OUTDIR/SRILM_OPTIONS.mk
# Store these as "EXPORT_SRILM_BUILD*" and write as "SRILM_BUILD* = ".
# They get added to as special settings are made below.
EXPORT_SRILM_BUILD_LIB_DEPENDENCIES =
# Determine the current host machine type.
ifeq ($(MACHINE_TYPE), )
MACHINE_TYPE := $(shell $(SRILM)/sbin/machine-type)
endif
ifeq ($(OS_TYPE), )
OS_TYPE := $(shell uname -s)
endif
ifeq ($(OS_VERSION), )
OS_VERSION := $(shell uname -r)
endif
# Define options.
OPTIMIZE_OPTION =
COMPACT_OPTION = _c
SHORT_OPTION = _s
LLONG_OPTION = _l
DEBUG_OPTION = _g
PROFILE_OPTION = _p
EXPORT_OPTION = _x
# Flags for generating "compact" data structures (nothing by default)
COMPACT_FLAGS = $(OPTIMIZE_FLAGS)
# Flags for generating "short" data structures (nothing by default)
SHORT_FLAGS = $(COMPACT_FLAGS)
# Flags for generating "long long" data structures (nothing by default)
LLONG_FLAGS = $(COMPACT_FLAGS)
# Purify support (can be changed in Makefile.machine.$(MACHINE_TYPE))
PURIFY = purify
PURIFY_FLAGS = -best-effort
# Flag for generating "exported" code:
# omit third-party functionality and strip binaries
EXPORT_FLAGS = -DEXCLUDE_CONTRIB
EXPORT_LDFLAGS = -s
# How to remove directories
RMDIR = rmdir
# How to create an archive library
ARCHIVE = $(AR) ruv
AR_OUTPUT_OPTION = $@
# This is appended to certain commands to demangle C++ symbols
DEMANGLE_FILTER = 2>&1 | c++filt
# Path to GNU awk; used in editing scripts
GAWK = /usr/local/bin/gawk
# Path to Perl; used in editing scripts
PERL = /usr/local/bin/perl
# Keep the source and object files in separate directories.
OUTPUT_OPTION = -o $@
LD_OUTPUT_OPTION = -o $@
# by default, linking uses same optimization switches as compiler
LD_OPTION_FLAGS = $(OPTION_FLAGS)
# File suffixes
EXE_SUFFIX =
OBJ_SUFFIX = .o
LIB_SUFFIX = .a
LIB_PREFIX = lib
MATH_LIBRARY = -lm
# How to force linking with the math error handler
MATHERR_LINK = -u $(SYMBOL_PREFIX)matherr
SYMBOL_PREFIX =
# Default PIC flag is for gcc
# (for others override in Makefile.machine.*)
PIC_FLAG = -fPIC
# Include machine-type dependent variables
include $(SRILM)/common/Makefile.machine.$(MACHINE_TYPE)
# Optionally include site dependent variables
-include $(SRILM)/common/Makefile.site.$(MACHINE_TYPE)
# Don't link to TCL Library if NO_TCL is set to anything non-empty
ifneq ($(NO_TCL), )
TCL_INCLUDE =
TCL_LIBRARY =
else
# Removed 12/11/2013. Programs depend on this, not generated libs.
# EXPORT_SRILM_BUILD_LIB_DEPENDENCIES += $(TCL_LIBRARY)
endif
# Needed for MaxEnt models
ifneq ($(HAVE_LIBLBFGS), )
ifeq ($(LBFGS_LIBRARY), )
LBFGS_LIBRARY = -llbfgs
EXPORT_SRILM_BUILD_LIB_DEPENDENCIES += $(LBFGS_LIBRARY)
endif
else
LBFGS_LIBRARY =
endif
# Search in the SRILM library directories for things of the form "-l<LibName>".
ifeq ($(EXTRA_LIBDIR), )
VPATH = $(SRILM_LIBDIR)
else
VPATH = $(SRILM_LIBDIR):$(EXTRA_LIBDIR)
endif
# Install script for all machines (based on GNU ginstall utility)
INSTALL = $(SRILM)/sbin/decipher-install
# Note: The current directory must be searched before the main SRILM include
# directory to ensure that local versions of included files will be used.
INCLUDES = $(ADDITIONAL_INCLUDES) -I. -I$(SRILM_INCDIR)
DEPENDENCIES = Dependencies.$(MACHINE_TYPE)
# Which of the above options is to be used by default?
OPTION = $(OPTIMIZE_OPTION)
# The make option determines the object and binary directory suffixes.
OBJ_OPTION = $(OPTION)
BIN_OPTION = $(OPTION)
# Choose the appropriate compilation options.
ifeq ($(OPTION), $(OPTIMIZE_OPTION))
OPTION_FLAGS = $(OPTIMIZE_FLAGS)
else
ifeq ($(OPTION), $(COMPACT_OPTION))
OPTION_FLAGS = $(COMPACT_FLAGS)
else
ifeq ($(OPTION), $(SHORT_OPTION))
OPTION_FLAGS = $(SHORT_FLAGS)
else
ifeq ($(OPTION), $(LLONG_OPTION))
OPTION_FLAGS = $(LLONG_FLAGS)
else
ifeq ($(OPTION), $(DEBUG_OPTION))
OPTION_FLAGS = $(DEBUG_FLAGS)
ADDITIONAL_LDFLAGS := $(ADDITIONAL_LDFLAGS) $(DEBUG_LDFLAGS)
else
ifeq ($(OPTION), $(PROFILE_OPTION))
OPTION_FLAGS = $(PROFILE_FLAGS)
# We also need to link with the profiling flags.
ifeq ($(PROFILE_LDFLAGS),)
PROFILE_LDFLAGS = $(PROFILE_FLAGS)
endif
ADDITIONAL_LDFLAGS := $(ADDITIONAL_LDFLAGS) $(PROFILE_LDFLAGS)
else
ifeq ($(OPTION), $(EXPORT_OPTION))
# Export programs are compiled with optimization
# and linked with special export flags.
OPTION_FLAGS = $(OPTIMIZE_FLAGS) $(EXPORT_FLAGS)
ADDITIONAL_LDFLAGS := $(ADDITIONAL_LDFLAGS) $(EXPORT_LDFLAGS)
endif
endif
endif
endif
endif
endif
endif
# PIC compilation
ifneq ($(MAKE_PIC),)
CFLAGS += $(PIC_FLAG)
CXXFLAGS += $(PIC_FLAG)
endif
# Define directories.
# SRILM directories.
# Note: attempt to construct relative paths when building inside $SRILM,
# for the benefit of MSVC tools which don't understand absolute cygwin paths
ifeq ($(patsubst $(SRILM)/%/src,,$(PWD)),)
SRILM_INCDIR = ../../include
SRILM_LIB = ../../lib
SRILM_BIN = ../../bin
else
SRILM_INCDIR = $(SRILM)/include
SRILM_LIB = $(SRILM)/lib
SRILM_BIN = $(SRILM)/bin
endif
SRILM_LIBDIR = $(SRILM_LIB)/$(MACHINE_TYPE)$(OBJ_OPTION)
SRILM_BINDIR = $(SRILM_BIN)/$(MACHINE_TYPE)$(BIN_OPTION)
# Default directories.
SRCDIR = .
BASE_OBJDIR = ../obj/$(MACHINE_TYPE)
OBJDIR = $(BASE_OBJDIR)$(OBJ_OPTION)
BASE_BINDIR = ../bin/$(MACHINE_TYPE)
BINDIR = $(BASE_BINDIR)$(BIN_OPTION)
# Lint output files:
ALL_LINT = $(ALL_SOURCES:$(SRCDIR)/%.c=$(SRCDIR)/%.lint)

View File

@@ -0,0 +1,143 @@
#
# File: Makefile.core.android
# Author: Mike Frandsen
# Date: 2010/08/03
#
# Description:
# Machine dependent compilation options and variable definitions
# for Android, core file
#
# Copyright (c) 1999-2010 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.core.android,v 1.7 2013-07-01 22:26:44 frandsen Exp $
#
# This Makefile only included by core x86 or arm Android Makefiles.
# Override this if you are not building on Linux or set to
# linux-x86_64 if your host is 64 bit.
ANDROID_HOST ?= linux-x86
# Need to set ndk directory; assume >= NDK r5b which bundles STL.
# Use ?= so environment variables will override.
#ANDROID_NDK ?= ~/android-ndk-r6b
ANDROID_NDK ?= ~/android-ndk-r8e
ANDROID_VERSION ?= android-4
SYSROOT := $(ANDROID_NDK)/platforms/$(ANDROID_VERSION)/$(ANDROID_ARCH)
# Below was appropriate for NDK r5b
#ANDROID_SRILM_BIN := $(ANDROID_NDK)/toolchains/arm-eabi-4.4.0/prebuilt/$(ANDROID_HOST)/bin
#GCC := $(ANDROID_SRILM_BIN)/arm-eabi-gcc
#GPP := $(ANDROID_SRILM_BIN)/arm-eabi-g++
#AR := $(ANDROID_SRILM_BIN)/arm-eabi-ar
#OPT_GCC_VER :=
# Set as follows for NDK r6b
#ANDROID_TOOLCHAIN_VERSION := 4.4.3
#OPT_GCC_VER :=
# Set as follows for NDK r8b
# 4.4.3 should also be available in r8b
ANDROID_TOOLCHAIN_VERSION := 4.6
# Newer versions add "/4.4.3" or "/4.6" to include and lib paths
OPT_GCC_VER := /$(ANDROID_TOOLCHAIN_VERSION)
ANDROID_TOOLCHAIN_NAME_ALT ?= $(ANDROID_TOOLCHAIN_NAME)
ANDROID_SRILM_BIN := $(ANDROID_NDK)/toolchains/$(ANDROID_TOOLCHAIN_NAME_ALT)-$(ANDROID_TOOLCHAIN_VERSION)/prebuilt/$(ANDROID_HOST)/bin
GCC := $(ANDROID_SRILM_BIN)/$(ANDROID_TOOLCHAIN_NAME)-gcc
GPP := $(ANDROID_SRILM_BIN)/$(ANDROID_TOOLCHAIN_NAME)-g++
AR := $(ANDROID_SRILM_BIN)/$(ANDROID_TOOLCHAIN_NAME)-ar
# Other possible options:
# As above:
# (arm-eabi-)+(gcc,g++,ar)
# (arm-linux-androideabi-)+(gcc,g++,ar)
# Others:
# ()+(gcc,g++,ar)
# (i686-android-linux-)+(gcc,g++,ar)
ARCHIVE = $(AR) crsuv
# Use the GNU C compiler.
WARNING_FLAGS := -Wreturn-type -Wimplicit -Wuninitialized -Wdeprecated -Wpointer-arith -Wstrict-overflow -Woverlength-strings -Wunused-variable
GCC_FLAGS = $(ARCH_FLAGS) $(WARNING_FLAGS) -DNO_ZIO -DNO_ICONV
CC = $(GCC) $(GCC_FLAGS) --sysroot=$(SYSROOT)
CXX = $(GPP) $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES --sysroot=$(SYSROOT)
# avoid gcc warning that all code is PIC
PIC_FLAG = -fpic
# suffix used for executable files
EXE_SUFFIX =
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O2 -Os -DNDEBUG -ffunction-sections -funwind-tables -fno-short-enums
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS = -DNEED_RAND48
ADDITIONAL_CXXFLAGS = -DNEED_RAND48
# Other useful include directories.
ADDITIONAL_INCLUDES = -I$(SYSROOT)/usr/include -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(OPT_GCC_VER)/include -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(OPT_GCC_VER)/libs/$(ANDROID_CUST_DIR)/include
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
# r6b and earlier
#ADDITIONAL_LIBRARIES = -lm -lstdc++ -lgcc
# r8b
# -rpath-link was recommended but not needed as -Wl option
# The -Wl,--entry=main gets rid of the warnings like "cannot find entry symbol _start"
ANDROID_CUST_DIR_ALT ?= $(ANDROID_CUST_DIR)
ADDITIONAL_LIBRARIES = -Wl,--entry=main -L$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(OPT_GCC_VER)/libs/$(ANDROID_CUST_DIR_ALT) -lm -lgnustl_static -lsupc++ -lgcc -lc
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (part of cygwin)
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = X
# No ranlib
RANLIB = :
# Not needed
DEMANGLE_FILTER =
# Generate dependencies from source files.
GEN_DEP = gcc $(CFLAGS) -MM
GEN_DEP.cc = g++ $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/gawk
# Location of perl binary
PERL = /usr/bin/perl
# Turn off thread local storage; single instance assumed
# on Android and can conflict with other libraries.
ADDITIONAL_CFLAGS = -DNO_TLS
ADDITIONAL_CXXFLAGS = -DNO_TLS
# Fix __dso_handle errors
ADDITIONAL_LIBRARIES += $(SYSROOT)/usr/lib/crtbegin_so.o

View File

@@ -0,0 +1,24 @@
#
# File: Makefile.core.android-arm
# Author: Mike Frandsen
# Date: 2010/08/03
#
# Description:
# Machine dependent compilation options and variable definitions
# for Android on ARM, core file
#
# Copyright (c) 1999-2010 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.core.android-arm,v 1.2 2012/08/10 08:27:50 frandsen Exp $
#
# Child Makefile should include this core after first setting:
# ANDROID_CUST_CFLAGS and ANDROID_CUST_DIR
# And, if necessary:
# ANDROID_TOOLCHAIN_NAME_ALT and ANDROID_CUST_DIR_ALT
ANDROID_ARCH := arch-arm
ANDROID_TOOLCHAIN_NAME := arm-linux-androideabi
ARCH_FLAGS = -nostdlib -fno-exceptions -fno-rtti -mtune=xscale $(ANDROID_CUST_CFLAGS) -mthumb-interwork -mthumb -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DNO_EXCEPTIONS
include $(SRILM)/common/Makefile.core.android

View File

@@ -0,0 +1,33 @@
#
# File: Makefile.core.android-x86
# Author: Mike Frandsen
# Date: 2010/08/03
#
# Description:
# Machine dependent compilation options and variable definitions
# for Android on x86, core file
#
# Copyright (c) 1999-2010 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.core.android-x86,v 1.4 2013-07-01 22:41:12 frandsen Exp $
#
# Child Makefile should include this core after first setting:
# ANDROID_CUST_CFLAGS and ANDROID_CUST_DIR
# And, if necessary:
# ANDROID_TOOLCHAIN_NAME_ALT and ANDROID_CUST_DIR_ALT
ANDROID_ARCH := arch-x86
# On previous, is it i686-android-linux (?)
ANDROID_TOOLCHAIN_NAME := i686-linux-android
#ARCH_FLAGS = -nostdlib -fno-exceptions -fno-rtti $(ANDROID_CUST_CFLAGS) -DTARGET_OS=android -D__ANDROID__ -DANDROID -DGNUSOURCE -D_STLP_NEW_DONT_THROW_BAD_ALLOC -D_STLP_GLOBAL_NEW_HANDLER=1 -DEXCEPTIONS='(0 == 0)' -D__BYTE_ORDER=__LITTLE_ENDIAN -D_STLP_GLOBAL_NEW_HANDLER=1 -DGET_THE_DROIDS_MBSTATE -DANDROID_NDK
ARCH_FLAGS = -nostdlib -fno-exceptions -fno-rtti $(ANDROID_CUST_CFLAGS) -DTARGET_OS=android -D__ANDROID__ -DANDROID -DGNUSOURCE -D_STLP_NEW_DONT_THROW_BAD_ALLOC -D_STLP_GLOBAL_NEW_HANDLER=1 -D__BYTE_ORDER=__LITTLE_ENDIAN -D_STLP_GLOBAL_NEW_HANDLER=1 -DGET_THE_DROIDS_MBSTATE -DANDROID_NDK -DNO_EXCEPTIONS
include $(SRILM)/common/Makefile.core.android
# x86 one of: armeabi, mips, armeabi-v7a, x86
ADDITIONAL_INCLUDES += -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(OPT_GCC_VER)/libs/x86/include
# Now use crtbegin_so.o set in core file
#ADDITIONAL_LIBRARIES += $(ANDROID_NDK)/toolchains/$(ANDROID_CUST_DIR_ALT)-$(ANDROID_TOOLCHAIN_VERSION)/prebuilt/$(ANDROID_HOST)/lib/gcc/$(ANDROID_TOOLCHAIN_NAME)/$(ANDROID_TOOLCHAIN_VERSION).x-google/crtbegin.o

View File

@@ -0,0 +1,79 @@
#
# File: Makefile.core.iPhoneOS
# Author: Mike Frandsen
# Date: Mon Dec 17, 2012
#
# Description:
# Common compilation options and variable definitions
# for iOS to be built on a Mac. Started from macosx Makefile.
#
# Use ?= to allow user to customize XCODE_DEVELOPER path externally
XCODE_DEVELOPER ?= /Applications/Xcode.app/Contents/Developer
# LOCAL_PLATFORM_NAME and XCODE_SDK_VERSION to be set by Makefile that includes this one
DEVROOT = $(XCODE_DEVELOPER)/Platforms/$(LOCAL_PLATFORM_NAME).platform/Developer
SDKROOT = ${DEVROOT}/SDKs/$(LOCAL_PLATFORM_NAME)$(XCODE_SDK_VERSION).sdk
ifeq ($(strip $(wildcard ${SDKROOT})),)
$(error "Check XCODE_SDK_VERSION=${XCODE_SDK_VERSION}; Can't find SDKROOT ${SDKROOT}")
endif
# No TCL Libraries by default
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = X
# Use the GNU C compiler.
GCC_FLAGS = -Wreturn-type -Wimplicit
# Using XCODE_DEVELOPER path not DEVROOT since tools not always available
CC = ${XCODE_DEVELOPER}/usr/bin/gcc $(GCC_FLAGS) -Wimplicit-int
CXX = ${XCODE_DEVELOPER}/usr/bin/g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# NOTE: Not adding ${DEVROOT} below since tools not always available
ARCHIVE = /usr/bin/ar cru
RANLIB = /usr/bin/ranlib -s
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O2 -fno-common
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O2
# Optional linking flags.
EXPORT_LDFLAGS =
# Shared compilation flags.
# Introduced variable below for shared flags but is only used locally to this Makefile
LOCAL_COMMON_FLAGS = $(INCLUDES) -DHAVE_ZOPEN -DNO_ICONV "-miphoneos-version-min=5.1" -arch $(LOCAL_TARGET_ARCH) -pipe -no-cpp-precomp -isysroot ${SDKROOT} -fPIC
CFLAGS = $(ADDITIONAL_CFLAGS) $(LOCAL_COMMON_FLAGS)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(LOCAL_COMMON_FLAGS)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags; include this and set if necessary
#ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES =
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary varies, let's assume it's in the PATH
GAWK = $(shell which gawk)
# Override to nothing
MATHERR_LINK =

View File

@@ -0,0 +1,121 @@
#
# File: Makefile.development
# Author: The SRI DECIPHER (TM) System
# Date: Thu Dec 17 13:44:23 1992
#
# Description:
# This is the makefile for developing a new application
# using the DECIPHER System.
#
# To use this makefile:
#
# 0). Make sure you have your SRILM environment variable
# set correctly.
#
# 1). Make a development directory (e.g. "~user/dev/src") and
# then move to it:
#
# prompt% mkdir -p ~user/dev/src
# prompt% cd ~user/dev/src
#
# 2). Copy this file to your development directory:
#
# prompt% cp $SRILM/common/Makefile.development Makefile
#
# 3). Create the directories for object and binary files:
#
# prompt% gnumake init
#
# 4). Update the list of libraries to reflect those needed to link
# your program. If it comes from a module directory, use the
# module Makefile as a guide. Note that order is important in
# this list.
#
# 5). Build your application, using the released versions of the
# SRILM libraries:
#
# - Create your application "main()" file, e.g. "app-main.cc".
# - Replace the line "PROGRAM_NAMES = none" with
# "PROGRAM_NAMES = app-main" to "Makefile". (Note:
# You can have multiple programs defined here, as long
# as each one has a single file, named "<ProgramName>.cc"
# which provides its "main()" function.)
# - Build your application with "gnumake".
#
# 6). To replace the released versions of files in the SRILM
# libraries with your own modified versions, copy the
# files to your development directory and then add each
# new source file to the "REPLACEMENT_SOURCES" definition.
# Do a "gnumake depend" on each type of machine, and then
# remake your application with "gnumake".
#
# 7). (Optional) After you have debugged your modifications, have
# them merged into the main SRILM System in "$SRILM".
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.development,v 1.13 2006/01/09 22:47:37 stolcke Exp $
#
#MACHINE_TYPE := $(shell $(DECIPHER)/bin/machine-type)
# Include common SRILM variable definitions.
include $(SRILM)/common/Makefile.common.variables
# Define variables.
# Application variables.
PROGRAM_NAMES = fill-in
PROGRAM_SOURCES = $(foreach prog,$(PROGRAM_NAMES),\
$(wildcard $(SRCDIR)/$(prog).c) \
$(wildcard $(SRCDIR)/$(prog).cc))
PROGRAM_OBJECTS = $(PROGRAM_NAMES:%=$(OBJDIR)/%$(OBJ_SUFFIX))
PROGRAMS = $(PROGRAM_NAMES:%=$(BINDIR)/%$(EXE_SUFFIX))
# Replacement files currently under development.
# XXX -- Files listed as REPLACEMENT_SOURCES must have $(SRCDIR) prepended!
# i.e. They should look like:
# REPLACEMENT_SOURCES = $(SRCDIR)/my_source.cc
REPLACEMENT_SOURCES = $(SRCDIR)/fill-in.cc
REPLACEMENT_OBJECTS = $(patsubst $(SRCDIR)/%.cc,$(OBJDIR)/%$(OBJ_SUFFIX),\
$(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%$(OBJ_SUFFIX),$(REPLACEMENT_SOURCES)))
# Standard SRILM libraries.
LIBRARIES = \
$(SRILM_LIBDIR)/$(LIB_PREFIX)lm$(LIB_SUFFIX) \
$(SRILM_LIBDIR)/$(LIB_PREFIX)dstruct$(LIB_SUFFIX) \
$(SRILM_LIBDIR)/$(LIB_PREFIX)misc$(LIB_SUFFIX) \
$(ADDITIONAL_LIBRARIES)
# All files variables.
ALL_SOURCES = $(PROGRAM_SOURCES) \
$(REPLACEMENT_SOURCES)
ALL_OBJECTS = $(PROGRAM_OBJECTS) \
$(REPLACEMENT_OBJECTS)
ALL_PROGRAMS = $(PROGRAMS)
ALL_PROGRAM_NAMES = $(PROGRAM_NAMES)
# Define targets.
all: $(PROGRAMS)
$(PROGRAMS): $(REPLACEMENT_OBJECTS) $(LIBRARIES)
$(LINK.cc) $(LD_OUTPUT_OPTION) $(@:$(BINDIR)/%=$(OBJDIR)/%$(OBJ_SUFFIX)) $(REPLACEMENT_OBJECTS) $(LIBRARIES) $(DEMANGLE_FILTER)
# Include common SRILM target definitions.
include $(SRILM)/common/Makefile.common.targets

View File

@@ -0,0 +1,110 @@
#
# File: Makefile.example
# Author: The SRI DECIPHER (TM) System
# Date: Thu Sep 9 12:04:47 1993
#
# Description:
# This is the example makefile to start from when adding new
# modules to the DECIPHER System. To use this makefile, first
# copy it to your directory as the file "Makefile". Second,
# replace the word "Example" in the text below with the real name
# of your library. Next replace the the example filenames with
# the names of your actual declarations and source files in the
# appropriate variable definitions. Finally clean up by deleting
# any lines not relevant to your module and updating this header
# to describe your new module. Do not forget to use the proper
# RCS keywords!
#
# Copyright (c) 1993-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.example,v 1.12 2006/01/09 22:47:37 stolcke Exp $
#
#MACHINE_TYPE := $(shell $(SRILM)/sbin/machine-type)
# Include common SRILM variable definitions.
include $(SRILM)/common/Makefile.common.variables
# Define variables.
# Example Library declarations files.
EXTERNAL_LIB_HEADERS = $(SRCDIR)/example-external.h
INTERNAL_LIB_HEADERS = $(SRCDIR)/example-internal.h
# Example Library source files.
LIB_SOURCES = $(SRCDIR)/example.c
# Example Library object files.
LIB_OBJECTS = $(patsubst $(SRCDIR)/%.cc,$(OBJDIR)/%$(OBJ_SUFFIX),\
$(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%$(OBJ_SUFFIX),$(LIB_SOURCES)))
# Example Library.
LIBRARY = $(OBJDIR)/$(LIB_PREFIX)example$(LIB_SUFFIX)
# Example programs.
PROGRAM_NAMES = example-program
PROGRAMS = $(PROGRAM_NAMES:%=$(BINDIR)/%$(EXE_SUFFIX))
PROGRAM_SOURCES = $(foreach prog,$(PROGRAM_NAMES),\
$(wildcard $(SRCDIR)/$(prog).c) \
$(wildcard $(SRCDIR)/$(prog).cc))
PROGRAM_OBJECTS = $(PROGRAM_NAMES:%=$(OBJDIR)/%$(OBJ_SUFFIX))
# Libraries to be linked with the Example programs.
# (include standard LM and helper libraries)
LIBRARIES = $(LIBRARY) \
-loolm \
-ldstruct \
-lmisc \
$(ADDITIONAL_LIBRARIES)
# All of the types of files.
ALL_HEADERS = $(EXTERNAL_LIB_HEADERS) \
$(INTERNAL_LIB_HEADERS)
ALL_SOURCES = $(LIB_SOURCES) \
$(PROGRAM_SOURCES)
ALL_OBJECTS = $(LIB_OBJECTS) \
$(PROGRAM_OBJECTS)
ALL_LIBRARIES = $(LIBRARY)
ALL_PROGRAMS = $(PROGRAMS)
ALL_PROGRAM_NAMES = $(PROGRAM_NAMES)
# Define pseudo-targets.
# Make sure the library does not get deleted if the make is interrupted.
.PRECIOUS: $(LIBRARY)
# Define targets.
all: $(PROGRAMS)
$(LIBRARY): $(LIB_OBJECTS)
$(ARCHIVE) $(AR_OUTPUT_OPTION) $^ $(DEMANGLE_FILTER)
$(RANLIB) $@ $(DEMANGLE_FILTER)
# Variables and Targets for released system
EXPORTED_HEADERS = $(EXTERNAL_LIB_HEADERS)
EXPORTED_LIBRARIES = $(LIBRARY)
EXPORTED_PROGRAMS = $(PROGRAMS)
release: release-headers release-libraries release-programs
# Include common SRILM target definitions.
include $(SRILM)/common/Makefile.common.targets

View File

@@ -0,0 +1,65 @@
#
# File: Makefile.alpha
# Author: The SRI DECIPHER (TM) System
# Date: Wed Feb 22 10:55:01 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for the DEC alpha.
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.alpha,v 1.8 2003/02/21 22:30:00 stolcke Exp $
#
GCC_FLAGS = -V2.8.1 -mieee-with-inexact -Wreturn-type -Wimplicit
CC = gcc $(GCC_FLAGS)
CXX = g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g3 -O2
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -p -g3 -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
# Note: "-ieee_with_inexact" is much too slow for our purposes, but
# "-ieee_with_no_inexact" gives basically the same numerical
# behavior without being too slow.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
# XXX -- I have not been able to generate non-pageable executables on
# the ALPHAs, using either -n or -nN. ***PSI*** 9-Mar-1994
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation options.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES = -lm
# Tcl support
TCL_INCLUDE = -I/usr/local/include
TCL_LIBRARY = -L/usr/local/lib -ltcl
# Do Alphas require ranlib(1) to be run on libraries?
RANLIB = echo
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -M
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint. Lint flags are useful for the Alpha:
LINT = lint
LINT_FLAGS = -u -wA -Q -Nn10000 -u -DDEBUG $(INCLUDES)

View File

@@ -0,0 +1,96 @@
#
# File: Makefile.machine.amd64-solaris
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:30:10 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for AMD64 running SunOS 5.x (a.k.a. Solaris 2.x).
#
# Copyright (c) 1995-2008 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.amd64-solaris,v 1.7 2012/10/18 20:55:17 mcintyre Exp $
#
ifeq ($(USE_CC), )
# Use the GNU C compiler.
GCC_FLAGS = -march=athlon64 -m64 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O3
else
# Use the Sun C compiler
ACC_PATH = /opt/SUNWspro/bin/
CC = $(ACC_PATH)cc -Xa
CXX = $(ACC_PATH)CC -ptr$(OBJDIR) -ptv
ARCHIVE = $(CXX) $(CXXFLAGS) -xar -o
DEMANGLE_FILTER = 2>&1 | $(ACC_PATH)c++filt
# Optional compilation flags.
OPTIMIZE_FLAGS = -fast -xO2 # -xO4 crashes compiler ...
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O
# keep binaries separate from the default
OPTIMIZE_OPTION = _CC
endif
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lsocket -lnsl -ldl -lpthread
# no 64bit Tcl libraries
NO_TCL = X
TCL_INCLUDE =
TCL_LIBRARY =
# run-time linker path flag
RLD_FLAG = -R
# several tools are in nonstandard place
AR = /usr/ccs/bin/ar
LD = /usr/ccs/bin/ld
# No ranlib -- this is SVR4
RANLIB = :
# Generate dependencies from source files.
ifneq ($(CC), $(subst gcc,,$(CC)))
GEN_DEP = $(CC) $(CFLAGS) -MM
else
GEN_DEP = $(CC) $(CFLAGS) -M
endif
ifneq ($(CXX), $(subst g++,,$(CXX)))
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
else
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -M
endif
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)

View File

@@ -0,0 +1,31 @@
#
# File: Makefile.machine.amd64-solaris_spro
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:30:10 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for Intel running SunOS 5.x (a.k.a. Solaris 2.x)
# using Sun C compiler and AMD 64-bit processor
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.amd64-solaris_spro,v 1.3 2009/06/28 09:04:32 stolcke Exp $
#
include $(SRILM)/common/Makefile.machine.i386-solaris_spro
# Use the Sun Studio compilers
CC = $(ACC_PATH)cc -xarch=amd64
CXX = $(ACC_PATH)CC -ptr$(OBJDIR) -ptv -xarch=amd64
PIC_FLAG = -KPIC
# need to put -xarch after -fast
OPTIMIZE_FLAGS = -g -fast -xO3 -xtarget=opteron -xarch=amd64
# Tcl support not available
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = X

View File

@@ -0,0 +1,23 @@
#
# File: Makefile.machine.android-armeabi
# Author: Mike Frandsen
# Date: 2010/08/03
#
# Description:
# Machine dependent compilation options and variable definitions
# for Android running on ARM
#
# Copyright (c) 1999-2010 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.android-armeabi,v 1.8 2012/08/10 08:29:15 frandsen Exp $
#
# WARNING: Use of both r5b and r6b is triggering missing link errors
# for such things at STL string. Instead, use either:
# android-armeabi-v7a or android-armeabi-v7a-neon
# Now disallow env override to maintain compatibility.
ANDROID_CUST_CFLAGS := -march=armv5te -msoft-float
ANDROID_CUST_DIR := armeabi
include $(SRILM)/common/Makefile.core.android-arm

View File

@@ -0,0 +1,21 @@
#
# File: Makefile.machine.android-armeabi-v7a
# Author: Mike Frandsen
# Date: 2010/08/03
#
# Description:
# Machine dependent compilation options and variable definitions
# for Android on ARM, v7a
#
# Copyright (c) 1999-2010 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.android-armeabi-v7a,v 1.10 2013-07-01 22:26:44 frandsen Exp $
#
# Now disallow env override to maintain compatibility.
# NOTE: For more neon optimizations, use machine variant
# with -neon (uses -mfpu=neon versus vfp).
ANDROID_CUST_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
ANDROID_CUST_DIR := armeabi-v7a
include $(SRILM)/common/Makefile.core.android-arm

View File

@@ -0,0 +1,20 @@
#
# File: Makefile.machine.android-armeabi-v7a-neon
# Author: Mike Frandsen
# Date: 2010/08/03
#
# Description:
# Machine dependent compilation options and variable definitions
# for Android on ARM, v7a (with neon)
#
# Copyright (c) 1999-2010 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.android-armeabi-v7a-neon,v 1.7 2013-07-01 22:26:44 frandsen Exp $
#
# Now disallow env override to maintain compatibility.
# NOTE: uses -mfpu=neon versus vfp
ANDROID_CUST_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon
ANDROID_CUST_DIR := armeabi-v7a
include $(SRILM)/common/Makefile.core.android-arm

View File

@@ -0,0 +1,86 @@
#
# File: Makefile.machine.cygwin
# Author: The SRI DECIPHER (TM) System
# Date: 2002/02/11 08:28:18
#
# Description:
# Machine dependent compilation options and variable definitions
# for CYGWIN/i686 platform
#
# Copyright (c) 1999-2006 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.cygwin,v 1.19 2012/08/01 18:57:14 victor Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -Wall -Wno-unused-variable -Wno-uninitialized
CC = gcc $(GCC_FLAGS) -Wimplicit-int
CXX = g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# avoid gcc warning that all code is PIC
PIC_FLAG =
# suffix used for executable files
EXE_SUFFIX = .exe
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O2
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES = -lm
# UTF16 conversion needs libiconv but can avoid iconv routines
# by building with "make NO_ICONV=anything"
ifeq ($(NO_ICONV), )
SYS_LIBRARIES = -liconv
endif
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (part of cygwin)
TCL_INCLUDE =
TCL_LIBRARY = -ltcl
# No ranlib
RANLIB = :
# Not needed
DEMANGLE_FILTER =
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/gawk
# Location of perl binary
PERL = /usr/bin/perl

View File

@@ -0,0 +1,5 @@
# So far no differences between 32bit and 64bit cygwin builds
include $(SRILM)/common/Makefile.machine.cygwin

View File

@@ -0,0 +1,70 @@
#
# File: Makefile.i686
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for CYGWIN/i686 platform
#
# Copyright (c) 1999-2002 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.freebsd,v 1.3 2006/01/05 20:25:44 stolcke Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -Wreturn-type -Wimplicit -Wimplicit-int
CC = gcc $(GCC_FLAGS)
CXX = g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O2
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES = -lm
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (part of cygwin)
TCL_INCLUDE = -I/usr/local/include/tcl8.3
TCL_LIBRARY = -L/usr/local/lib -ltcl83
# No ranlib
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/gawk

View File

@@ -0,0 +1,95 @@
#
# File: Makefile.machine.i386-solaris
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:30:10 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for Intel running SunOS 5.x (a.k.a. Solaris 2.x).
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i386-solaris,v 1.26 2012/10/18 20:55:17 mcintyre Exp $
#
ifeq ($(USE_CC), )
# Use the GNU C compiler.
GCC_FLAGS = -mtune=pentium3 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
OPTIMIZE_FLAGS = -g -O2 -malign-double
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O2
else
# Use the Sun C compiler
ACC_PATH = /opt/SUNWspro/bin/
CC = $(ACC_PATH)cc -Xa
CXX = $(ACC_PATH)CC -ptr$(OBJDIR) -ptv
ARCHIVE = $(CXX) $(CXXFLAGS) -xar -o
DEMANGLE_FILTER = 2>&1 | $(ACC_PATH)c++filt
# Optional compilation flags.
OPTIMIZE_FLAGS = -fast -xO2 # -xO4 crashes compiler ...
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O
# keep binaries separate from the default
OPTIMIZE_OPTION = _CC
endif
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lsocket -lnsl -ldl -lpthread
# Tcl support
TCL_INCLUDE = -I/usr/sfw/include
TCL_LIBRARY = -L/usr/sfw/lib -R/usr/sfw/lib -ltcl8.3
# run-time linker path flag
RLD_FLAG = -R
# several tools are in nonstandard place
AR = /usr/ccs/bin/ar
LD = /usr/ccs/bin/ld
# No ranlib -- this is SVR4
RANLIB = :
# Generate dependencies from source files.
ifneq ($(CC), $(subst gcc,,$(CC)))
GEN_DEP = $(CC) $(CFLAGS) -MM
else
GEN_DEP = $(CC) $(CFLAGS) -M
endif
ifneq ($(CXX), $(subst g++,,$(CXX)))
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
else
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -M
endif
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)

View File

@@ -0,0 +1,77 @@
#
# File: Makefile.machine.i386-solaris
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:30:10 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for Intel running SunOS 5.x (a.k.a. Solaris 2.x).
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i386-solaris-gcc4,v 1.5 2012/10/18 20:55:17 mcintyre Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -mtune=pentium3 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
OPTIMIZE_FLAGS = -g -O2 -malign-double
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lsocket -lnsl -ldl -lpthread
# Tcl support
TCL_INCLUDE = -I/usr/sfw/include
TCL_LIBRARY = -L/usr/sfw/lib -R/usr/sfw/lib -ltcl8.3
# run-time linker path flag
RLD_FLAG = -R
# several tools are in nonstandard place
AR = /usr/ccs/bin/ar
LD = /usr/ccs/bin/ld
# No ranlib -- this is SVR4
RANLIB = :
# Generate dependencies from source files.
ifneq ($(CC), $(subst gcc,,$(CC)))
GEN_DEP = $(CC) $(CFLAGS) -MM
else
GEN_DEP = $(CC) $(CFLAGS) -M
endif
ifneq ($(CXX), $(subst g++,,$(CXX)))
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
else
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -M
endif
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)

View File

@@ -0,0 +1,72 @@
#
# File: Makefile.machine.i386-solaris
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:30:10 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for Intel running SunOS 5.x (a.k.a. Solaris 2.x).
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i386-solaris_spro,v 1.9 2012/10/18 20:55:17 mcintyre Exp $
#
# Use the Sun Studio compilers
ACC_PATH = /opt/SUNWspro/bin/
CC = $(ACC_PATH)cc -Xa
CXX = $(ACC_PATH)CC -ptr$(OBJDIR) -ptv
PIC_FLAG = -KPIC
ARCHIVE = $(CXX) $(CXXFLAGS) -xar -o
DEMANGLE_FILTER = 2>&1 | $(ACC_PATH)c++filt
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -xchip=pentium4 -fast -xO3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -xO3
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR) -z muldefs
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lsocket -lnsl -ldl -lpthread
# Tcl support
TCL_INCLUDE = -I/usr/sfw/include
TCL_LIBRARY = -L/usr/sfw/lib -R/usr/sfw/lib -ltcl8.3
# run-time linker path flag
RLD_FLAG = -R
# several tools are in nonstandard place
AR = /usr/ccs/bin/ar
LD = /usr/ccs/bin/ld
# No ranlib -- this is SVR4
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -xM1
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -xM1
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)

View File

@@ -0,0 +1,71 @@
#
# File: Makefile.i686
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for Linux/i686 platform
#
# Copyright (c) 1999-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686,v 1.23 2013/02/21 20:08:45 stolcke Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -m32 -mtune=pentium3 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS)
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O3
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS = -fopenmp
ADDITIONAL_CXXFLAGS = -fopenmp
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lpthread
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (standard in Linux)
TCL_INCLUDE =
TCL_LIBRARY = -ltcl
# No ranlib
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/awk
# Location of perl binary
PERL = /usr/bin/perl

View File

@@ -0,0 +1,71 @@
#
# File: Makefile.i686
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for Linux/i686 platform
#
# Copyright (c) 1999-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686-gcc4,v 1.9 2012/10/18 20:55:18 mcintyre Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -mtune=pentium3 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O3
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lpthread
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (standard in Linux)
TCL_INCLUDE =
TCL_LIBRARY = -ltcl
# No ranlib
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/awk
# Location of perl binary
PERL = /usr/bin/perl

View File

@@ -0,0 +1,39 @@
#
# File: Makefile.i686-icc
# Author: A. Stolcke
# Date: Tue Jul 1 07:28:55 PDT 2003
#
# Description:
# Machine dependent compilation options and variable definitions
# for Linux/i686 platform running on Pentium-4 and Xeon using the
# Intel icc compiler.
#
# Copyright (c) 2003 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686-icc,v 1.13 2013/10/22 17:21:53 stolcke Exp $
#
include $(SRILM)/common/Makefile.machine.i686
# Use the Intel C++ compiler.
# Note: -march=pentiumii disables vectorization, which is actually worse
ICC_DIR = /usr/local/lang/intel_cc_80
ICC_FLAGS = -wd654 -wd1125 -wd1224 -tpp7 -march=pentiumpro -Wl,-rpath,$(ICC_DIR)/lib -Wl,-z,muldefs
# For Intel c++ 9.x the following seem to be required
# ICC_DIR = /usr/local/lang/intel_cc_91
# ICC_FLAGS = -gcc-name=/usr/bin/gcc -wd654 -wd1125 -wd1224 -tpp7 -march=pentiumpro -Wl,-rpath,$(ICC_DIR)/lib -Wl,-z,muldefs
# ADDITIONAL_LIBRARIES += -lstdc++ -lcxaguard
CC = $(ICC_DIR)/bin/icc $(ICC_FLAGS)
CXX = $(ICC_DIR)/bin/icc $(ICC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
# Intel compiler (some versions, anyway) allow packing of the Trie structure
# (see dstruct/src/Trie.h)
OPTIMIZE_FLAGS = -g -O3 -DUSE_PACKED_TRIE
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -p -O3 -DUSE_PACKED_TRIE
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =

View File

@@ -0,0 +1,70 @@
#
# File: Makefile.i686
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for Linux/i686 platform
#
# Copyright (c) 1999-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686-m64,v 1.9 2013/02/21 20:08:45 stolcke Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -march=athlon64 -m64 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O3
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS = -fopenmp
ADDITIONAL_CXXFLAGS = -fopenmp
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lpthread
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (standard in Linux)
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = 1
# No ranlib
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/awk

View File

@@ -0,0 +1,46 @@
#
# File: Makefile.i686-m64-icc
# Author: A. Stolcke
# Date: Tue Jul 1 07:28:55 PDT 2003
#
# Description:
# Machine dependent compilation options and variable definitions
# for Linux/x86_64 platform using Intel C++ compiler
#
# Copyright (c) 2006 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686-m64-icc,v 1.5 2013/10/22 17:21:53 stolcke Exp $
#
include $(SRILM)/common/Makefile.machine.i686-m64
# Use the Intel C++ compiler.
# Note: -march=pentiumii disables vectorization, which is actually worse
ICC_FLAGS = -gcc-name=/usr/bin/gcc -wd654 -wd1125 -wd1224 -tpp7 -Wl,-rpath,$(ICC_DIR)/lib -Wl,-z,muldefs
CC = $(ICC_PATH)icc $(ICC_FLAGS)
CXX = $(ICC_PATH)icc $(ICC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
# Intel compiler (some versions, anyway) allow packing of the Trie structure
# (see dstruct/src/Trie.h)
OPTIMIZE_FLAGS = -g -O3 -DUSE_PACKED_TRIE
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -p -O3 -DUSE_PACKED_TRIE
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
ADDITIONAL_LIBRARIES += -lstdc++
# workaround for compiler errors having to do with packed trie structures
NO_OPT_SOURCES = \
NgramStatsShort \
NgramStatsLong \
NgramStatsLongLong \
NgramStatsFloat \
NgramStatsDouble \
NgramStatsXCount \
NgramLM \
LatticeNgrams \
lattice-tool

View File

@@ -0,0 +1,14 @@
#
# File: Makefile.i686
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for RHEL platform
#
# Copyright (c) 1999-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686-m64-rhel,v 1.1 2011/11/02 22:47:58 bwilliams Exp $
#
include $(SRILM)/common/Makefile.machine.i686-m64

View File

@@ -0,0 +1,74 @@
#
# File: Makefile.i686
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for Linux/i686 platform
#
# Copyright (c) 1999-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686-ubuntu,v 1.5 2012/10/18 20:55:18 mcintyre Exp $
#
# Use the GNU C compiler.
GCC_PATH = /usr/bin/
GCC_FLAGS = -march=athlon64 -m64 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS)
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O3
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lpthread
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (standard in Linux)
TCL_INCLUDE =
# TCL_LIBRARY = -ltcl
TCL_LIBRARY =
NO_TCL = X
# No ranlib
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/awk
# Location of perl binary
PERL = /usr/bin/perl

View File

@@ -0,0 +1,72 @@
#
# File: Makefile.machine.i686-ubuntu-32
# Author: The SRI DECIPHER (TM) System
# Date: Tue Jan 25 13:49:15 PST 2011
#
# Description:
# Machine dependent compilation options and variable definitions
# for Ubuntu Linux/i686 platform, forcing 32bit build on 64bit systems
#
# Copyright (c) 1999-2011 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.i686-ubuntu-32,v 1.4 2012/10/18 20:55:18 mcintyre Exp $
#
# Use the GNU C compiler.
GCC_PATH = /usr/bin/
GCC_FLAGS = -m32 -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS)
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O3
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lpthread
# run-time linker path flag
RLD_FLAG = -R
# No Tcl support by default (32bit libraries generally not present)
NO_TCL = X
TCL_LIBRARY =
# No ranlib
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/awk
# Location of perl binary
PERL = /usr/bin/perl

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneOS-5.1-armv7
# Author: Mike Frandsen
# Date: Mon Dec 17, 2012
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneOS
XCODE_SDK_VERSION = 5.1
LOCAL_TARGET_ARCH = armv7
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneOS-6.0-armv7
# Author: Mike Frandsen
# Date: Mon Dec 17, 2012
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneOS
XCODE_SDK_VERSION = 6.0
LOCAL_TARGET_ARCH = armv7
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneOS-6.0-armv7s
# Author: Mike Frandsen
# Date: Mon Dec 17, 2012
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneOS
XCODE_SDK_VERSION = 6.0
LOCAL_TARGET_ARCH = armv7s
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneOS-6.1-armv7
# Author: Mike Frandsen
# Date: Mon Apr 7, 2014
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneOS
XCODE_SDK_VERSION = 6.1
LOCAL_TARGET_ARCH = armv7
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneOS-6.1-armv7s
# Author: Mike Frandsen
# Date: Mon Apr 7, 2014
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneOS
XCODE_SDK_VERSION = 6.1
LOCAL_TARGET_ARCH = armv7s
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneOS-6.1-armv7
# Author: Mike Frandsen
# Date: Mon Apr 7, 2014
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneOS
XCODE_SDK_VERSION = 7.1
LOCAL_TARGET_ARCH = armv7
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneOS-6.1-armv7s
# Author: Mike Frandsen
# Date: Mon Apr 7, 2014
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneOS
XCODE_SDK_VERSION = 7.1
LOCAL_TARGET_ARCH = armv7s
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneSimulator-5.1-i386
# Author: Mike Frandsen
# Date: Mon Dec 17, 2012
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneSimulator
XCODE_SDK_VERSION = 5.1
LOCAL_TARGET_ARCH = i386
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneSimulator-6.0-i386
# Author: Mike Frandsen
# Date: Mon Dec 17, 2012
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneSimulator
XCODE_SDK_VERSION = 6.0
LOCAL_TARGET_ARCH = i386
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneSimulator-6.1-i386
# Author: Mike Frandsen
# Date: Mon Apr 7, 2014
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneSimulator
XCODE_SDK_VERSION = 6.1
LOCAL_TARGET_ARCH = i386
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,16 @@
#
# File: Makefile.machine.iPhoneSimulator-6.1-i386
# Author: Mike Frandsen
# Date: Mon Apr 7, 2014
#
# Description:
# Machine dependent compilation options and variable definitions
# for iOS to be built on a Mac. Relies on import of
# Makefile.core.iOS.
#
LOCAL_PLATFORM_NAME = iPhoneSimulator
XCODE_SDK_VERSION = 7.1
LOCAL_TARGET_ARCH = i386
include $(SRILM)/common/Makefile.core.iOS

View File

@@ -0,0 +1,77 @@
#
# File: Makefile.macosx
# Author: Chuck Wooters
# Date: Mon July 29, 2002
#
# Description:
# Machine dependent compilation options and variable definitions
# for Mac (PowerPCs) running Mac OS X 10.x
#
# Use the GNU C compiler.
GCC_FLAGS = -Wall -Wno-unused-variable -Wno-uninitialized -Wno-overloaded-virtual
CC = cc $(GCC_FLAGS)
CXX = c++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
ARCHIVE = ar cru
RANLIB = ranlib -s
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O2 -fno-common
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O2
# Optional linking flags.
EXPORT_LDFLAGS =
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES) -DHAVE_ZOPEN
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES) -DHAVE_ZOPEN
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES =
# UTF16 conversion needs libiconv but can avoid iconv routines
# by building with "make NO_ICONV=anything"
ifeq ($(NO_ICONV), )
SYS_LIBRARIES = -liconv
endif
# Tcl support (as per Chuck Wooters):
# As of OS X 10.4, MacOS includes Tcl and you can use
TCL_INCLUDE = -I/usr/include
TCL_LIBRARY = -L/usr/lib -ltcl
# However, older OS versions might require that you install tcltk and
# tcltk-dev using 'fink' as in:
# fink install tcltk
# fink install tcltk-dev
# and then use
#TCL_INCLUDE = -I/sw/include
#TCL_LIBRARY = -L/sw/lib -ltcl
SYMBOL_PREFIX = _
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# MacOSX awk is sufficiently compatible with gawk
GAWK = /usr/bin/awk

View File

@@ -0,0 +1,14 @@
#
# File: Makefile.macosx
# Author: Chuck Wooters
# Date: Mon July 29, 2002
#
# Description:
# Machine dependent compilation options and variable definitions
# for Mac (PowerPCs) running Mac OS X 10.x (for 32bit binaries)
#
include $(SRILM)/common/Makefile.machine.macosx
GCC_FLAGS += -m32

View File

@@ -0,0 +1,14 @@
#
# File: Makefile.macosx
# Author: Chuck Wooters
# Date: Mon July 29, 2002
#
# Description:
# Machine dependent compilation options and variable definitions
# for Mac (PowerPCs) running Mac OS X 10.x (for 64bit binaries)
#
include $(SRILM)/common/Makefile.machine.macosx
GCC_FLAGS += -m64

View File

@@ -0,0 +1,73 @@
#
# File: Makefile.mips
# Author: The SRI DECIPHER (TM) System
# Date: Wed Feb 22 10:56:04 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for SGI workstations running IRIX 4.0.5.
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.mips,v 1.8 2003/02/21 22:30:00 stolcke Exp $
#
# SGI C compiler is faster than gcc
CC = cc
CXX = g++ -Wreturn-type -Wimplicit -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g3 -O2
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -p -g3 -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -D__STDC__ -signed -float -Wf,-XNl8192 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = -n $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
# XXX -- added -lsun and -lbsd for networking hostnames. GTC 12/7/92
# XXX -- -lbsd should not be needed. stolcke 1/18/94
ADDITIONAL_LIBRARIES = -lmalloc -lsun -lm
# Tcl support
TCL_INCLUDE = -I/usr/local/include
TCL_LIBRARY = -L/usr/local/lib -ltcl
# SGIs do not use "ranlib".
RANLIB = echo
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -M
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(INCLUDES)
ifneq ($(filter 5.%, $(OS_VERSION)), )
# cross-compiling on IRIX5 systems
CC := SGI_IRIX4=1 $(CC)
CXX := $(CXX) -bmips-sgi-irix4.0.5F
LD = /usr/irix4/usr/bin/ld
AR = /usr/irix4/usr/bin/ar
LINT = TOOLROOT=/usr/irix4 /usr/irix4/usr/bin/lint
endif

View File

@@ -0,0 +1,88 @@
#
# File: Makefile.mips-elf
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:29:29 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for SGI workstations running IRIX 5.x
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.mips-elf,v 1.27 2012/08/02 01:57:44 uid1090 Exp $
#
ifeq ($(USE_CC), )
# all our machines are R4000 (or higher) based, so there is no use
# sticking to the mips1 instruction set
GCC_FLAGS = -mips2 -Wall -Wno-unused-variable -Wno-uninitialized -DNEED_SOCKLEN_T
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
else
# Use the SGI C++ compiler
CC = cc -mips2
CXX = CC -ptused -mips2 -Olimit 2000
PIC_FLAG = -KPIC
# keep binaries separate from the default
OPTIMIZE_OPTION = _CC
endif
# Optional compilation flags.
OPTIMIZE_FLAGS = -g3 -O2
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -p -g3 -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES = -lmalloc -lm
# Not sure if Irix comes with iconv support
NO_ICONV = X
# Tcl support
NO_TCL = X
TCL_INCLUDE =
TCL_LIBRARY =
# run-time linker path flag
RLD_FLAG = -rpath
# SGIs do not use "ranlib".
RANLIB = echo
# suppress lots of duplicate symbol warnings
DEMANGLE_FILTER = 2>&1 | grep -v 'multiply defined' | c++filt
# Generate dependencies from source files.
ifeq ($(USE_CC), )
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
else
GEN_DEP = $(CC) $(CFLAGS) -M
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -M
endif
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(INCLUDES)

View File

@@ -0,0 +1,33 @@
#
# File: Makefile.mips-elf-n32
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:29:29 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for SGI workstations running IRIX 5.x
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.mips-elf-n32,v 1.2 2009/06/28 08:56:21 stolcke Exp $
#
include $(SRILM)/common/Makefile.machine.mips-elf
ifeq ($(USE_CC), )
# all our machines are R4000 (or higher) based, so there is no use
# sticking to the mips1 instruction set
GCC_FLAGS = -Wreturn-type -Wimplicit
CC = $(GCC_PATH)gcc $(GCC_FLAGS) -Wimplicit-int
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
else
# Use the SGI C++ compiler
CC = cc -mips2
CXX = CC -ptused -mips2 -Olimit 2000
# keep binaries separate from the default
OPTIMIZE_OPTION = _CC
endif
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)

View File

@@ -0,0 +1,170 @@
#
# File: Makefile.machine.msvc
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for x86 with Microsoft Visual C platform
#
# Copyright (c) 2005 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.msvc,v 1.16 2013/03/26 02:34:22 stolcke Exp $
#
# Use the MSVC compiler (tested with Visual C++ 2005 Express Edition)
# Note 1: make sure environment is set
#
# PATH should include MSVC_INSTALL_DIR/bin and
# MSVC_INSTALL_DIR/Common7/IDE (for dll search)
# MSVCDIR should be set to MSVC_INSTALL_DIR
# NOTE: Only set by default on VC6 and VS2003; we
# now look for MSVCDir (different capitalization)
# and update MSVCDIR if set.
# INCLUDE should be set to MSVC_INSTALL_DIR/include
# LIB should be set to MSVC_INSTALL_DIR/lib
#
# Note 2: We use MS-style options here although the MSCV tools convert
# -option to /option.
#
# Build with
# make MACHINE_TYPE=msvc
#
# On 1/24/2012, updated variables based on different casing
ifneq ("$(WindowsSdkDir)", "")
WINDOWSSDKDIR=$(WindowsSdkDir)
endif
ifneq ("$(MSVCDir)", "")
MSVCDIR=$(MSVCDir)
endif
# locate the MSVC tools by absolute path. This is the default location
ifeq ("$(MSVCDIR)", "")
ifeq ("$(VCINSTALLDIR)", "")
# Punt, try default location for VS2005
MSVCDIR ?= C:\\Program Files\\Microsoft Visual Studio 8\\VC
else
# VCINSTALLDIR is set so use it (likely VS2005 or VS2008)
MSVCDIR ?= $(VCINSTALLDIR)
endif
endif
MSVC_BIN := "$(shell cygpath '$(MSVCDIR)/bin')"
MSVC_LIB := "$(shell cygpath '$(MSVCDIR)/lib')"
MSC_FLAGS = /DNEED_RAND48 /EHsc /W2 /nologo /wd4996
CC = $(MSVC_BIN)/CL.exe $(MSC_FLAGS)
CXX = $(MSVC_BIN)/CL.exe $(MSC_FLAGS) /DINSTANTIATE_TEMPLATES
AR = $(MSVC_BIN)/LIB.exe /NOLOGO /IGNORE:4006 /IGNORE:4221
ARCHIVE = $(AR)
LINK.c = $(MSVC_BIN)/LINK.exe $(LDFLAGS)
LINK.cc = $(MSVC_BIN)/LINK.exe $(LDFLAGS)
# For Visual Studio 2008, need to find mt.exe in SDK directory
ifeq ("$(WINDOWSSDKDIR)", "")
MSVC_MTEXE := $(MSVC_BIN)/mt.exe
else
MSVC_MTEXE := "$(shell cygpath '$(WINDOWSSDKDIR)/bin/mt.exe')"
endif
POST_LINK = if [ -f $@.manifest ]; then $(MSVC_MTEXE) /manifest $@.manifest /outputresource:$@ ; fi
OUTPUT_OPTION = /Fo$@
LD_OUTPUT_OPTION = /OUT:$@
AR_OUTPUT_OPTION = /OUT:$@
# suffixes used for various files
EXE_SUFFIX = .exe
OBJ_SUFFIX = .obj
LIB_SUFFIX = .lib
LIB_PREFIX =
# Set to /MD for Multithreaded Dll code generation or /MT for Multithreaded
# code generation
MS_CODE_OPTION=/MD
# not applicable
PIC_FLAG =
# Optional compilation flags.
OPTIMIZE_FLAGS = /O2 /DNDEBUG /FD /GS $(MS_CODE_OPTION)
# Or, choose more aggressive optimization:
#OPTIMIZE_FLAGS = /Ox /Og /Ob2 /Oi /Ot /G7 /DNDEBUG /FD /GS $(MS_CODE_OPTION)
DEBUG_FLAGS = /DDEBUG /Od /RTC1 /Zi $(MS_CODE_OPTION)d # /ZI
PROFILE_FLAGS = /O2 /DNDEBUG /FD /GS $(MS_CODE_OPTION)
# Optional linking flags.
EXPORT_LDFLAGS = /RELEASE
DEBUG_LDFLAGS = /DEBUG /OPT:NOICF
PROFILE_LDFLAGS = /MAP
# Linker doesn't want compiler optimization flags
LD_OPTION_FLAGS =
MATHERR_LINK =
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) /LIBPATH:$(SRILM_LIBDIR) /STACK:5000000 /FORCE:MULTIPLE /NOLOGO /IGNORE:4006 /IGNORE:4088 /IGNORE:4221
# Other useful compilation flags.
# Hack to find out if system supports /openmp
OPENMP_FLAG := $(shell [ -f $(MSVC_LIB)/vcomp.lib ] && echo /openmp)
ADDITIONAL_CFLAGS = $(OPENMP_FLAG)
ADDITIONAL_CXXFLAGS = $(OPENMP_FLAG)
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES =
# Libraries we don't want Make to look for
SYS_LIBRARIES = wsock32.lib
# Extra files to remove
EXTRA_REMOVE_PROGRAMS = $(ALL_PROGRAMS:.exe=.map) \
$(ALL_PROGRAMS:.exe=.pdb) \
$(ALL_PROGRAMS:.exe=.exe.manifest)
EXTRA_REMOVE_DEPENDENCIES = vc*.idb
# run-time linker path flag
RLD_FLAG =
# no separate math library needed
MATH_LIBRARY =
LBFGS_LIBRARY = lbfgs.lib
# Tcl support not available
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = X
# No ranlib
RANLIB = :
# prefix of matherr symbol
SYMBOL_PREFIX =
# Not needed
DEMANGLE_FILTER =
# Generate dependencies from source files.
GEN_DEP = gcc $(INCLUDES) -MM
GEN_DEP.cc = g++ $(INCLUDES) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/gawk
PERL = /usr/bin/perl

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2005 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2008
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2005 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2005
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2005 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2005
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2005 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2005
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2008 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2008
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2008 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2008
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2008 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2008
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2008 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2008
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2010 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2010
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2010 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2010
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2010 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2010
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2010 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2010
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2012 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2012
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2012 for x86 platform
include $(SRILM)/common/Makefile.common.msvc-vs2012
include $(SRILM)/common/Makefile.machine.msvc
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2012 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2012
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MD

View File

@@ -0,0 +1,6 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2012 for amd64 platform
include $(SRILM)/common/Makefile.common.msvc-vs2012
include $(SRILM)/common/Makefile.common.msvc64
MS_CODE_OPTION=/MT

View File

@@ -0,0 +1,37 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2010.
# Please first set up your environment for Visual Studio 2010 by running
# the Microsoft .bat setup file:
# "c:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat"
#
# NOTE: The command above may fail if the regedit reg.exe program is not
# in your path as may be the default case on Windows 7. Typically, ensure
# C:\windows\system32 is in your path.
#
# This Makefile is essentially equivalent to running:
# make MACHINE_TYPE=msvc MSVCDir=$VCINSTALLDIR
# or
# make MACHINE_TYPE=msvc MSVCDir="c:\\Program Files\\Microsoft Visual Studio 10.0\\Common7\\Tools\\vsvars32.bat"
# *EXCEPT* will create binaries in "msvc10*" directories instead of "msvc*".
#
# Among others, the following two environment variables should be set:
# VCINSTALLDIR
# WindowsSdkDir (used to locate mt.exe)
# Use this default location unless overridden on command line
MSVCDir ?= C:\\Program Files\\Microsoft Visual Studio 10.0\\VC
# The casing we expect to find for Visual Studio 10 is
# WindowsSdkDir. But, if not set, will fall back on older
# all caps WINDOWSSDKDIR if set, or common default.
ifeq ($(WindowsSdkDir), )
ifeq ($(WINDOWSSDKDIR), )
WindowsSdkDir = C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0A\\
else
WindowsSdkDir = $(WINDOWSSDKDIR)
endif
endif
# Note that Makefile.machine.msvc internally uses
# WINDOWSSDKDIR but will take the value from WindowsSdkDir if set.
include $(SRILM)/common/Makefile.machine.msvc

View File

@@ -0,0 +1,21 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2010 for amd64 platform
# Use this default location unless overridden on command line
MSVCDIR ?= C:\\Program Files\\Microsoft Visual Studio 10.0\\VC
include $(SRILM)/common/Makefile.machine.msvc
# use 64 bit compilers if available or 32 bit cross-compiling binaries
# if not.
MSVC_BIN := "$(shell cygpath '$(MSVCDIR)/bin/amd64')"
ifeq ($(strip $(wildcard "$MSVC_BIN")),)
MSVC_BIN := "$(shell cygpath '$(MSVCDIR)/bin/x86_amd64')"
endif
# 64bit MSVC keeps sizeof(long) = sizeof(int), so tell it to use long long counts
ADDITIONAL_CFLAGS += -DUSE_LONGLONG_COUNTS
ADDITIONAL_CXXFLAGS += -DUSE_LONGLONG_COUNTS
# suppress warnings about info loss in conversion from long long to float/double
MSC_FLAGS += /wd4244

View File

@@ -0,0 +1,37 @@
# Makefile to augment Makefile.machine.msvc for Visual Studio 2008.
# Please first set up your environment for Visual Studio 2008 by running
# the Microsoft .bat setup file:
# "c:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
#
# NOTE: The command above may fail if the regedit reg.exe program is not
# in your path as may be the default case on Windows 7. Typically, ensure
# C:\windows\system32 is in your path.
#
# This Makefile is essentially equivalent to running:
# make MACHINE_TYPE=msvc MSVCDir=$VCINSTALLDIR
# or
# make MACHINE_TYPE=msvc MSVCDir="C:\\Program Files\\Microsoft Visual Studio 9.0\\VC"
# *EXCEPT* will create binaries in "msvc9*" directories instead of "msvc*".
#
# Among others, the following two environment variables should be set:
# VCINSTALLDIR
# WindowsSdkDir (used to locate mt.exe)
# Use this default location unless overridden on command line
MSVCDir ?= C:\\Program Files\\Microsoft Visual Studio 9.0\\VC
# The casing we expect to find for Visual Studio 9 is
# WindowsSdkDir. But, if not set, will fall back on older
# all caps WINDOWSSDKDIR if set, or common default.
ifeq ($(WindowsSdkDir), )
ifeq ($(WINDOWSSDKDIR), )
WindowsSdkDir = C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\
else
WindowsSdkDir = $(WINDOWSSDKDIR)
endif
endif
# Note that Makefile.machine.msvc internally uses
# WINDOWSSDKDIR but will take the value from WindowsSdkDir if set.
include $(SRILM)/common/Makefile.machine.msvc

View File

@@ -0,0 +1,71 @@
#
# File: Makefile.i686
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for Linux/i686 platform
#
# Copyright (c) 1999-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.ppc64,v 1.2 2006/01/05 20:25:44 stolcke Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -Wreturn-type -Wimplicit
CC = gcc $(GCC_FLAGS)
CXX = g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O3
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES = -lm -ldl
# run-time linker path flag
RLD_FLAG = -R
# Tcl support (standard in Linux)
TCL_INCLUDE =
TCL_LIBRARY = -ltcl
# No ranlib
RANLIB = :
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/gawk
# Location of perl binary
PERL = /usr/bin/perl

View File

@@ -0,0 +1,79 @@
#
# File: Makefile.sparc
# Author: The SRI DECIPHER (TM) System
# Date: Wed Feb 22 10:56:52 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for Sun Sparcstations running SunOS 4.1.3
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.sparc,v 1.14 2008/05/21 22:54:18 stolcke Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -Wreturn-type -Wimplicit
CC = gcc $(GCC_FLAGS)
CXX = g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O2
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O2
# Optional linking flags.
EXPORT_LDFLAGS = -static -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES = -lm
# Tcl support
TCL_INCLUDE = -I/usr/local/include
TCL_LIBRARY = -L/usr/local/lib -ltcl
# Suns require ranlib(1) to be run on libraries.
RANLIB = ranlib
# prefix of C language symbols in object symbol tables
SYMBOL_PREFIX = _
PURIFY_FLAGS += -collector=/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/2.8.1/ld
# Generate dependencies from source files.
GEN_DEP = $(CC) $(INCLUDES) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(INCLUDES)
ifneq ($(filter 5.%, $(OS_VERSION)), )
# we're doing cross compiles on a Solaris machines
CC = gcc -bsun4
CXX = g++ -bsun4
LD = /usr/local/sun4/bin/ld
RANLIB = /usr/local/sun4/bin/ranlib
AR = /usr/local/sun4/bin/ar
ADDITIONAL_INCLUDES = -I/home/wimpy-usr/demo/SOUND
ADDITIONAL_LIBRARIES = /home/wimpy-usr/demo/SOUND/libaudio.a -lm
endif

View File

@@ -0,0 +1,97 @@
#
# File: Makefile.sparc-elf
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:30:10 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for Sun Sparcstations running SunOS 5.x (a.k.a. Solaris 2.x).
#
# Copyright (c) 1995-2001 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.sparc-elf,v 1.30 2012/10/19 05:38:47 stolcke Exp $
#
ifeq ($(USE_CC), )
# Use the GNU C compiler.
# XXX: Since most of our fast machines are UltraSPARC based, optimize
# the code for that platform.
GCC_FLAGS = -mtune=ultrasparc -Wall -Wno-unused-variable -Wno-uninitialized
CC = $(GCC_PATH)gcc $(GCC_FLAGS)
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O3
else
# Use the Sun C compiler
CC = $(ACC_PATH)cc -Xa
CXX = $(ACC_PATH)CC -ptr$(OBJDIR) -ptv
ARCHIVE = $(CXX) $(CXXFLAGS) -xar -o
DEMANGLE_FILTER = 2>&1 | $(ACC_PATH)c++filt
# Optional compilation flags.
OPTIMIZE_FLAGS = -fast -xO2 # -xO4 crashes compiler ...
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O
# keep binaries separate from the default
OPTIMIZE_OPTION = _CC
endif
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lsocket -lnsl -ldl -lpthread
# Tcl support
TCL_INCLUDE = -I/usr/sfw/include
TCL_LIBRARY = -L/usr/sfw/lib -R/usr/sfw/lib -ltcl8.3
# run-time linker path flag
RLD_FLAG = -R
# several tools are in nonstandard place
AR = /usr/ccs/bin/ar
LD = /usr/ccs/bin/ld
# No ranlib -- this is SVR4
RANLIB = :
# Generate dependencies from source files.
ifneq ($(CC), $(subst gcc,,$(CC)))
GEN_DEP = $(CC) $(CFLAGS) -MM
else
GEN_DEP = $(CC) $(CFLAGS) -M
endif
ifneq ($(CXX), $(subst g++,,$(CXX)))
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
else
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -M
endif
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)

View File

@@ -0,0 +1,100 @@
#
# File: Makefile.sparc-elf-m64
# Author: The SRI DECIPHER (TM) System
# Date: Fri Mar 3 15:30:10 PST 1995
#
# Description:
# Machine dependent compilation options and variable definitions
# for Sun Sparcstations running SunOS 5.x (a.k.a. Solaris 2.x)
#
# Copyright (c) 2009 SRI International. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.sparc-elf-m64,v 1.5 2012-07-06 23:05:08 stolcke Exp $
#
ifeq ($(USE_CC), )
# Use the GNU C compiler.
# XXX: Since most of our fast machines are UltraSPARC based, optimize
# the code for that platform.
# XXX: WordMesh.cc won't wompile if we specify ultarsparc
GCC_FLAGS = -m64 -mtune=supersparc -Wreturn-type -Wimplicit
CC = $(GCC_PATH)gcc $(GCC_FLAGS)
CXX = $(GCC_PATH)g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O3
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O3
else
# Use the Sun C compiler
CC = $(ACC_PATH)cc -Xa
CXX = $(ACC_PATH)CC -ptr$(OBJDIR) -ptv
ARCHIVE = $(CXX) $(CXXFLAGS) -xar -o
DEMANGLE_FILTER = 2>&1 | $(ACC_PATH)c++filt
# Optional compilation flags.
OPTIMIZE_FLAGS = -fast -xO2 # -xO4 crashes compiler ...
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -pg -g -O
# keep binaries separate from the default
OPTIMIZE_OPTION = _CC
endif
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = -DSVR4 -D_FILE_OFFSET_BITS=64 $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS =
ADDITIONAL_CXXFLAGS =
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
SYS_LIBRARIES = -lsocket -lnsl -ldl
# Tcl support not available for 64bit Solaris
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = 1
# run-time linker path flag
RLD_FLAG = -R
RLD_FLAG =
# several tools are in nonstandard place
AR = /usr/ccs/bin/ar
LD = /usr/ccs/bin/ld
# No ranlib -- this is SVR4
RANLIB = :
# Generate dependencies from source files.
ifneq ($(CC), $(subst gcc,,$(CC)))
GEN_DEP = $(CC) $(CFLAGS) -MM
else
GEN_DEP = $(CC) $(CFLAGS) -M
endif
ifneq ($(CXX), $(subst g++,,$(CXX)))
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
else
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -M
endif
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)

View File

@@ -0,0 +1,86 @@
#
# File: Makefile.machine.win32
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for i686/win32 platform
#
# Copyright (c) 2005 SRI International, 2012 Microsoft Corp. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.win32,v 1.10 2013/02/21 20:08:45 stolcke Exp $
#
# Use the GNU C compiler.
GCC_FLAGS = -DNEED_RAND48 -Wall -Wno-unused-variable -Wno-uninitialized -Wno-format
CC = i686-pc-mingw32-gcc $(GCC_FLAGS) -Wimplicit-int
CXX = i686-pc-mingw32-g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
# avoid gcc warning that all code is PIC
PIC_FLAG =
# suffix used for executable files
EXE_SUFFIX = .exe
# Optional compilation flags.
OPTIMIZE_FLAGS = -g -O2
DEBUG_FLAGS = -g -DDEBUG
PROFILE_FLAGS = -g -pg -O2
# Optional linking flags.
EXPORT_LDFLAGS = -s
# Shared compilation flags.
CFLAGS = $(ADDITIONAL_CFLAGS) $(INCLUDES)
CXXFLAGS = $(ADDITIONAL_CXXFLAGS) $(INCLUDES)
# Shared linking flags.
LDFLAGS = $(ADDITIONAL_LDFLAGS) -L$(SRILM_LIBDIR)
# Other useful compilation flags.
ADDITIONAL_CFLAGS = -fopenmp
ADDITIONAL_CXXFLAGS = -fopenmp
# Other useful include directories.
ADDITIONAL_INCLUDES =
# Other useful linking flags.
ADDITIONAL_LDFLAGS =
# Other useful libraries.
ADDITIONAL_LIBRARIES =
SYS_LIBRARIES = -lwsock32
# run-time linker path flag
RLD_FLAG = -R
# Tcl support not available
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = X
# No ranlib
RANLIB = :
# not using matherr()
MATHERR_LINK =
# Not needed
DEMANGLE_FILTER =
# Generate dependencies from source files.
GEN_DEP = $(CC) $(CFLAGS) -MM
GEN_DEP.cc = $(CXX) $(CXXFLAGS) -MM
# Run lint.
LINT = lint
LINT_FLAGS = -DDEBUG $(CFLAGS)
# Location of gawk binary
GAWK = /usr/bin/gawk
# Location of perl binary
PERL = /usr/bin/perl

View File

@@ -0,0 +1,25 @@
#
# File: Makefile.machine.win64
# Author: The SRI DECIPHER (TM) System
# Date: Fri Feb 19 22:45:31 PST 1999
#
# Description:
# Machine dependent compilation options and variable definitions
# for x86_64/win64 platform
#
# Copyright (c) 2005 SRI International, 2012 Microsoft Corp. All Rights Reserved.
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.machine.win64,v 1.3 2013/02/21 20:08:45 stolcke Exp $
#
include $(SRILM)/common/Makefile.machine.win32
GCC_FLAGS = -DWIN32 -DNEED_RAND48 -Wall -Wno-unused-variable -Wno-uninitialized -Wno-format
CC = COMPILER_PATH=/usr/x86_64-w64-mingw32/bin x86_64-w64-mingw32-gcc $(GCC_FLAGS) -Wimplicit-int
CXX = COMPILER_PATH=/usr/x86_64-w64-mingw32/bin x86_64-w64-mingw32-g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
ADDITIONAL_CFLAGS += -DUSE_LONGLONG_COUNTS
ADDITIONAL_CXXFLAGS += -DUSE_LONGLONG_COUNTS
RANLIB = /usr/x86_64-w64-mingw32/bin/ranlib

View File

@@ -0,0 +1,68 @@
#
# Makefile for SRILM test suite
#
# $Header: /home/srilm/CVS/srilm/common/Makefile.test,v 1.17 2013/03/09 06:54:48 stolcke Exp $
#
include $(SRILM)/common/Makefile.common.variables
TEST=*
all: test
test:
@PATH=$$SRILM/bin/$${MACHINE_TYPE}${OPTION}:$$SRILM/bin:$$PATH; export PATH; \
$(SRILM)/sbin/go.unzip; \
for testdir in tests/$(TEST); do \
[ $$testdir = tests/CVS ] || \
GAWK=$(GAWK) $(SRILM)/sbin/go.run-test $$testdir; \
done
profile:
@PATH=$$PWD/../bin/$${MACHINE_TYPE}_p:$$PWD/../src:$$SRILM/bin/$$MACHINE_TYPE:$$SRILM/bin:$$PATH; export PATH; \
$(SRILM)/sbin/go.unzip; \
for testdir in tests/$(TEST); do \
[ $$testdir = tests/CVS ] || \
GAWK=$(GAWK) $(SRILM)/sbin/go.run-test $$testdir; \
done
pure:
@PATH=$$PWD/../bin/$${MACHINE_TYPE}_pure:$$PWD/../src:$$SRILM/bin/$$MACHINE_TYPE:$$SRILM/bin:$$PATH; export PATH; \
$(SRILM)/sbin/go.unzip; \
for testdir in tests/$(TEST); do \
[ $$testdir = tests/CVS ] || \
GAWK=$(GAWK) $(SRILM)/sbin/go.run-test $$testdir; \
done
try:
@PATH=$$PWD/../bin/$${MACHINE_TYPE}${OPTION}:$$PWD/../src:$$SRILM/bin/$$MACHINE_TYPE:$$SRILM/bin:$$PATH; export PATH; \
echo PATH=$$PATH; \
$(SRILM)/sbin/go.unzip; \
for testdir in tests/$(TEST); do \
[ $$testdir = tests/CVS ] || \
GAWK=$(GAWK) $(SRILM)/sbin/go.run-test $$testdir; \
done
try-output:
@PATH=$$PWD/../bin/$${MACHINE_TYPE}${OPTION}:$$PWD/../src:$$SRILM/bin/$$MACHINE_TYPE:$$SRILM/bin:$$PATH; export PATH; \
echo PATH=$$PATH; \
$(SRILM)/sbin/go.unzip; \
for testdir in tests/$(TEST); do \
[ $$testdir = tests/CVS ] || \
(cd tests/$(TEST); GAWK=$(GAWK) sh -x run-test); \
done
refs:
[ ! -d reference -o -d reference.old ] || mv reference reference.old
mkdir -p reference
@for testdir in tests/$(TEST); do \
[ $$testdir = tests/CVS ] || \
$(SRILM)/sbin/go.update-refs $$testdir; \
done
gzip:
$(SRILM)/sbin/go.zip
clean:
rm -f output/*
find tests \( -name core -o -name gmon.out \) -print | xargs rm -f

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# Run from top-level as:
# common/runmake-msvc MACHTYPE [OPTION=OPT EXTRA_ARGS]
# where can specify MACHTYPE directly or use
# common/Makefile.machine.fullname
# Before running this script, it's assumed that the version of "cl"
# in your path is the intended MSVC compiler to use.
# Usage should be:
# make common/Makefile.machine.*
# or could simply specify machine type as we strip through that part below
if [ "$1" = "" ]; then
echo "Usage: $0 common/Makefile.machine.msvc-{...} [OPTION=_c] [args]"
echo " or: $0 msvc-{...} [OPTION=_c] [args]"
echo "Examples (below with 64 bit vs2012 cl in path):"
echo " $0 msvc-vs2012-64-md-static OPTION=_c clean"
echo " $0 msvc-vs2012-64-md-static OPTION=_c"
exit 1
fi
COMMON_FILE=$1
shift
# This forces SRILM to be a cygwin style path
export SRILM=`pwd`
# Get path to cl compiler both using Cygwin and Windows paths
MYCL_CYG=`which cl`
MYCL_WIN=`cygpath -m "$MYCL_CYG"`
# Set MSVCDIR/Dir variants to use appropriate cl
export MSVCDIR=`echo $MYCL_WIN | sed 's/\([\/\\][vV][cC]\)[\/\\].*/\1/'`
export MSVCDir=$MSVCDIR
# Strip out everything through common/Makefile.machine. to get MACHINE_TYPE
MACH=`echo $COMMON_FILE | sed 's/.*machine[.]//'`
# XXX Here, could sanity check that MSVCDIR and cl match up
make MACHINE_TYPE=$MACH "$@"

View File

@@ -0,0 +1,76 @@
#!/bin/bash
# Usage, from top-level as:
# common/runmake-msvc-all [-p] [extra_args]
# Uses version of "cl" in path to build many target variations,
# currently for VS2012, VS2010 and VS2008.
# Use "-p" option to output what compile commands would be run.
# Other args will be passed along to make. For example:
# common/runmake-msvc-all clean
PRINT_ONLY=0
if [ "$1" = "-p" ]; then
PRINT_ONLY=1
# Pull from args so can pass along any extra options without this
shift
fi
# Get path to cl compiler both using Cygwin and Windows paths
MYCL_CYG=`which cl`
MYCL_WIN=`cygpath -m "$MYCL_CYG"`
# Detect compiler and 32 or 64 bit
expr match "$MYCL_CYG" '.*amd64' > /dev/null
if [ $? = 0 ]; then
BITS=64
else
BITS=32
fi
COMP=unk
expr match "$MYCL_CYG" '.*Studio 11' > /dev/null
if [ $? = 0 ]; then
COMP=vs2012
else
expr match "$MYCL_CYG" '.*Studio 10' > /dev/null
if [ $? = 0 ]; then
COMP=vs2010
else
expr match "$MYCL_CYG" '.*Studio 9' > /dev/null
if [ $? = 0 ]; then
COMP=vs2008
else
expr match "$MYCL_CYG" '.*Studio 8' > /dev/null
if [ $? = 0 ]; then
COMP=vs2005
else
expr match "$MYCL_CYG" '.*2003' > /dev/null
if [ $? = 0 ]; then
COMP=vs2003
fi
fi
fi
fi
fi
SCR="${BASH_SOURCE[0]}"
SCR_DIR=`dirname ${BASH_SOURCE[0]}`
VARIATIONS=""
for CTYPE in md mt; do
for COPT in _c _g; do
CFULL="msvc-${COMP}-${BITS}-${CTYPE}-static"
COPTFULL="OPTION=${COPT}"
VARIATIONS="${VARIATIONS}: ${CFULL} ${COPTFULL}"
echo "$SCR_DIR/runmake-msvc ${CFULL} ${COPTFULL} $@"
if [ $PRINT_ONLY = 0 ]; then
$SCR_DIR/runmake-msvc ${CFULL} ${COPTFULL} "$@"
fi
done
done
if [ $PRINT_ONLY = 0 ]; then
echo "BUILT ${VARIATIONS}"
fi

View File

@@ -0,0 +1,12 @@
This file has been superceded by the "srilm-faq" manual page.
View with
man -M$SRILM/man srilm-faq
or online at
http://www.speech.sri.com/projects/srilm/manpages/srilm-faq.html
Please send corrections and additions to the author.

View File

@@ -0,0 +1,21 @@
Conversion between Decipher PFSG (probabilistic finite state grammars) and
AT&T FSA (finite-state acceptor) formats
1. Convert PFSG to FSA format
pfsg-to-fsm symbolfile=foo.syms foo.pfsg > foo.fsm
2. Compile FSA
fsmcompile foo.fsm > foo.fsmc
3. Operate on FSA, e.g., determinize and minimize
fsmdeterminize foo.fsmc | fsmminimize > foo.min.fsmc
4. Print and convert back to PFSG
fsmprint -i foo.syms foo.min.fsmc | \
fsm-to-pfsg > foo.min.pfsg

View File

@@ -0,0 +1,42 @@
The default Linux Makefile (common/Makefile.machine.i686) uses /usr/bin/gawk
as the gawk interpreter. To ensure correct working in UTF-8 locales run
/usr/bin/gawk --version and make sure it is at least version 3.1.5.
If not, it is recommended to install the latest version of gawk in
/usr/local/bin and update the GAWK variable accordingly.
-----------------------------------------------------------------------------
From: Alex Franz <alex@google.com>
Date: Fri, 06 Oct 2000 16:14:03 PDT
And, here are the details of the malloc problem that I had with the SRI
LM toolkit:
I compiled it with gcc under Redhat Linux V. 6.2 (or thereabouts).
The malloc routine has problems allocating large numbers of
small pieces of memory. For me, it usually refuses to allocate
any more memory once it has allocated about 600 MBytes of memory,
even though the machine has 2 GBytes of real memory.
This causes a problem when you are trying to build language models
with large vocabularies. Even though I used -DUSE_SARRAY_TRIE -DUSE_SARRAY
to use arrays instead of hash tables, it ran out of memory when I was
trying to use very large vocabulary sizes.
The solution that worked for me was to use Wolfram Gloger's ptmalloc package
for memory management instead. You can download it from
http://malloc.de/en/index.html
(The page suggests that it is part of the Gnu C library, but I had to
compile it myself and explicitly link it with the executables.)
One more thing you can do is call the function
mallopt(M_MMAP_MAX, n);
with a sufficiently large n; this tells malloc to allow you to
obtain a large amount of memory.
------------------------------------------------------------------------------

View File

@@ -0,0 +1,50 @@
SRILM version 1.3 and higher has been successfully built and tested using
the CYGWIN environment (http://www.cygwin.com) as of Feb 11, 2002.
The test used CYGWIN DLL 1.3.9 and gcc 2.95.3 (but note the warning
in doc/README.x86 regarding a comiler bug), and ran successfully
on a Windows 98 and a Windows 2000 Professional system.
The following special measures were taken to ensure a successful build:
- Make sure the make, gcc, binutils, libiconv, gzip, tcltk, and gawk packages
are installed with CYGWIN. To run the tests you will also need the
diffutils and time packages.
After installation, set your bash environment as follows
export SRILM=/cygdrive/c/srilm13 # or similar
# do NOT use backslash in path names SRILM=C:\...
export MACHINE_TYPE=cygwin
export PATH=$PATH:$SRILM/bin:$SRILM/bin/cygwin # mentioned in INSTALL
export MANPATH=$MANPATH:$SRILM/man # mentioned in INSTALL
or the equivalent for other shells.
As of version 1.4.5, SRILM can also be built in the MinGW environment
(http://www.mingw.org). For this the default (cygwin) has to be overridden
using
make MACHINE_TYPE=win32
For 64bit binaries use
make MACHINE_TYPE=win64
Of course the corresponding versions of the MinGW development environment
(C, C++, binutils) have to be installed in Cygwin. Make sure the Cygwin
installation is generally up-to-date.
It may be necessary to include the following directories in the PATH
environment variable for the runtime dynamic libraries to be found:
/usr/i686-pc-mingw32/sys-root/mingw/bin (win32)
/usr/x86_64-w64-mingw32/sys-root/mingw/bin (win64)
Some functionality is not supported under MinGW:
- compressed file I/O
- nbest-optimize and lattice-tool -max-time option
A. Stolcke
$Id: README.windows-cygwin,v 1.10 2013/01/31 18:03:33 stolcke Exp $

View File

@@ -0,0 +1,63 @@
Recommendations for compiling with Microsoft Visual C++
The build procedure has been tested with the freely available
Visual C++ 8 that can be downloaded from www.microsoft.com as
"Visual C++ 2005 Express Edition".
0) Install the cygwin environment, as described in README.windows-cygwin .
Cygwin tools are needed to run the build process and generate program
dependencies.
1) SRILM can be set to the cygwin path of the SRILM root directory
(e.g., /home/username/srilm)
2) Make sure environment variables are set to locate MSVC tools and files:
PATH should include MSVC_INSTALL_DIR/bin and
MSVC_INSTALL_DIR/Common7/IDE (for dll search)
MSVCDIR should be set to MSVC_INSTALL_DIR
INCLUDE should be set to MSVC_INSTALL_DIR/include
LIB should be set to MSVC_INSTALL_DIR/lib
Note: PATH needs to use cygwin pathname conventions, but MSVCDIR,
INCLUDE and LIB must use Windows paths. For example:
PATH="/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC/bin:/cygdrive/c/Program Files/Microsoft Visual Studio 8/Common7/IDE:$PATH"
MSVCDIR="c:\\Program Files\\Microsoft Visual Studio 8\\VC"
INCLUDE="$MSVCDIR\\include"
LIB="$MSVCDIR\\lib"
export PATH MSVCDIR INCLUDE LIB
could be used in bash given the default installation location of Visual
C++ 2005 Express Edition under c:\Program Files\Microsoft Visual Studio 8.
Alternatively, you could use the vcvars32.bat script that comes with
MSVC to set these environment variables.
3) Build in a cygwin shell with
make MACHINE_TYPE=msvc
or
make MACHINE_TYPE=msvc64
to generate 64bit binaries.
As with MinGW, some functionality is not supported:
- compressed file I/O other than gzip files
- nbest-optimize and lattice-tool -max-time option
Also note that make will try to determine if certain libraries
are installed on your system and enable the /openmp option if so.
This means that binaries built with the full Visual Studio compiler
might not run on systems that have only Visual Studio Express.
To avoid this disable /openmp by commenting out the corresponding
line containing "/openmp" in common/Makefile.machine.msvc.
4) Run test suite with
cd test
make MACHINE_TYPE=msvc try

View File

@@ -0,0 +1,71 @@
Recommendations for compiling with Microsoft Visual Studio 2005.
Microsoft Visual Studio projects are available for Microsoft Visual
Studio 2005.
The advantages of building directly in Visual Studio are:
- Build is faster.
- Integrated debugging.
- Library projects can be included as dependencies of your own projects.
The disadvantages of building directly in Visual Studio are:
- Not all parts of the SRILM build process can be completed inside Visual Studio.
- More cumbersome to build from command line.
The build procedure has been tested with the Visual Studio 2005
Professional.
0) Open SRILM/visual_studio/vs2005/srilm.sln in Visual Studio 2005.
1) Select either the "Release" or "Debug" targets.
2) Build the solution. The libraries will be built into
SRILM/lib/Release or SRILM/lib/Debug, and the executables will be built
into SRILM/bin/Release or SRILM/bin/Debug.
This procedure will NOT produce the central include directory, release
the SRILM scripts, or build the test environment.
To produce the central include directory or release the SRILM scripts,
you will have install the cygwin environment and use the included
Makefiles as described in (3):
(3) Follow steps (0) and (1) from README.windows-msvc:
(3a) Install the cygwin environment, as described in README.windows-cygwin.
Cygwin tools are needed to run the build process and generate program
dependencies.
(3b) SRILM can be set to the cygwin path of the SRILM root directory
(e.g., /home/username/srilm, /cygdrive/c/SRILM)
(3c) To produce the central include directory and release the SRILM
scripts, do either:
% make MACHINE_TYPE=msvc dirs
% make MACHINE_TYPE=msvc init
% make MACHINE_TYPE=msvc release-headers
% make MACHINE_TYPE=msvc release-scripts
% cd utils/src; make MACHINE_TYPE=msvc release
or
% make MACHINE_TYPE=msvc msvc
If you want to run the SRILM tests, you will have to follow the full
instructions in README.windows-msvc.
If you want to compile using a different version of MSVC, I suggest
creating a new subdirectory of SRILM/visual_studio, e.g.,
"SRILM/visual_studio/vs2010", and copying the contents of the "vs2005"
directory into your new directory. Then use MSVC to update your
projects. If you need to downgrade to MSVC 2003, it is possible to do
this by manually editing the project files.
I would like to thank Keith Vertanen (http://www.keithv.com) for
contributing the original versions of these Microsoft Visual Studio
projects to SRILM.
Victor Abrash
victor@speech.sri.com

View File

@@ -0,0 +1,21 @@
Note for Intel x86 platforms:
The function KneserNey::lowerOrderWeight() seems to trigger a compiler
bug in gcc 2.95.3 with optimization, on the i686-pc-linux-gnu,
i386-pc-solaris2, and i686-pc-cygwin platforms (and therefore probably
on all Intel targets). The problem manifests itself by the
"ngram-count-kn-int" test in the test/ directory not terminating.
To work around this problem, compile lm/src/Discount.cc without global
optimization:
cd $SRILM/lm/src
rm ../obj/$MACHINE_TYPE/Discount.o
gnumake OPTIMIZE_FLAGS=-O1 ngram-count
gnumake release
As of Feb 2002, Cygwin ships with gcc 2.95.3 and therefore suffers from
this bug. gcc 2.95.2 or lower and gcc 3.x versions of the compiler
don't seem to be affected, though.

View File

@@ -0,0 +1,9 @@
compute local entropies, stddev in perplexity output
implement TaggedNgram backoff-weight computation
fix some cases of back-to-back DFs
FP-REP2
general mechanism to skip words in ngram contexts, handle non-event tags.

View File

@@ -0,0 +1,47 @@
C++ porting notes
-----------------
I originally wrote this code using gcc/g++ as the compiler.
Below is a list of changes I had to make to accomodate SGI, Sun and Intel C++
compilers.
o Explicitly instantiate templates only in g++ (#ifdef __GNUG__).
o Avoid global static data referenced by template code. These symbols
become undefined in the instantiated template functions.
I use local static data, or global extern data instead (the latter
#ifndef __GNUG__).
o Avoid non-static inline functions in templates (.cc files). They
don't get properly instantiated by Sun CC and result in undefined
symbols.
o Use Sun CC -xar option to build libraries. This includes needed
template instances in the library (see the new $(ARCHIVE) macro to
refer to the appropriate archive command).
o To work around an internal compiler error in gcc 2.7.2, I had to
add empty destructors in a few classes. Howver, I no longer use gcc 2.7.2
in testing, so current version are no longer guaranteed to work with it.
o Intel C++ doesn't support arrays of non-POD objects on the stack. I had
to replace those with matching calls to new/delete.
Compilers that work
-------------------
(as of last checking, meaning current versions may not work out of the box)
+ gcc/g++ 2.8.1, 2.95.3, 3.2 and 3.3
+ Sun SC4.0
+ SGI NCC
+ Intel C++ 7.1
Compilers that don't work on this code
--------------------------------------
- Sun SC3.0.1
- CenterLine (Sun version, as of 6/96)

View File

@@ -0,0 +1,184 @@
SRI Object-oriented Language Modeling Libraries and Tools
BUILD AND INSTALL
See the INSTALL file in the top-level directory.
FILES
All mixed-case .cc and .h files contain C++ code for the liboolm
library.
All lower-case .cc files in this directory correspond to executable commands.
Each program is option driven. The -help option prints a list of
available options and their meaning.
N-GRAM MODELS
Here we only cover arbitary-order n-grams (no classes yet, sorry).
ngram-count manipulates n-gram counts and
estimates backoff models
ngram-merge merges count files (only needed for large
corpora/vocabularies)
ngram computes probabilities given a backoff model
(also does mixing of backoff models)
Below are some typical command lines.
NGRAM COUNT MANIPULATION
ngram-count -order 4 -text corpus -write corpus.ngrams
Counts all n-grams up to length 4 in corpus and writes them to
corpus.ngrams. The default n-gram order (if not specified) is 3.
ngram-count -vocab 30k.vocab -order 4 -text corpus -write corpus.ngrams
Same, but restricts the vocabulary to what is listed in 30k.vocab
(one word per line). Other words are replaced with the <unk> token.
ngram-count -read corpus.ngrams -vocab 20k.vocab -write-order 3 \
-write corpus.20k.3grams
Reads the counts from corpus.ngrams, maps them to the indicated
vocabulary, and writes only the trigrams back to a file.
ngram-count -text corpus -write1 corpus.1grams -write2 corpus.2grams \
-write3 corpus.3grams
writes unigrams, bigrams, and trigrams to separate files, in one
pass. Usually there is no reason to keep these separate, which is
why by default ngrams of all lengths are written out together.
The -recompute flag will regenerate the lower-order counts from the
highest order one by summation by prefixes.
The -read and -text options are additive, and can be used to merge
new counts with old. Furthermore, repeated n-grams read with -read
are also additive. Thus,
cat counts1 counts2 ... | ngram-count -read -
will merge the counts from counts1, counts2, ...
All file reading and writing uses the zio routines, so argument "-"
stands for stdin/stdout, and .Z and .gz files are handled correctly.
For very large count files (due to large corpus/vocabulary) this
method of merging counts in-memory is not suitable. Alternatively,
counts can sorted and then merged.
First, generate counts for portions of the training corpus and
save them with -sort:
ngram-count -text part1.text -sort -write part1.ngrams.Z
ngram-count -text part2.text -sort -write part2.ngrams.Z
Then combine these with
ngram-merge part?.ngrams.Z > all.ngrams.Z
(Although ngram-merge can deal with any number of files >= 2 ,
it is most efficient to combined two parts at a time, then
from the resulting new count files, again two at a time, using
a binary tree merging scheme.)
BACKOFF MODEL ESTIMATION
ngram-count -order 2 -read corpus.counts -lm corpus.bo
generates a bigram backoff model in ARPA (aka Doug Paul) format
from corpus.counts and writes is to corpus.bo.
If counts fit into memory (and hence there is no reason for the
merging schemes described above) it is more convenient and faster
to go directly from training text to model:
ngram-count -text corpus -lm corpus.bo
The built-in discounting method used in building backoff models
is Good Turing. The lower exclusion cutoffs can be set with
options (-gt1min ... -gt6min), the upper discounting cutoffs are
selected with -gt1max ... -gt6max. Reasonable defaults are
provided that can be displayed as part of the -help output.
When using limited vocabularies it is recommended to compute the
discount coeffiecients on the unlimited vocabulary (at least for
the unigrams) and then apply them to the limited vocabulary
(otherwise the vocabulary truncation would produce badly skewed
counts frequencies at the low end that would break the GT algorithm.)
For this reason, discounting parameters can be saved to files and
read back in.
For example
ngram-count -text corpus -gt1 gt1.params -gt2 gt2.params \
-gt3 gt3.params
saves the discounting parameters for unigrams, bigrams and trigams
in the files as indicated. These are short files that can be
edited, e.g., to adjust the lower and upper discounting cutoffs.
Then the limited vocabulary backoff model is estimated using these
saved parameters
ngram-count -text corpus -vocab 20k.vocab \
-gt1 gt1.params -gt2 gt2.params gt3.params -lm corpus.20k.bo
MODEL EVALUATION
The ngram program uses a backoff model to compute probabilities and
perplexity on test data.
ngram -lm some.bo -ppl test.corpus
computes the perplexity on test.corpus according to model some.bo.
The flag -debug controls the amount of information output:
-debug 0 only overall statistics
-debug 1 statistics for each test sentence
-debug 2 probabilities for each word
-debug 3 verify that word probabilities over the
entire vocabulary sum to 1 for each context
ngram also understands the -order flag to set the maximum ngram
order effectively used by the model. The default is 3.
It has to be explicitly reset to use ngrams of higher order, even
if the file specified with -lm contains higher order ngrams.
The flag -skipoovs establishes compatibility with broken behavior
in some old software. It should only be used with bo model files
produced with the old tools. It will
- let OOVs be counted as such even when the model has a probability
for <unk>
- skip not just the OOV but the entire n-gram context in which any
OOVs occur (instead of backing off on OOV contexts).
OTHER MODEL OPERATIONS
ngram performs a few other operations on backoff models.
ngram -lm bo1 -mix-lm bo2 -lambda 0.2 -write-lm bo3
produces a new model in bo3 that is the interpolation of bo1 and bo2
with a weight of 0.2 (for bo1).
ngram -lm bo -renorm -write-lm bo.new
recomputes the backoff weights in the model bo (thus normalizing
probabilities to 1) and leaves the result in bo.new.
API FOR LANGUAGE MODELS
These programs are just examples of how to use the object-oriented
language model library currently under construction. To use the API
one would have to read the various .h files and how the interfaces
are used in the example progams. No comprehensive documentation is
available as yet. Sorry.
AVAILABILITY
This code is Copyright SRI International, but is available free of
charge for non-profit use. See the License file in the top-level
direcory for the terms of use.
Andreas Stolcke
$Date: 1999/07/31 18:48:33 $

View File

@@ -0,0 +1,12 @@
size of ngram reading Switchboard trigram
SunOS5.5.1 libc malloc 12M
-lmalloc 12M
IRIX5.1 libc malloc 12M
-lmalloc MX_FAST = 24 11M
MX_FAST = 10 12M
MX_FAST = 32 11M

View File

@@ -0,0 +1,115 @@
NEW SRI-LM LIBRARY AND TOOLS -- OVERVIEW
Design Goals
- coverage of state-of-the-art LM methods
- extensible vehicle for LM research
- code reusability
- tool versatility
- speed
Implementation language: C++ (GNU compiler)
LM CLASS HIERARCHY
LM
Ngram -- arbitrary-order N-gram backoff models
DFNgram -- N-grams including disfluency model
VarNgram -- variable-order N-grams
TaggedNgram -- word/tag N-grams
CacheLM -- unigram from recent history
DynamicLM -- changes as a function of external info
BayesMix -- mixture of LMs with contextual adaptation
OTHER CLASSES
Vocab -- word string/index mapping
TaggedVocab -- same for word/tag pairs
LMStats -- statistics for LM estimation
NgramStats -- N-gram counts
TaggedNgramStats -- word/tag N-gram counts
Discount -- backoff probality discounting
GoodTuring -- standard
ConstDiscount -- Ney's method
NaturalDiscount -- Ristad's method
HELPER LIBRARIES
libdstruct -- template data structures
Array -- self-extending arrays
Map
SArray -- sorted arrays
LHash -- linear hash tables
Trie -- index trees (based on a Map type)
MemStats -- memory usage tracking
libmisc -- convenience functions:
option parsing,
compressed file i/o,
object debugging
TOOLS
ngram-count -- N-gram counting and model estimation
ngram-merge -- N-gram count merging
ngram -- N-gram model scoring, perplexity,
sentence generation, mixing and
interpolation
LM INTERFACE
LogP wordProb(VocabIndex word, const VocabIndex *context)
LogP wordProb(VocabString word, const VocabString *context)
LogP sentenceProb(const VocabIndex *sentence, TextStats &stats)
LogP sentenceProb(const VocabString *sentence, TextStats &stats)
unsigned pplFile(File &file, TextStats &stats, const char *escapeString = 0)
setState(const char *state);
wordProbSum(const VocabIndex *context)
VocabIndex generateWord(const VocabIndex *context)
VocabIndex *generateSentence(unsigned maxWords, VocabIndex *sentence)
VocabString *generateSentence(unsigned maxWords, VocabString *sentence)
Boolean isNonWord(VocabIndex word)
Boolean read(File &file);
void write(File &file);
EXTENSIBILITY/REUSABILITY
THINGS TO DO
- Node array interface
- General interpolated LMs
- LM "shell" for interactive model manipulation and use (Tcl based)

Some files were not shown because too many files have changed in this diff Show More