Commit 3b6f39eb authored by Giulio Paci's avatar Giulio Paci

Imported Upstream version 0.33

parents
Taku Kudo <taku-ku@is.aist-nara.ac.jp>
This diff is collapsed.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
# Process this file with automake to produce Makefile.in
#
# $Id: Makefile.am,v 1.34 2005/09/05 14:50:59 taku Exp $;
#
@SET_MAKE@
AUTOMAKE_OPTIONS = 1.4 no-dependencies
SUBDIRS = src libexec training tests man doc
EXTRA_DIR = perl ruby python swig example
EXTRA_DIST = training/Makefile.in yamcha.spec
bin_SCRIPTS = yamcha-config
dist-hook:
for subdir in $(EXTRA_DIR); do \
cp -rp $$subdir $(distdir); \
rm -f $(distdir)/$$subdir/*~; \
rm -f $(distdir)/$$subdir/*.{bak,orig}; \
rm -rf $(distdir)/$$subdir/CVS; \
rm -rf $(distdir)/$$subdir/*/CVS; \
done
rpm: dist
env PATH="/usr/bin:$$PATH" rpmbuild -ta @PACKAGE@-@VERSION@.tar.gz
win:
(cd src; wcmd /c make.bat)
win-dist:
rm -fr @PACKAGE@-@VERSION@.zip @PACKAGE@-@VERSION@
mkdir -p @PACKAGE@-@VERSION@/bin
mkdir -p @PACKAGE@-@VERSION@/doc
mkdir -p @PACKAGE@-@VERSION@/sdk
mkdir -p @PACKAGE@-@VERSION@/libexec/yamcha
cp -f example/example.cpp @PACKAGE@-@VERSION@/example
cp -f libexec/mkmodel @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/mkdarts.exe @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/mktrie.exe @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/pkemine.exe @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/mksvmdata @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/svm_learn_wrapper @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/mkparam @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/showse @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/zipmodel @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/selecttag @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/PKI.pm @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/PKE.pm @PACKAGE@-@VERSION@/libexec/yamcha
cp -f libexec/Makefile @PACKAGE@-@VERSION@/libexec/yamcha
cp -f src/libyamcha.lib @PACKAGE@-@VERSION@/sdk
cp -f example/*.cpp @PACKAGE@-@VERSION@/sdk
cp -f src/libyamcha.dll @PACKAGE@-@VERSION@/bin
cp -f src/yamcha.h @PACKAGE@-@VERSION@/sdk
cp -f src/yamcha.exe @PACKAGE@-@VERSION@/bin
cp -f doc/*.html doc/*.css @PACKAGE@-@VERSION@/doc
cp -f README COPYING AUTHORS @PACKAGE@-@VERSION@
zip -r @PACKAGE@-@VERSION@.zip @PACKAGE@-@VERSION@
rm -fr @PACKAGE@-@VERSION@
script-clean:
(cd perl; $(MAKE) clean; rm -f Makefile.old Makefile.PL Makefile)
(cd ruby; $(MAKE) clean; rm -f Makefile *.log extconf.rb)
(cd python; $(MAKE) clean; rm -f build setup.py)
install-exec-local:
(cd $(DESTDIR)@prefix@/bin; @LN_S@ -f ../libexec/yamcha/mkmodel yamcha-mkmodel)
uninstall-local:
rm -f $(DESTDIR)@prefix@/bin/yamcha-mkmodel
dist-all-package:
(test -f Makefile) && $(MAKE) script-clean distclean
./configure
$(MAKE) dist
$(MAKE) clean
$(MAKE) win
$(MAKE) win-dist
export-package:
scp yamcha-@VERSION@.tar.gz chasen.org:public_html/software/yamcha/src
scp yamcha-@VERSION@.zip chasen.org:public_html/software/yamcha/win
scp doc/*.html chasen.org:public_html/software/yamcha/
# scp ~/.rpm/SRPMS/yamcha-@VERSION@*.src.rpm chasen.org:public_html/software/yamcha/redhat-9.x/SRPMS/
# scp ~/.rpm/RPMS/i386/yamcha-*@VERSION@*.i386.rpm chasen.org:public_html/software/yamcha/redhat-9.x/RPMS/i386/
This diff is collapsed.
See doc/index.html
#ifndef _ACCONFIG_H
#define _ACCONFIG_H 1
#undef HAVE_CXX_STD_NAMESPACE
#undef HAVE_CXX_NAMESPACE
#undef MODEL_VERSION
#endif /* _ACCONFIG_H */
This diff is collapsed.
This diff is collapsed.
/* config.h.in. Generated from configure.in by autoheader. */
#ifndef _ACCONFIG_H
#define _ACCONFIG_H 1
#undef HAVE_CXX_STD_NAMESPACE
#undef HAVE_CXX_NAMESPACE
#undef MODEL_VERSION
#endif /* _ACCONFIG_H */
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* stdnamespace */
#undef HAVE_CXX_STD_NAMESPACE
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/times.h> header file. */
#undef HAVE_SYS_TIMES_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
/* model verson */
#undef MODEL_VERSION
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
This diff is collapsed.
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/yamcha.cpp)
AM_INIT_AUTOMAKE(yamcha, 0.33)
AC_DEFINE(MODEL_VERSION, 0.4, [model verson])
MODEL_VERSION=0.4
AC_SUBST(MODEL_VERSION)
# Before making a release, the LTVERSION string should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
# been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
# change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A
LTVERSION="3:0:2"
AC_SUBST(LTVERSION)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_GCC_TRADITIONAL
AC_PROG_MAKE_SET
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_ISC_POSIX
AC_CYGWIN
AC_LANG_CPLUSPLUS
AC_LANG(C)
dnl Checks for header files.
AC_HEADER_STDC
AC_TYPE_SIZE_T
AC_CHECK_HEADERS(string.h stdlib.h unistd.h fcntl.h \
math.h ctype.h sys/types.h sys/stat.h sys/mman.h \
sys/times.h windows.h)
AC_CHECK_FUNCS(mmap)
AC_CHECK_LIB(m, pow, M_LIBS="-lm")
AC_CHECK_LIB(stdc++, main, STDCPP_LIBS="-lstdc++")
AC_LANG(C++)
LIBS="$LIBS $M_LIBS $STDCPP_LIBS"
YAMCHA_LIBS="$LIBS"
AC_SUBST(YAMCHA_LIBS)
dnl
dnl Check for GNU make
dnl
AC_MSG_CHECKING(whether make is GNU Make)
if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
if test "$host_vendor" = "sun" ; then
AC_MSG_ERROR("SUN make does not work for building TinySVM. Please install GNU make")
fi
fi
dnl
dnl check gcc
dnl
if test -n "$GCC"; then
CFLAGS="-O3 -Wno-deprecated -Wall"
CXXFLAGS="-O3 -Wno-deprecated -Wall"
fi
dnl
dnl check C++ features
dnl
AC_DEFUN(CHECK_CXX_STL, [
AC_MSG_CHECKING(if ${CXX-c++} supports stl <$1> (required))
AC_TRY_COMPILE(
[
#include <$1>
], [
;
], [
ac_stl_$1=yes
], [
config_error=yes
AC_WARN(${CXX-c++} stl <$1> does not work)
])
AC_MSG_RESULT([$ac_stl_$1])
])
dnl Checks extra packages
AC_ARG_WITH(
perl5,
[ --with-perl5=PATH set perl 5.004 or later location [search path]],
AC_MSG_RESULT(using $with_perl5 for perl5)
PERL=$with_perl5,
[AC_PATH_PROGS(PERL, perl5 perl, no)]
)
if test $PERL = "no" || $PERL -e 'exit ($] >= 5.004)';
then
AC_MSG_ERROR(perl 5.004 or later required)
fi
AC_SUBST(PERL)
AC_ARG_WITH(
svm-learn,
[ --with-svm-learn=PATH set svm_learn (TinySVM or SVM^light) location [search path]],
AC_MSG_RESULT(using $with_svm_learn for svm_learn)
SVM_LEARN=$with_svm_learn,
[AC_PATH_PROGS(SVM_LEARN, svm_learn, no)]
)
if test $SVM_LEARN = "no";
then
AC_MSG_ERROR(svm_learn (TinySVM or SVM^light) required for training)
fi
AC_SUBST(SVM_LEARN)
AC_PATH_PROG(GZIP,gzip,no)
if test $GZIP = "no";
then
AC_MSG_ERROR(gzip required for training)
fi
AC_SUBST(GZIP)
CHECK_CXX_STL(vector)
CHECK_CXX_STL(map)
CHECK_CXX_STL(functional)
CHECK_CXX_STL(algorithm)
CHECK_CXX_STL(string)
CHECK_CXX_STL(set)
CHECK_CXX_STL(iostream)
CHECK_CXX_STL(strstream)
CHECK_CXX_STL(fstream)
CHECK_CXX_STL(iterator)
CHECK_CXX_STL(stdexcept)
# check for const_cast
AC_MSG_CHECKING([if ${CXX-c++} supports template <class T> (required)])
AC_TRY_COMPILE(
[
template <class T> T foo (T &i) { return i++; };
],[
int i = 0;
double d = 0.0;
foo(i); foo(d);
],[
ac_template=yes
],[
AC_WARN(${CXX-c++} template <class T> does not work)
config_error=yes
])
AC_MSG_RESULT([$ac_template])
# check for const_cast
AC_MSG_CHECKING([if ${CXX-c++} supports const_cast<> (required)])
AC_TRY_COMPILE(
[
class foo;
],[
const foo *c=0;
foo *c1=const_cast<foo*>(c);
],[
ac_const_cast=yes
],[
AC_WARN(${CXX-c++} const_cast<> does not work)
config_error=yes
])
AC_MSG_RESULT([$ac_const_cast])
# check for static_cast<>
AC_MSG_CHECKING(if ${CXX-c++} supports static_cast<> (required))
AC_TRY_COMPILE(
[
class foo;
],[
foo *c = 0;
void *c1 = static_cast<void *>(c);
],[
ac_static_cast=yes
],[
AC_WARN(${CXX-c++} static_cast<> does not work)
config_error=yes
])
AC_MSG_RESULT([$ac_static_cast])
# check for dynamic_cast<>
AC_MSG_CHECKING(if ${CXX-c++} supports dynamic_cast<> (required))
AC_TRY_COMPILE(
[
class foo {};
class bar: public foo {};
],[
bar *c = 0;
foo *c1 = dynamic_cast<foo *>(c);
],[
ac_dynamic_cast=yes
],[
AC_WARN(${CXX-c++} dynamic_cast<> does not work)
config_error=yes
])
AC_MSG_RESULT([$ac_dynamic_cast])
# check for reinterpret_cast
AC_MSG_CHECKING(if ${CXX-c++} supports reinterpret_cast<> (required))
AC_TRY_COMPILE(
[
int *a = 0;
],[
char *p = reinterpret_cast<char *>(a);
],[
ac_reinterpret_cast=yes
],[
AC_WARN(${CXX-c++} reinterpret_cast<> does not work)
config_error=yes
])
AC_MSG_RESULT([$ac_reinterpret_cast])
# check for try
AC_MSG_CHECKING(if ${CXX-c++} supports exception handler (required))
AC_TRY_COMPILE(
[
;
],[
try {
int i = 0;
}
catch (char *e) {
}
catch (...) {
}
],[
ac_exception=yes
],[
AC_WARN(${CXX-c++} exception does not work)
config_error=yes
])
AC_MSG_RESULT([$ac_exception])
# check for namespaces
AC_MSG_CHECKING(if ${CXX-c++} supports namespaces (required) )
AC_TRY_COMPILE(
[
namespace Foo { struct A {}; }
using namespace Foo;
],[
A a;
],[
ac_namespaces=yes
dnl AC_DEFINE(HAVE_CXX_NAMESPACE)
],[
config_error=yes
ac_namespaces=no
])
AC_MSG_RESULT([$ac_namespaces])
# namespace
if test "x$ac_namespaces" = xyes ; then
AC_MSG_CHECKING(if ${CXX-c++} uses std namespace )
AC_TRY_COMPILE(
[
#include <iostream>
namespace std{}
using namespace std;
],[
cout << "test" << endl;
],[
ac_std_namespace=yes
AC_DEFINE(HAVE_CXX_STD_NAMESPACE, 1, [namespace] )
],[
ac_std_namespace=maybe
])
# std namespace
if test "x$ac_std_namespace" = xmaybe ; then
AC_TRY_COMPILE(
[
#include <iostream.h>
namespace std{}
using namespace std;
],[
cout << "test" << endl;
],[
ac_std_namespace=yes
AC_DEFINE(HAVE_CXX_STD_NAMESPACE, 1, [stdnamespace])
],[
ac_std_namespace=no
])
fi
AC_MSG_RESULT([$ac_std_namespace])
fi
AC_MSG_CHECKING(if ${CXX-c++} environment provides all required features)
if test "x$config_error" = xyes ; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Your compiler is not powerful enough to compile YamCha. \
If it should be, see config.log for more information of why it failed.])
fi
AC_MSG_RESULT([yes])
AM_CONFIG_HEADER(config.h)
AC_OUTPUT([
Makefile
src/Makefile
src/Makefile.bcc32
src/Makefile.msvc
doc/Makefile
training/Makefile
tests/Makefile
libexec/Makefile
man/Makefile
yamcha-config
yamcha.spec
libexec/mkmodel
libexec/mksvmdata
libexec/svm_learn_wrapper
libexec/mkparam
libexec/showse
libexec/zipmodel
libexec/changeRepr.pl
libexec/conlleval.pl
libexec/selecttag
perl/Makefile.PL
ruby/extconf.rb
python/setup.py
],
chmod +x yamcha-config \
libexec/mkmodel \
libexec/mksvmdata \
libexec/svm_learn_wrapper \
libexec/mkparam \
libexec/showse \
libexec/zipmodel \
libexec/changeRepr.pl \
libexec/conlleval.pl \
libexec/selecttag
)
This diff is collapsed.
# Process this file with automake to produce Makefile.in
html_HTMLS = yamcha.html
EXTRA_DIST = $(html_HTMLS) index.html yamcha.css \
feature.png feature2.png feature3.png \
feature4.png feature5.png
update-html:
@for html in $(html_HTMLS); do \
cmd=`basename $$html .html`.1 && \
man2html ../man/$$cmd > $$html; \