Skip to content

Commit b2b3b78

Browse files
committed
trunk: modify the configure script to build more easily on red hat; cosmetic change in mutex code.
git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4330 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
1 parent bf00f0c commit b2b3b78

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/configure

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,24 @@ function linux_configure_debian7 {
418418
exit_success;
419419
}
420420

421+
function linux_configure_redhat {
422+
m=$1 # 64 or empty.
423+
ATLASLIBS="/usr/lib$m/atlas/libatlas.so.3 /usr/lib$m/atlas/libf77blas.so.3 /usr/lib$m/atlas/libcblas.so.3 /usr/lib$m/atlas/libclapack.so.3"
424+
for f in $ATLASLIBS; do
425+
[ ! -f $f ] && return 1;
426+
done
427+
libdir=$(dirname $(echo $ATLASLIBS | awk '{print $1}'))
428+
[ -z "$libdir" ] && echo "Error getting libdir in linux_configure_redhat" && exit 1;
429+
echo ATLASINC = $ATLASROOT/include >> kaldi.mk
430+
echo ATLASLIBS = $ATLASLIBS -Wl,-rpath=$libdir >> kaldi.mk
431+
echo
432+
cat makefiles/linux_atlas.mk >> kaldi.mk
433+
fix_cxx_flag
434+
echo "Successfully configured for red hat [dynamic libraries] with ATLASLIBS =$ATLASLIBS"
435+
$use_cuda && linux_configure_cuda
436+
exit_success;
437+
}
438+
421439

422440
function linux_configure_static {
423441
if $threaded_atlas; then pt=pt; else pt=""; fi
@@ -670,6 +688,8 @@ if [ "`uname`" == "Linux" ]; then
670688
linux_configure_debian_ubuntu 64 || \
671689
linux_configure_debian_ubuntu || \
672690
linux_configure_debian7 || \
691+
linux_configure_redhat 64 || \
692+
linux_configure_redhat || \
673693
linux_atlas_failure "Failed to configure ATLAS lbiraries";
674694
else
675695
# Prefer dynamic to static math.
@@ -678,6 +698,8 @@ if [ "`uname`" == "Linux" ]; then
678698
linux_configure_debian_ubuntu 64 || \
679699
linux_configure_debian_ubuntu || \
680700
linux_configure_debian7 || \
701+
linux_configure_redhat 64 || \
702+
linux_configure_redhat || \
681703
linux_atlas_failure "Failed to configure ATLAS lbiraries";
682704
fi
683705

src/thread/kaldi-mutex.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ bool Mutex::TryLock() {
6666

6767

6868
void Mutex::Unlock() {
69-
if (pthread_mutex_unlock(&mutex_) != 0)
70-
KALDI_ERR << "Error on unlocking pthread mutex";
69+
int ret;
70+
if ((ret = pthread_mutex_unlock(&mutex_)) != 0)
71+
KALDI_ERR << "Error on unlocking pthread mutex, error is: "
72+
<< strerror(ret);
7173
}
7274

7375

0 commit comments

Comments
 (0)