Menu

SphinxTrain: compiler error with gcc 3.3

Help
2003-07-07
2012-09-22
  • christoph becker

    Hello,

    SphinxTrain fails to compile on Suse 8.2, using gcc 3.3, with the following error messages:

    /usr/lib/gcc-lib/i486-suse-linux/3.3/include/varargs.h:4:2: #error "GCC no lonr implements <varargs.h>."
    /usr/lib/gcc-lib/i486-suse-linux/3.3/include/varargs.h:5:2: #error "Revise youcode to use <stdarg.h>."

    Is this a bug in SphinxTrain or in the gcc?
    Does anybody know a simple solution?
    However, sphinx2 and 3 compile with no errors.

    Regards,
    Christoph Becker

     
    • John Drake

      John Drake - 2004-11-29

      The problem is that gcc changed in a way that broke older code. I managaged to get SphinxTrain to clean compile under cygwin using gcc 3.3.

      Step 1:
      Edit the files quit.c and wrec.h and change <varargs.h> to <stdarg.h>. (Both of these files are in the directory ~/SphinxTrain/src/programs/count_3phone)

      Step 2:
      Make the following changes to quit.c.

      Change:
      int quit (status,fmt,va_alist)
      int status;
      char *fmt;
      va_dcl
      {
      va_list args;

      fflush(stdout);
      va_start(args);
      (void) vfprintf(stderr, fmt, args);
      va_end(args);
      exit(status);
      

      }

      To:

      int quit (int status,char *fmt, ...)
      {
      va_list args;

      fflush(stdout);
      va_start(args, fmt);
      (void) vfprintf(stderr, fmt, args);
      va_end(args);
      exit(status);
      

      }

      Step 3:
      There is a function in to a function in ~/SphinxTrain/src/programs/count_3phone/main.c called "unlimit". I'm not sure what unlimit() does, but it gave me a compile error. Comment it out.

      Doing this I was able to do a clean make. I'm not sure what will happen next since this is my first attempt at using SphinxTrain.

      Regards,

      John M. Drake

       
      • troopie

        troopie - 2005-01-25

        I found the same workaround as John to fix this problem with the new GCC, but could not figure out the unlimit problem... Seems that you fixed unlimit.c to do additional check wether to use unlimit() on Win32 systems. Thanks!

        Actually after updating "wrec.h", "quit.c" and "unlimit.c" from the CVS (src/programs/count_3phone/) compilation worked fine.

        I suggest to replace the Sphinxtrain package from http://www.speech.cs.cmu.edu/SphinxTrain/download.html
        by a new CVS snapshot.

        I know a lot of people that just downloaded Sphinxtrain from there, tried to compile it and then abandoned using SphinTrain due to the compilation errors.

        Thanks in advance
        Reto Baumberger

         
    • The Grand Janitor

      Hi John and Becker,
      Thanks for you mail. As the maintainer of the code, I will call this a bug because we have no intention to ask every user to do the same the hack of yours.
      From you mail, it seems to me SphinxTrain was using deprecated <vararg.h> , I will just do a global replace in that case to fix the code.
      John, I want to know how unlimit gives you error, do you think you can send me the error message? Thanks in advance.

      Arthur

       
    • The Grand Janitor

      BTW, for SphinxTrain, please try to check out the code from CVS because it always contains the latest bug fixes. -Arthur

       
    • shirleyyyyy

      shirleyyyyy - 2005-01-26

      Hi all

      for those who install sphinxtrain using cygwin, is there any problem with the training? i have install it using cygwin that have gcc 3.3.3 and the training can't go through kmeans_init. full with empty cluster warning and failed finally

      after that, i try with redhat 8.0 and everything settled. i am curious why cygwin can't work with my sphinxtrain

      anyone can tell me why?

       
    • TusharP

      TusharP - 2005-02-28

      Download latest SphinxTrain from CVS and compile it under gcc 3.3.3 (Fedora 2)

      TusharP

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.