0

I am using Sphinxbase and Pocketsphinx from the release (https://sourceforge.net/projects/cmusphinx/files/sphinxbase/5prealpha/) and while installing I am getting following errors :

/sphinxbase/src/libsphinxbase/util/profile.c: In function ‘ptmr_start’:
/sphinxbase/src/libsphinxbase/util/profile.c:185:19: error: storage size of ‘start’ isn’t known
     struct rusage start;        /* CPU time */
                   ^
/sphinxbase/src/libsphinxbase/util/profile.c:188:15: error: ‘RUSAGE_SELF’ undeclared (first use in this function)
     getrusage(RUSAGE_SELF, &start);
               ^
/sphinxbase/src/libsphinxbase/util/profile.c:188:15: note: each undeclared identifier is reported only once for each function it appears in
/sphinxbase/src/libsphinxbase/util/profile.c: In function ‘ptmr_stop’:
/sphinxbase/src/libsphinxbase/util/profile.c:224:19: error: storage size of ‘stop’ isn’t known
     struct rusage stop;         /* CPU time */
                   ^
/sphinxbase/src/libsphinxbase/util/profile.c:227:15: error: ‘RUSAGE_SELF’ undeclared (first use in this function)
     getrusage(RUSAGE_SELF, &stop);
               ^

I am on Ubuntu, it compiles fine on Macintosh which is also Unix.

  • https://stackoverflow.com/questions/34517362/ubuntu-rusage-error – Tom Kuschel Jul 20 '17 at 20:18
  • @TomKuschel Thank you for the link, answers there provided some hint. It was bad system flag. Thank you. – Angela Lilly Jul 20 '17 at 20:23
  • You're welcome! I have never been concerned with speech-recognition, but an #include `` and possibly also sys/time.h seems good. +1; I personally prefer arch linux, in the AUR, there is already a package with: 6 aur/sphinxbase 5prealpha-9 (77) (3,02) --- Common library for sphinx speech recognition. – Tom Kuschel Jul 20 '17 at 20:41

1 Answers1

1

Thank you @TomKuschel for the link. The link provided a hint. Turns out it was bad system flag and hence files were not included. Including <sys/time.h> and <sys/resource.h> resolved the issue.