CHATR has a number of requirements to enable the system to be compiled and installed.
In rough order of necessity these are
ANSI C compiler (e.g. gcc)
GNU Make
include
directive in Makefiles, you need a
make
that can support it. Sun's make
does not. There
are many `makes' available and they vary quite widely between
different machines. Be sure to acquire a common one which is usable
on all machines.
makedepend
makedepend
. `Makedepend' is available as part of the X11R5
distribution and usually installed with it. Unfortunately there are
a number versions of `makedepend' and they are all subtly
incompatible.
GNU Readline library
NIST sphere, speech file header library
GNU test, GNU RCS
NCD NetAudio
DAT-Link
naplay
. The direct method has the
advantage of faster access, no spurious output (naplay
always
prints a messages), and no worry about finding the pathname of
naplay
at run time.
DEC AudioFile
kan2rom
kan2rom
is installed. This converts kana/kanji to romaji,
with breaks and accents. In most installations it is a proprietary
program from KDD. A free alternative using kakasi
is
partially supported but the results are not as good - accents are not
marked. The shell script in $CHATR_ROOT/lib/etc/k2r
is the
interface. If a version of `kan2rom' is not available, you
should copy the file `k2r' to `kan2rom'. The function
poor_jtts
uses the `k2r' script by default.
XMG
XWAVES
ESPS functions
HTK
HCode
and HCopy
are required when
building new databases. Note the source for `HCode.c' is
required, as a new copy of HCode
will be created and compiled.
A patch is provided within CHATR. Once the database is created
HTK is no longer required, so no Entropic-licensed code
(`HCode.c' or other) exists within CHATR.
fz_track/get_f0
fz_track
,
part of an intonation package developed within ATR. In the future
this may be replaced by get_f0
from ESPS, as it is
probably better and already used in database creation. However,
before a decision is made more work is required to determine the best
way to generate pitch-marks--currently PSOLA is the sole user.
Only the first two of this list are mandatory, plus an ANSI C compiler and GNU make. The others may be left out at compile time, however GNU readline and NIST headers are highly recommended. See the file `$CHATR_ROOT/chatr/REQUIREMENTS' in the distribution for more details about where to obtain these programs.
First, apologies should be made for the complexity of installation and configuration. This requires further work to make it easier.
There are three methods of obtaining a copy of the CHATR source
code: from a `gzipped' tar
-file; under RCS control; under
CVS control.
At every major (and occasionally minor) release, a `gzipped'
tar
-file is produced containing all the source code. For
non-development use, this file may be copied and unpacked.
As an example, assume CHATR version 0.8 is to be installed. There are two methods to do this. If you have GNU `tar' installed, unpack the archive with the command
cd $ROOT/src tar zxvf chatr-0.8.tar.gz
If you do not have GNU `tar', use the alternative
cd $ROOT/src gunzip chatr-0.8.tar.gz tar xvf chatr-0.8.tar
For later versions simply replace the `0.8' with the number of the version you are installing.
If CHATR is to be used for development purposes, your copy of the code must be linked to the library version. This is so updates may be copied out and your changes safely integrated back into the central library.
One method of achieving this is to manage the source by RCS, a system that controls software versions.
NOTE: This will change in later versions, where CVS will become the sole method of accessing and updating the CHATR core distribution.
Installation method is of course dependent on your local setup in respect to path-names and configuration. The following method is that used in ATR-ITL and may need minor adjustment for use elsewhere.
The master library copy of the CHATR source is in `/DB/PI/chatr/'. First create a directory for your personal copy of the code. For example, issue the commands
cd mkdir src cd src mkdir chatr cd chatr
The library copy of the source may be copied with three simple commands. First, the necessary directories are created using the command
/DB/PI/chatr/utils/mkchatrdirs
Then the links to the appropriate RCS depository directories are put into each directory using the command
/DB/PI/chatr/utils/mkchatrrcs
Finally, a full copy of the code should be obtained. The RCS system will automatically check out a read-only version of the system given the command
make update
Note this must be GNU `make'.
Many messages will be generated, some of which look like errors. This is because when a file is not found, an error message is generated, but the file will then be automatically checked out from the RCS library.
CVS, a more general version of RCS, can be used to give you your own read/write version of the CHATR source. CVS will allow you to check in your changes if you wish, but will not restrict others from working on the same files. This method is good when a system becomes stable and people would not usually be editing the same files. This method of installation will eventually replace the RCS method.
Details of installation are of course dependent on your local setup in respect to path-names and configuration. The following method is that used in ATR-ITL so may need minor adjustment for use elsewhere.
First create a directory for your personal copy of the code. If you don't already have an `src' directory, create one by issuing the commands
cd mkdir src
Select the `src' directory using the command
cd src
In the following example, a CVS copy of CHATR version 0.92 will be obtained; if a different version is required, change the number accordingly.
If using the `bash' shell, `check out' the copy of CHATR with the commands
export CVSROOT=/DB/PI/CVSROOT cvs checkout chatr-0.92
If using the `csh' shell the commands are
setenv CVSROOT /DB/PI/CVSROOT cvs checkout chatr-0.92
A read/write copy of the whole source tree will be put below a directory called `chatr'. If a version below the current latest is requested, it will be put in a directory called `chatr-version number'. If this is the case, add the version-number to the following command.
Select the top directory using the command
cd chatr
Construct the dependencies using the command
make
A comment and up to four instructions will be returned. For example
CHATR-0.92 not configured Configure by: cd src/include cp config.make.rules-dist config.make.rules cp ch_config.h-dist ch_config.h chmod +w ch_config.h config.make.rules Then edit these files for your local environment
Within the ATR-ITL environment installation is complete and no further action is necessary.
For other locations, complete installation by editing the above files as required to suit the local environment.
The CHATR source directory tree is
------ data/ |------ dbs/ ------ lib/ ------|------ dic/ | |------ etc/ | ------ examples/ | |------ db_utils/ | | ------ arch/ | |------ audio/ chatr/ ---|------ utils/ |------ chatr/ | |------ chinspect/ | |------ display/ | |------ duration/ |------ doc/ |------ file/ | |------ hlp/ | |------ include/ | |------ input/ ------ src/ ------|------ intonation/ |------ lex/ |------ lib/ |------ lts/ |------ main/ |------ phoneme/ |------ phrase/ |------ ruc/ |------ synth/ |------ text/ ------ udb/
See section CHATR Source File Locations, for lists of what files are kept in each directory.
.
doc/
lib/
lib/data/
lib/etc/
CH_OSTYPE
is set at compile time, these files
will be kept in separate sub-directories such that the library
directory may be shared between architectures.
lib/examples/
lib/dic/
lib/dbs/
main_db_dir
(from which many database directories are derived)
set to /DB/PI/chatr/lib/dbs/.
utils/
db_utils/
src/
src/arch/
src/audio/
src/chatr/
src/chinspect/
src/display/
src/duration/
src/file/
src/hlp/
src/include/
src/input/
src/intonation/
src/isard/
src/formant/
src/lex/
src/lib/
src/lts/
src/main/
src/nuutalk/
src/nuutalkhi/
src/phoneme/
src/phrase/
src/ruc/
src/synth/
src/taylor/
src/text/
src/udb/
Every user of the CHATR source may have their own configuration.
This is set by two files in `$CHATR_ROOT/src/include/',
`ch_config.h' and `config.make.rules'. If you obtained a
copy of CHATR using make update
, personal default copies
of these files will already exist. If you are unpacking from an
archive file, you must obtain copies by issuing the commands
cd $CHATR_ROOT/src/include cp config.make.rules-dist config.make.rules cp ch_config.h-dist ch_config.h chmod +w ch_config.h config.make.rules
You will most likely have to edit each of these files.
The first file, `ch_config.h', contains a number of C preprocessor definitions with explanations of the function of each. This is where C-source level configuration is done. Comment out any options not required.
The most important definition is that of CHATR_USRLIBDIR
.
This defines the location of the CHATR library files and should
end in `/lib/data'. If the library is to be installed at a
place other than where the source is, this should point to that
location. Otherwise it should be an absolute path-name to the
library in the source. It is possible to change this at run time
(and even add new library directories in addition to this one),
however it does make life simpler to change this before compilation.
CHATR developers should make this variable point to their own
version of the CHATR library they have just unpacked.
The second configuration file, `config.make.rule', contains all
the configuration information for the Make
files in the
system, i.e. library and include directories for sub-systems, as well
as compilers and options.
The variable CH_OSTYPE
in `config.make.rules' may be
optionally set to the name of the system you are compiling under. If
set, CHATR internal executables will be compiled (and copied in
case of scripts) into a sub-directory named
$CHATR_ROOT/lib/etc/value-of-CH_OSTYPE/
so that different
architectures may share the same library directory. If
CH_OSTYPE
is unset the internal executables are left in
`$CHATR_ROOT/lib/etc/'.
Now that the system has been configured, change directory to the main source directory (the one above `include/'). Enter
cd ..
It is now necessary to build the complete Makefiles and the dependencies between C files and headers. This need only be run once, or when major changes have been made to source files. Enter
make depend
Many messages will be given including ones that look like errors.
These may be ignored. Note that when recompiling for a new
architecture make clean
and make depend
must
be used.
The whole system may now be compiled using
make
After some time the CHATR executable will be built in the `$CHATR_ROOT/src/main/' directory. As a rough guide, it takes around 10 minutes on a Sparc10. However, the building of archive files can take a lot longer if the distribution is being accessed by NFS. During this process the X-windows display program and audio spooler will be built in the `$CHATR_ROOT/lib/etc/' directory.
The whole compiled system and source will require around 10-15 megabytes of disk space.
It must be ensured that there are lexicons and speaker databases available to CHATR. In the standard distribution the path names point to locations as used in the ATR-ITL file system. Installations elsewhere will need these added. See section Creating and Defining a Lexicon, for information about adding lexicons. See section Installing Speech Synthesis Databases, for information about installing speaker databases. If locations of either are changed for any reason CHATR will need to know. See section Customizing an Installation, for customization details.
Compilation of the CHATR system is now complete.
Before attempting to use the system, ensure the `$ROOT/.chatrrc' file defines a valid audio device. A default version can be obtained from `$CHATR_ROOT/lib/data/default.chatrrc'. Copy this to your home directory renaming it `.chatrrc', and edit it to call the audio hardware that you have attached to your machine.
To hear CHATR talk, enter the shell command
chatr -tts $CHATR_ROOT/lib/examples/chatr_intro
If there is an error such as
Sorry, can't talk to audio device: 0
CHATR has not been properly informed about the audio hardware available. Check the device selected in the `$ROOT/.chatrrc' file. See section Audio Setup - Software, for editing details.
The language capability of CHATR is constantly being extended. For an introduction in a language other than English, check the directory `$CHATR_ROOT/lib/examples/' for what is available.
There are a number of compilation errors which have solutions not immediately obvious. This section details some of the more common ones.
In general the system is compiled with option -Wall
, which
gives warnings for most problems. Apart from optional subsystems,
CHATR and the window inspector code should compile with no
warnings except in the following conditions. Some system functions
(e.g. bzero
, memcpy
, random
, the entire
stdio
library (and most of the socket functions) under SunOS)
do not have function prototypes and hence give warnings about
implicit definitions. CHATR cannot give prototypes to system
functions. This is actually a bug in the operating system and not in
CHATR. You will have to live with these errors.
Occasionally there are functions defined which are not used. These may be used in the future so have been left in.
If an error about an implicit definition of a CHATR function is received, probably the appropriate `include file' has not been included, or possibly the wrong function-name called. Search for the function in `$CHATR_ROOT/src/include/*.h' and include that file. Locate and correct any typing errors.
If you get `Undefined symbol' at link time for any of P_Error
,
P_Warning
, P_Message
, etc, you have forgotten to
include `interface.h' in a source file. There should have been
a warning when that file was produced saying the P_Error
or
whatever is implicitly declared.
If you get `dereferencing pointer to incomplete type', then again you have forgotten to include a `*.h' file that defines some structure.
CHATR currently compiles and runs under SunOS, Solaris, HP-UX, DEC alpha, SGI, linux and FreeBSD. These are quite varied Unix systems, with different byte order, different word size, and different BSD/SYSV histories. Therefore CHATR should be portable to other Unix's with few problems.
Byte order is dealt with automatically within the system. The byte order of the machine being compiled on is determined by the expression in `$CHATR_ROOT/src/include/general.h'. Database waveform files have their byte order declared so CHATR can swap them to the installation's native byte order if required. The only other binary files in the system are the database index files. A `magic number' at the start of these files allows CHATR to determine if the byte order of the machine used to create the file is different from that of the machine reading the file. If so, byte swapping occurs. Floating point numbers are also swapped, although this only occurs if reading database index files. It is possible that the algorithm used for swapping floats may need to be changed if CHATR is ported to some new architectures.
However, there are some other specific points that are more likely to be problems when porting to new systems.
Basic floating-point routines differ from machine to machine,
specifically: nint
, isnormal
and isinf
.
nint
appears on some systems and not on others. It is defined
as a macro in `$CHATR_ROOT/src/include/general.h' for those
systems that do not have it. You may need to add to the
ifdef
's in that file for new systems. Likewise the
definitions for the other floating point functions. These are
defined in `$CHATR_ROOT/src/arch/sysdep.c' and may require new
ifdef
's.
Wherever possible, system-dependent functions are in `$CHATR_ROOT/src/arch/sysdep.c' and hence only that file should need to change.
When using compilers other than gcc, you should choose the vendor's ANSI C options. This in fact is not always well defined. (To be fair, gcc also has this problem.) Of the two non-gcc version of ANSI C tested, extra defines were necessary to get CHATR (or even trivial programs for that matter) to compile.
See the file `$CHATR_ROOT/src/include/config.make.rules' for the non-gcc-native C compiler options. HPUX definitions should be similar to
CC = cc OPT = -Aa -O -D_HPUX_SOURCE -D__hppa__
With IRIX5.3 (on SGI's), the options should look like
CC = cc OPT = -ansi -O2 -mips2 -D_SVR4_SOURCE
In order for many people to develop CHATR at the same time, it is necessary to ensure that two people cannot change the same file at the same time. The source code control system RCS (Revision Control System) aids this. If one person is editing a source, no other developer may do so. Thus all sources are by default read-only. When a file is checked-out by a developer, they may change it but no other developer may check it out at the same time. When a developer is finished they may check-in the file thus allowing others to check it out. Files may be checked in and out using the RCS commands
ci FILE-NAME co -l FILE-NAME
It is highly recommended that developers who have access to EMACS use the EMACS functionality to check-out files (and sometimes to check-in files too).
To check-out a file in EMACS, simply load it into a buffer using the usual C-x C-f. C-x C-q will automatically check-out a file for editing.
Checking-out is usually done file-by-file as required, but once a stable state is reached developers can check-in all of their checked-out code at once. To check-in all code below the `$CHATR_ROOT/src/' directory, while in that directory type
make checkin
You will be prompted for a comment for each file that is checked-in. As no comments are actually used, you may simply type `. RET' for each file.
Alternatively, to check-in a single file in EMACS, type C-x C-q in the buffer and then (ignoring the request for a comment), type C-c C-c.
Occasionally you will wish to update your version of the code with other people's recently checked-in versions. To do this, in the CHATR root directory type
make update; make update
The reason it is required twice is that if new files have been added
to the distributions, you need to first check-out the Makefile
which names the new files, then update again to take into account the
new named file.
NOTE: EMACS can get confused (as can users) when checking-in versions of code. It is safest to exit EMACS (or at least kill all buffers editing CHATR code) immediately after checking-in code.
NOTE: It is also thoroughly recommend that you type
make update
after checking-in your code.
NOTE: As UNIX machines have their own clock that may be a
few seconds (or possibly minutes) different, and that times of files
are used to decide if files need updates or not, it is possible that
files may not be automatically checked-in even when they have been
changed. This happens if a file is checked-out and changed and then
saved such that its local time stamp is earlier than the time stamp
on the library copy (pretty fast editing - or shoot your system
administrator if the clock is that far out!). In this case, edit
the file again giving it a newer time stamp. Or check it in by hand
using either EMACS C-x C-q or the command ci FILE-NAME
.
CHATR is unlikely to be of much use as a speech synthesis system unless it can actually talk. Our highest quality speech comes from databases of natural speech. Due to their size and varying distribution rights, these databases are not included in the core CHATR source distribution. Such speech databases can be made automatically from waveform files and label files. See section Creating & Training a Speech Synthesizer Database, for more information.
However, copying an existing database is perhaps easier. Standard
databases allow easy packing and transportation. From within a
speech database directory the command db_utils/make_tar
will
make a tar'd, gzipped file containing all the necessary files in a
speech database. Four levels of packing are provided.
bin
binx
src
rsrc
asrc
To install any of the above `tar' files simply unpack them in a
directory and then declare to CHATR where they are using the
defspeaker
command. See section Defining a Speaker, for more
details.
Before a speaker can be used, the name and directory location must be
made known to CHATR. This is done using the defspeaker
command. The defspeaker
command takes two arguments, a
database name and a directory. The name should be the name of the
database as defined in the `db_description' file. The second
argument should be the full path name of the database directory (i.e.
the directory containing the subdirectory `index/'. The path
name must be suffixed with a slash `/'
. Both arguments should
be in double quotes. For example
(defspeaker "Me" "$ROOT/Speech_data_bases/Me/")
Expressions which evaluate to atoms are allowed.
defspeaker
commands may be put in your own `.chatrrc'
file (perhaps defining speakers for users of a particular
installation), or simply typed to the command interpreter.
See section Customizing an Installation, for details on how to customize
an installation.
Not all installations of CHATR will have the same resources available. Speaker databases and lexicon types and/or location are two areas that may differ. This section describes how to customize a particular installation.
CHATR cannot run properly without accessing its own library directory. The path name for the default library directory is defined at compile time in the `ch_config.h' file, but if for some reason it is not possible to recompile, the library file may be specified on the command line when CHATR is called. For example
chatr --libdir $CHATR_ROOT/lib/data/
Note the library directory should always point to the `data/' directory within the CHATR distribution.
Unless CHATR is started with the `-q' option, the first action is to load `init.ch' from the library directory. Although this file can be edited to contain custom requirements, there are two files available that are more appropriate (and safer!) for that purpose: `site_paths.ch' and `site_init.ch'.
If `init.ch' detects the file `site_paths.ch' in the
library directory it will be loaded. Creating this file gives a user
the opportunity to set some basic path names required during normal
startup. Use the set
command to define these. In particular
site_speakers_file
defspeaker
commands) for the
databases available in this installation. If it is not set, the file
`$CHATR_ROOT/lib/data/itlspeakers.ch' will be loaded, thereby
defining the speakers that are available in the ATR-ITL file system.
If you wish the ATR-ITL speakers to be defined plus your own,
you could create your own speaker definition file and include
`itlspeakers.ch' file in that. At a minimum the site speakers
file must define: a default speaker (speaker_default
); and
default speakers for English tts (espeaker
) or Japanese tts
(jspeaker
), if required.
main_db_dir
make_dic_dir
If the above values are to be changed from the default they must be set before any further initialization occurs.
The file `$CHATR_ROOT/lib/data/site_init.ch' should be used for initialization of a site-specific nature. It may contain any CHATR commands. If `$CHATR_ROOT/lib/data/init.ch' detects this file exists it will be loaded.
As mentioned at the beginning of this section, customization is also possible by editing the `$CHATR_ROOT/lib/data/init.ch' file directly. However, care must be taken, especially if non-default directory path-names are yet to be declared in `$CHATR_ROOT/lib/data/site_paths.ch'.
Go to the first, previous, next, last section, table of contents.