Problem with building nco on OpenSUSE

Help
allencapa
2013-12-17
2014-01-06
  • allencapa
    allencapa
    2013-12-17

    Hi all,
    I was trying to build nco 4.3.9 on OpenSUSE 12.3 and encontered the following problem

    test -f ncap_yacc.c || /bin/sh ../../autobld/ylwrap ncap_yacc.y y.tab.c ncap_yacc.c y.tab.h echo ncap_yacc.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/ y.output ncap_yacc.output -- byacc -d --name-prefix=nco_yy
    byacc: e - line 97 of "/home/allen/Software/netcdf/nco-4.3.9/src/nco/ncap_yacc.y", syntax error
    %parse-param {prs_sct *prs_arg}
    ^

    I guess there may be something wrong with the src/nco/ncap_yacc.y
    The byacc is "byacc - 1.9 20100216"

    Thank you

     
  • Charlie Zender
    Charlie Zender
    2013-12-17

    NCO, and ncap in particular, should be compiled using bison not byacc.
    Please install bison (and flex) and re-try.
    I'm surprised byacc (berkeley yacc) was invoked.
    Pretty sure NCO uses features that only bison supports, but could be wrong.
    cz

     
    • allencapa
      allencapa
      2013-12-26

      Hi CZ,
      Thank you for the reply
      I tried to install after removing byacc, but failed again

      test -f ncap_yacc.c || /bin/sh ../../autobld/ylwrap ncap_yacc.y y.tab.c ncap_yacc.c y.tab.h echo ncap_yacc.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/ y.output ncap_yacc.output -- byacc -d --name-prefix=nco_yy
      ../../autobld/ylwrap: line 113: byacc: command not found

      So it seems that byacc is used in this script?

      If set "alias byacc=bison", the same error recured,

      test -f ncap_yacc.c || /bin/sh ../../autobld/ylwrap ncap_yacc.y y.tab.c ncap_yacc.c y.tab.h echo ncap_yacc.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/ y.output ncap_yacc.output -- byacc -d --name-prefix=nco_yy
      byacc: e - line 97 of "/home/allen/Software/netcdf/nco-4.3.9/src/nco/ncap_yacc.y", syntax error
      %parse-param {prs_sct *prs_arg}

      Thank you

       
      Last edit: allencapa 2013-12-26
  • Charlie Zender
    Charlie Zender
    2014-01-06

    Hello Alan,
    I do not know where/how/why byacc is called.
    It is not in autobld/ylwrap, nor in configure.ac, nor in Makefile.am.
    It puzzles me.

    If set "alias byacc=bison", the same error recured,

    Suggest you remove byacc and try, as root, in /usr/bin,

    ln -s bison byacc

    cz