Commit 773daa81 authored by Dan Povey's avatar Dan Povey
Browse files

trunk: improvements to build process (better way of checking for packages that we depend on)

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4331 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent b2b3b784
......@@ -3,7 +3,6 @@
# This is pnorm neural net training on top of adapted 40-dimensional features.
train_stage=-10
use_gpu=true
......
......@@ -442,10 +442,13 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = doc base matrix util feat tree gmm sgmm fstext hmm \
itf lat latbin nnet nnetbin tied tiedbin transform lm decoder \
bin fstbin gmmbin fgmmbin sgmmbin featbin online onlinebin gst-plugin \
cudamatrix kwsbin nnet-cpu nnet-cpubin sgmm2 sgmm2bin thread
# the lines after "doc itf" are copied from SUBDIRS in the Makefile.
INPUT = doc itf \
base matrix util feat tree thread gmm transform sgmm \
fstext hmm lm decoder lat cudamatrix nnet \
bin fstbin gmmbin fgmmbin sgmmbin featbin \
nnetbin latbin sgmm2 sgmm2bin nnet2 nnet2bin kwsbin \
ivector ivectorbin
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
......
......@@ -5,13 +5,17 @@ $(error FSTROOT not defined.)
endif
CXXFLAGS = -msse -msse2 -Wall -I.. -DKALDI_DOUBLEPRECISION=0 \
-fPIC \
-DHAVE_POSIX_MEMALIGN -DHAVE_CLAPACK -I ../../tools/CLAPACK/ \
-Wno-sign-compare -Winit-self \
-I ../../tools/CLAPACK/ \
-I $(FSTROOT)/include \
$(EXTRA_CXXFLAGS) \
-g # -O0 -DKALDI_PARANOID
ifeq ($(KALDI_FLAVOR), dynamic)
CXXFLAGS += -fPIC
endif
LDFLAGS = -g -enable-auto-import
LDLIBS = $(EXTRA_LDLIBS) $(FSTROOT)/lib/libfst.a -ldl -L/usr/lib/lapack \
-enable-auto-import -lcyglapack-0 -lcygblas-0 -lm -lpthread
......
......@@ -5,7 +5,7 @@ $(error FSTROOT not defined.)
endif
CXXFLAGS = -msse -msse2 -Wall -I.. \
-fPIC \
-pthread \
-DKALDI_DOUBLEPRECISION=0 \
-Wno-sign-compare -Winit-self \
-DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H \
......@@ -14,6 +14,10 @@ CXXFLAGS = -msse -msse2 -Wall -I.. \
$(EXTRA_CXXFLAGS) \
-gdwarf-2 # -O0 -DKALDI_PARANOID
ifeq ($(KALDI_FLAVOR), dynamic)
CXXFLAGS += -fPIC
endif
LDFLAGS = -gdwarf-2
LDLIBS = $(EXTRA_LDLIBS) $(FSTROOT)/lib/libfst.a -ldl -lm -lpthread -framework Accelerate
CXX = g++-4
......
......@@ -5,7 +5,7 @@ $(error FSTROOT not defined.)
endif
CXXFLAGS = -msse -msse2 -Wall -I.. \
-fPIC \
-pthread \
-DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Winit-self \
-DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -rdynamic \
......@@ -14,6 +14,10 @@ CXXFLAGS = -msse -msse2 -Wall -I.. \
$(EXTRA_CXXFLAGS) \
-g # -O0 -DKALDI_PARANOID
ifeq ($(KALDI_FLAVOR), dynamic)
CXXFLAGS += -fPIC
endif
LDFLAGS = -g -rdynamic
LDLIBS = $(EXTRA_LDLIBS) $(FSTROOT)/lib/libfst.a -ldl -lm -lpthread -framework Accelerate
CXX = g++
......
......@@ -5,7 +5,7 @@ $(error FSTROOT not defined.)
endif
CXXFLAGS = -msse -msse2 -Wall -I.. \
-fPIC \
-pthread \
-DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Winit-self \
-DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -rdynamic \
......@@ -14,6 +14,11 @@ CXXFLAGS = -msse -msse2 -Wall -I.. \
$(EXTRA_CXXFLAGS) \
-g # -O0 -DKALDI_PARANOID
ifeq ($(KALDI_FLAVOR), dynamic)
CXXFLAGS += -fPIC
endif
LDFLAGS = -g -rdynamic
LDLIBS = $(EXTRA_LDLIBS) $(FSTROOT)/lib/libfst.a -ldl -lm -lpthread -framework Accelerate
CXX = g++
......
......@@ -5,7 +5,7 @@ $(error FSTROOT not defined.)
endif
CXXFLAGS = -msse -msse2 -Wall -I.. \
-fPIC \
-pthread \
-DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Winit-self \
-DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -rdynamic \
......@@ -14,6 +14,11 @@ CXXFLAGS = -msse -msse2 -Wall -I.. \
$(EXTRA_CXXFLAGS) \
-g # -O0 -DKALDI_PARANOID
ifeq ($(KALDI_FLAVOR), dynamic)
CXXFLAGS += -fPIC
endif
LDFLAGS = -g -rdynamic
LDLIBS = $(EXTRA_LDLIBS) $(FSTROOT)/lib/libfst.a -ldl -lm -lpthread -framework Accelerate
CXX = g++
......
......@@ -5,7 +5,7 @@ $(error FSTROOT not defined.)
endif
CXXFLAGS = -msse -msse2 -Wall -I.. \
-fPIC \
-pthread \
-DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Winit-self \
-DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H \
......@@ -14,6 +14,11 @@ CXXFLAGS = -msse -msse2 -Wall -I.. \
$(EXTRA_CXXFLAGS) \
-g # -O0 -DKALDI_PARANOID
ifeq ($(KALDI_FLAVOR), dynamic)
CXXFLAGS += -fPIC
endif
LDFLAGS = -g
LDLIBS = $(EXTRA_LDLIBS) $(FSTROOT)/lib/libfst.a -ldl -lm -lpthread -framework Accelerate
CXX = g++
......
......@@ -14,7 +14,7 @@ endif
CXXFLAGS = -msse -msse2 -Wall -I.. \
-fPIC \
-pthread \
-DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Wno-unused-local-typedefs -Winit-self \
-DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H \
......
......@@ -35,8 +35,7 @@ $(error ATLASLIBS not defined.)
endif
CXXFLAGS = -msse -msse2 -Wall -I.. \
-fPIC \
CXXFLAGS = -msse -msse2 -Wall -I.. -pthread \
-DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Winit-self \
-DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H \
......
# You have to make sure CLAPACKLIBS is set...
CXXFLAGS = -msse -Wall -I.. \
-fPIC \
CXXFLAGS = -msse -Wall -I.. -pthread \
-DKALDI_DOUBLEPRECISION=0 -msse2 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Wno-unused-local-typedefs \
-DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H \
......
# You have to make sure CLAPACKLIBS is set...
CXXFLAGS = -msse -Wall -I.. \
-fPIC \
-pthread \
-DKALDI_DOUBLEPRECISION=0 -msse2 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Wno-unused-local-typedefs \
-DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H \
......
......@@ -19,7 +19,7 @@ endif
MKLLIB ?= $(MKLROOT)/lib/em64t
CXXFLAGS = -m64 -msse -msse2 -Wall -I.. \
CXXFLAGS = -m64 -msse -msse2 -pthread -Wall -I.. \
-DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN \
-Wno-sign-compare -Wno-unused-local-typedefs -Winit-self \
-DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H \
......
......@@ -15,15 +15,7 @@ all: check_required_programs sph2pipe atlas irstlm_tgt sclite openfst
check_required_programs:
which aclocal
which automake
which autoconf
which libtoolize || which glibtoolize
which svn
which gcc
which $(CXX)
which patch
which tar
extras/check_dependencies.sh
clean: openfst_cleaned sclite_cleaned irstlm_cleaned
......
#!/bin/bash
redhat_packages=
debian_packages=
function add_packages {
redhat_packages="$redhat_packages $1";
debian_packages="$debian_packages $2";
}
if ! which g++ >&/dev/null; then
echo "$0: g++ is not installed."
add_packages gcc-c++ g++
fi
if ! echo "#include <zlib.h>" | gcc -E - >&/dev/null; then
echo "$0: zlib is not installed."
add_packages zlib-devel zlib1g-dev
fi
for f in make automake libtool autoconf patch awk grep; do
if ! which $f >&/dev/null; then
echo "$0: $f is not installed."
add_packages $f $f
fi
done
if ! which svn >&/dev/null; then
echo "$0: subversion is not installed"
add_packages subversion subversion
fi
if ! which awk >&/dev/null; then
echo "$0: awk is not installed"
add_packages gawk gawk
fi
printed=false
status=0
if which apt-get >&/dev/null; then
if [ ! -z "$debian_packages" ]; then
echo "$0: we recommend that you run (our best guess):"
echo " sudo apt-get install $debian_packages"
printed=true
status=1
fi
if ! dpkg -l | grep -E 'libatlas3gf|libatlas3-base' >/dev/null; then
echo "You should probably do: "
echo " sudo apt-get install libatlas3-base"
printed=true
fi
# Debian systems generally link /bin/sh to dash, which doesn't work
# with some scripts as it doesn't expand x.{1,2}.y to x.1.y x.2.y
if [ $(readlink /bin/sh) == "dash" ]; then
echo "/bin/sh is linked to dash, and currently some of the scripts will not run"
echo "properly. We recommend to run:"
echo " sudo ln -s -f dash /bin/sh"
printed=true
fi
fi
if which yum >&/dev/null; then
if [ ! -z "$redhat_packages" ]; then
echo "$0: we recommend that you run (our best guess):"
echo " sudo yum install $redhat_packages"
printed=true
status=1
fi
if ! dpkg -l | grep atlas >/dev/null; then
echo "You should probably do something like: "
echo "sudo yum install atlas.x86_64"
printed=true
fi
fi
if ! $printed; then
echo "$0: all OK."
fi
exit $status
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment