Search code examples
c++makefile

Herwig bootstrap: AnalysisObject.h error: ‘numeric_limits’ is not a member of ‘std’


when Installing Herwig using the bootstrap script method, got an error,

Making all in .
  CXX      libYODA_la-Reader.lo
  CXX      libYODA_la-ReaderYODA.lo
In file included from ../include/YODA/Reader.h:9,
                 from Reader.cc:6:
../include/YODA/AnalysisObject.h: In member function ‘void YODA::AnalysisObject::setAnnotation(const std::string&, double)’:
../include/YODA/AnalysisObject.h:160:36: error: ‘numeric_limits’ is not a member of ‘std’
  160 |       ss << std::setprecision(std::numeric_limits<double>::max_digits10) << std::scientific << value;                          
      |                                                                  
make[2]: *** [Makefile:577: libYODA_la-Reader.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:584: libYODA_la-ReaderYODA.lo] Error 1
make[1]: *** [Makefile:736: all-recursive] Error 1
make: *** [Makefile:515: all-recursive] Error 1
Traceback (most recent call last):
  File "./herwig-bootstrap", line 921, in <module>
    compile([] if opts.yoda_root else ['--disable-root'])
  File "./herwig-bootstrap", line 611, in compile
    check_call(["make","-s","-j%s" % opts.ncore])
  File "./herwig-bootstrap", line 490, in check_call
    subprocess.check_call(arglist)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-s', '-j2']' returned non-zero exit status 2

How to solve this issue? I was trying to install Herwig7 (event generator in particle physics).


Solution

  • That bootstrap script tries to install YODA 1.8.1 by default.

    The changelog of YODA 1.9.0 contains the following:

    2021-03-26  Andy Buckley  <[email protected]>
    
        * Add <limits> header include to AnalysisObject.h to support GCC11
        (cf. http://gcc.gnu.org/gcc-11/porting_to.html)
    

    You can fix it by bumping the default version on line 173 or by invoking the bootstrap script with --with-yoda-ver=1.9.0 (or later, they are up to 1.9.5 as of May 2022).

    Even better, you should submit an issue or patch to this "Herwig" project and tell them to update their dependencies.