Problem compiling HTK from source.

I have an ASUS x86_64 laptop with OpenSuSE 13.1 and gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388] installed. I’m trying to compile HTK (Hidden Markov Model Toolkit) 3.4.1 from source (there is no RPM available).

The install steps are:

  1. ./configure
  2. make all
  3. make install

The configure works fine, but when I make all I get this error:

**$make all
**(cd HTKLib && make HTKLib.a) \
  || case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory `/home/leslie/Install/htk/HTKLib'
gcc  -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o HGraf.o HGraf.c
**In file included from /usr/include/features.h:388:0,
                 from /usr/include/stdio.h:27,
                 from HShell.h:40,
                 from HGraf.c:54:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
compilation terminated.
**make[1]: *** [HGraf.o] Error 1
make[1]: Leaving directory `/home/leslie/Install/htk/HTKLib'
make: *** [HTKLib/HTKLib.a] Error 1

I have the following gcc packages installed:

**$rpm -qa|grep gcc

I have searched but have not been able to determine the package that provides gnu/stubs-32.h.

bor@opensuse:~> rpm -qf /usr/include/gnu/stubs-32.h

Thanks. I just found a solution for that a few minutes ago in the mailing list archive.

The make all works now, but make install is failing now:

**$sudo make install**
(cd HTKTools && make all) \
  || case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory `/home/leslie/Install/htk/HTKTools'
if  ! -d /usr/local/bin -a X_ = X_yes ] ; then mkdir -p /usr/local/bin ; fi
if  xHSLab = xHSLab ] ; then \
        gcc -o HSLab -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I../HTKLib -DPHNALG HSLab.c ../HTKLib/HTKLib.a -L/usr/X11R6/lib  -lm -lX11 ; \
        else \
        gcc -o HSLab -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I../HTKLib -DPHNALG HSLab.c ../HTKLib/HTKLib.a -L/usr/X11R6/lib  -lm ; fi
HSLab.c: In function ‘FileExists’:
HSLab.c:1209:12: warning: variable ‘isEXF’ set but not used -Wunused-but-set-variable]
    Boolean isEXF;               /* File name is extended */
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc.a when searching for -lgcc
**/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lgcc
**/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/ when searching for -lgcc_s
**/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lgcc_s
**collect2: error: ld returned 1 exit status
make[1]: *** [HSLab] Error 1
make[1]: Leaving directory `/home/leslie/Install/htk/HTKTools'
make: *** [htktools] Error 1

Is ld looking for a 32bit version of these libraries?

Of course. You do use -m32 switch.

Okay; I’m still slowly learning how gcc works, and I wasn’t sure.

I have the following packages installed, but apparently they’re not enough?

$rpm -qa|grep libgcc

How can I tell what packages I need before I compile and install something? gcc only tells me which part it is missing, but not the package that contains it; YaST won’t tell me what parts a package contains unless it is already installed. This is frustrating. :slight_smile:

You need gcc-32bit. libgcc_s (32bit) is providing run-time version, it is not used during compilation.

Okay. I installed gcc-32bit and make install worked this time. Thank you very much for your help.