Commit 330ca2a9 authored by Mickael Rouvier's avatar Mickael Rouvier
Browse files

new version modify tools and configure

parent f41594b7
......@@ -13,7 +13,7 @@
# ./configure --shared ## shared libraries.
# ./configure --mkl-root=/opt/intel/mkl
# ./configure --mkl-root=/opt/intel/mkl --threaded-math=yes
# ./configure --openblas-root=../tools/OpenBLAS/install # before doing
# ./configure --openblas-root=../tools/OpenBLAS/install # before doing
# # this, cd to ../tools and type "make openblas". Note:
# # this is not working correctly on all platforms, do "make test"
# # and look out for segmentation faults.
......@@ -181,6 +181,7 @@ function check_for_slow_expf {
function exit_success {
check_for_bad_gcc;
check_for_slow_expf;
echo "SUCCESS"
exit 0;
}
......@@ -579,61 +580,71 @@ function linux_configure_static {
function linux_check_dynamic {
# will exit with success if $dir seems to contain ATLAS libraries with
# right architecture (compatible with default "nm")
if [ -f $dir/libatlas.so ]; then # candidate...
if nm --dynamic $dir/libatlas.so 2>&1 | grep "File format not recognized" >/dev/null; then
echo "Directory $dir may contain dynamic ATLAS libraries but seems to be wrong architecture";
return 1;
fi
echo "Atlas found in $dir";
return 0;
else
echo "... no libatlas.so in $dir";
return 1;
fi
if $threaded_atlas; then pt=t; else pt=s; fi
for atlas_libname in libatlas.so lib${pt}atlas.so; do
if [ -f $dir/$atlas_libname ]; then # candidate...
if nm --dynamic $dir/$atlas_libname 2>&1 | grep "File format not recognized" >/dev/null; then
echo "Directory $dir may contain dynamic ATLAS libraries but seems to be wrong architecture";
return 1;
fi
echo "Atlas found in $dir";
return 0;
fi
done
echo "... no {libatlas,lib${pt}atlas}.so in $dir";
return 1;
}
function linux_configure_dynamic {
if $threaded_atlas; then pt=pt; else pt=""; fi
if $threaded_atlas; then pt=t; else pt=s; fi # relevant to "fat" libraries, will change later for separate ones
if [ -z $ATLASLIBDIR ]; then # Note: it'll pick up the last one below.
for dir in /usr{,/local}/lib{,64}{,/atlas,/atlas-sse2,/atlas-sse3} \
`pwd`/../tools/ATLAS/build/install/lib/ $ATLASROOT/lib; do
linux_check_dynamic && ATLASLIBDIR=$dir
linux_check_dynamic && ATLASLIBDIR=$dir && ATLASLIBNAME=$atlas_libname
done
if [ -z $ATLASLIBDIR ]; then
echo "Could not find libatlas.so in any of the obvious places, will most likely try static:"
if [ -z $ATLASLIBDIR -o -z $ATLASLIBNAME ]; then
echo "Could not find {libatlas,lib${pt}atlas}.so in any of the obvious places, will most likely try static:"
return 1;
fi
elif [ ! -f $ATLASLIBDIR/libatlas.so ]; then
echo "Could not find libatlas.so in '$ATLASLIBDIR'"
return 1;
fi
echo "Validating presence of ATLAS libs in $ATLASLIBDIR"
ATLASLIBS=
# The Lapack part of ATLAS seems to appear under various different names.. but it
# should always have symbols like ATL_cgetrf defined, so we test for this,
# for all the names we have encountered.
for libname in lapack lapack_atlas clapack; do
if [ -f $ATLASLIBDIR/lib${libname}.so -a "$ATLASLIBS" == "" ]; then
if nm --dynamic $ATLASLIBDIR/lib${libname}.so | grep ATL_cgetrf >/dev/null; then
ATLASLIBS="$ATLASLIBDIR/lib${libname}.so"
echo "Using library $ATLASLIBS as ATLAS's CLAPACK library."
fi
# If using "fat" libraries we only need one file to link against
if [ $ATLASLIBNAME != libatlas.so ]; then
if [ -f $ATLASLIBDIR/$ATLASLIBNAME ]; then
ATLASLIBS="$ATLASLIBDIR/$ATLASLIBNAME"
else
echo "Configuring dynamic ATLAS library failed: library $ATLASLIBNAME not found in $ATLASLIBDIR"
return 1;
fi
done
if [ "$ATLASLIBS" == "" ]; then
echo Could not find any libraries $ATLASLIBDIR/{liblapack,liblapack_atlas,libclapack} that seem to be an ATLAS CLAPACK library.
return 1;
fi
for x in ${pt}cblas atlas ${pt}f77blas; do
if [ ! -f $ATLASLIBDIR/lib$x.so ]; then
echo "Configuring dynamic ATLAS libraries failed: Could not find library $x in directory $ATLASLIBDIR"
else # with "thin" libraries, we have several object to link against, and different single/multi-thread names
if $threaded_atlas; then pt=pt; else pt=""; fi
echo "Validating presence of ATLAS libs in $ATLASLIBDIR"
ATLASLIBS=
# The Lapack part of ATLAS seems to appear under various different names.. but it
# should always have symbols like ATL_cgetrf defined, so we test for this,
# for all the names we have encountered.
for libname in lapack lapack_atlas clapack; do
if [ -f $ATLASLIBDIR/lib${libname}.so -a "$ATLASLIBS" == "" ]; then
if nm --dynamic $ATLASLIBDIR/lib${libname}.so | grep ATL_cgetrf >/dev/null; then
ATLASLIBS="$ATLASLIBDIR/lib${libname}.so"
echo "Using library $ATLASLIBS as ATLAS's CLAPACK library."
fi
fi
done
if [ "$ATLASLIBS" == "" ]; then
echo Could not find any libraries $ATLASLIBDIR/{liblapack,liblapack_atlas,libclapack} that seem to be an ATLAS CLAPACK library.
return 1;
fi
ATLASLIBS="$ATLASLIBS $ATLASLIBDIR/lib${x}.so"
done
if $threaded_atlas; then ATLASLIBS="$ATLASLIBS"; fi
for x in ${pt}cblas atlas ${pt}f77blas; do
if [ ! -f $ATLASLIBDIR/lib$x.so ]; then
echo "Configuring dynamic ATLAS libraries failed: Could not find library $x in directory $ATLASLIBDIR"
return 1;
fi
ATLASLIBS="$ATLASLIBS $ATLASLIBDIR/lib${x}.so"
done
if $threaded_atlas; then ATLASLIBS="$ATLASLIBS"; fi
fi
echo ATLASINC = $ATLASROOT/include >> kaldi.mk
echo ATLASLIBS = $ATLASLIBS >> kaldi.mk
......
This diff is collapsed.
K 25
svn:wc:ra_dav:version-url
V 39
/p/kaldi/code/!svn/ver/4863/trunk/tools
END
install_atlas.sh
K 25
svn:wc:ra_dav:version-url
V 56
/p/kaldi/code/!svn/ver/2427/trunk/tools/install_atlas.sh
END
install_speex.sh
K 25
svn:wc:ra_dav:version-url
V 56
/p/kaldi/code/!svn/ver/4361/trunk/tools/install_speex.sh
END
install_portaudio.sh
K 25
svn:wc:ra_dav:version-url
V 60
/p/kaldi/code/!svn/ver/2427/trunk/tools/install_portaudio.sh
END
install_srilm.sh
K 25
svn:wc:ra_dav:version-url
V 56
/p/kaldi/code/!svn/ver/2427/trunk/tools/install_srilm.sh
END
INSTALL
K 25
svn:wc:ra_dav:version-url
V 47
/p/kaldi/code/!svn/ver/4697/trunk/tools/INSTALL
END
Makefile
K 25
svn:wc:ra_dav:version-url
V 48
/p/kaldi/code/!svn/ver/4754/trunk/tools/Makefile
END
install_pfile_utils.sh
K 25
svn:wc:ra_dav:version-url
V 62
/p/kaldi/code/!svn/ver/2427/trunk/tools/install_pfile_utils.sh
END
K 10
svn:ignore
V 428
*.slo
*.lo
*.o
*~
*.so
*.dylib
*.lai
*.la
*.a
*.dSYM
ATLAS
atlas3.8.3.tar.gz
irstlm
openfst
openfst-1.3.2.tar.gz
openfst-1.3.2
openfst-1.3.4.tar.gz
openfst-1.3.4
pa_stable_v19_20111121.tgz
portaudio
sctk-2.4.0-20091110-0958.tar.bz2
sctk-2.4.0
sph2pipe_v2.5.tar.gz
sph2pipe_v2.5
kaldi_lm.tar.gz
sctk-2.4.8-20130429-2145.tar.bz2
sctk-2.4.9-20141015-1634Z.tar.bz2
sctk-2.4.9
OpenBLAS
sctk
sctk-2.4.8
srilm
CLAPACK_include
kaldi_lm
K 13
svn:mergeinfo
V 630
/sandbox/akirkedal/tools:3806-4273
/sandbox/bolt/tools:4130-4352
/sandbox/dan/tools:1504-1801,4374-4503
/sandbox/dan2/tools:2775-2829,2832-3292
/sandbox/discrim/tools:234-658
/sandbox/karel/tools:270-942,1522-1532
/sandbox/kws/tools:1533-1557
/sandbox/language_id/tools:3523-3930,3933-4691
/sandbox/nshmyrev/tools:3830-3854
/sandbox/online/tools:3325-4359
/sandbox/oplatek/tools:2513-2541
/sandbox/pawel/tools:4013-4275
/sandbox/pitch/tools:3126-3251
/sandbox/sail/tools:3642-3712,3716-3797
/sandbox/sharedlibs/tools:2585-2662
/sandbox/tacc_kaldi/tools:3041-4251
/sandbox/tanel/tools:2623-2658
/sandbox/thang-project/tools:233-258
END
10
dir
4894
https://svn.code.sf.net/p/kaldi/code/trunk/tools
https://svn.code.sf.net/p/kaldi/code
2015-02-06T22:21:51.338526Z
4863
jtrmal
has-props
5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
install_atlas.sh
file
2015-02-22T20:57:12.086701Z
b710537b754676ab36c43d94b7529cf4
2013-05-08T16:53:14.449173Z
2427
danielpovey
has-props
svn:special
23
install_speex.sh
file
2015-02-22T20:57:12.086701Z
6c700383e4c8933c5de5a7504fced89d
2014-08-31T17:21:56.128797Z
4361
danielpovey
has-props
svn:special
23
install_portaudio.sh
file
2015-02-22T20:57:12.087701Z
f108160c9ee5683837873d1b976615b4
2013-05-08T16:53:14.449173Z
2427
danielpovey
has-props
svn:special
27
install_srilm.sh
file
2015-02-22T20:57:12.087701Z
16844b81cd2a4f2bf6fb0bbd221699e2
2013-05-08T16:53:14.449173Z
2427
danielpovey
has-props
svn:special
23
extras
dir
INSTALL
file
2015-02-22T20:57:12.087701Z
7762f064691d30f6f2837722cf7300a3
2014-12-14T00:25:55.729283Z
4697
canbaz
8282
rnnlm-hs-0.1b
dir
Makefile
file
2015-02-22T20:57:12.087701Z
5a0d033400d8d5c48e9e2da66d7f85e3
2015-01-06T14:49:08.707480Z
4754
nshmyrev
5915
CLAPACK
dir
install_pfile_utils.sh
file
2015-02-22T20:57:12.087701Z
345941934dc1dc07d1f36931ca49b55f
2013-05-08T16:53:14.449173Z
2427
danielpovey
has-props
svn:special
29
To install the prerequisites for Kaldi:
make
If you have multiple CPUs and want to speed things up, you can do a parallel
build by supplying the "-j" option to make, e.g. to use 4 CPUs:
make -j 4
By default, Kaldi builds against OpenFst-1.3.4. If you want to build against
OpenFst-1.4, edit the Makefile in this folder. Note that this change requires
a relatively new compiler with C++11 support, e.g. gcc >= 4.6, clang >= 3.0.
Note:
./install_atlas.sh is a backup plan in case you don't have ATLAS installed
on your system. Ignore it unless you get errors from ../src/configure.
**** IGNORE THE REST OF THIS FILE! ****
The rest of this file contains the old, manual instructions, which
we keep around in case they are useful for someone, but they are
basically deprecated.
See below install instructions for:
(1) sph2pipe (needed to run the example scripts but not for compilation)
(2) openfst (needed)
(3) dot (optional; only used by doxygen and for FST debugging).
(4) IRSTLM (optional; only needed if you want to build LMs and
don't already have a setup).
(5) sclite (optional; useful for detailed scoring output but the
default scripts don't use it).
(6) ATLAS (needed only for headers, if already on system, but for
native Windows compilation without Intel MKL you have to compile this)
(7) CLAPACK headers (required if you have the library available but
no headers in a directory accessed by default; this is the case on Cygwin)
(8) libportaudio (needed for the online recognition binaries)
####
(1)
Install instructions for sph2pipe_v2.5.tar.gz
#Note: you may need to try other sites, where the archive is available
#For example:
# http://merlin.fit.vutbr.cz/kaldi/sph2pipe_v2.5.tar.gz
wget ftp://ftp.ldc.upenn.edu/pub/ldc/misc_sw/sph2pipe_v2.5.tar.gz
tar -xovzf sph2pipe_v2.5.tar.gz
cd sph2pipe_v2.5
gcc -o sph2pipe *.c -lm
cd ..
# These instructions are not valid for native Windows;
# see the readme, 0readme.1st, in sph2pipe_v2.5
####
(2)
Install instructions for OpenFst
Note that this should be compiled with g++-4.x
You may have to install this and give the option CXX=<g++-4-binary-name>
to configure, if it's not already the default (g++ -v will tell you).
(on cygwin you may have to install the g++-4.0 package and give the options CXX=g++-4.exe CC=gcc-4.exe to configure).
wget http://openfst.cs.nyu.edu/twiki/pub/FST/FstDownload/openfst-1.3.2.tar.gz
tar -xovzf openfst-1.3.2.tar.gz
for dir in openfst-1.3.2/{src/,}include/fst; do
( [ -d $dir ] && cd $dir && patch -p0 -N <../../../../openfst.patch )
done
rm openfst 2>/dev/null # Remove any existing link
ln -s openfst-1.3.2 openfst
cd openfst-1.3.2
# Choose the correct configure statement:
Linux or Darwin:
./configure --prefix=`pwd` --enable-static --disable-shared
Linux, cross-compile (64-bit) [you probably don't want this]:
# Configure for linux, cross-compile to 64-bit
# Note that this refers to 64-bit compilation, which
# on the BUT machines it not the default even though the machines
# are 64bit [you would have to compile with OPT=64bit].
./configure --host=x86_64-linux --prefix=`pwd` --enable-static --disable-shared
Cygwin:
./configure --prefix=`pwd` CXX=g++-4.exe CC=gcc-4.exe --enable-static --disable-shared