[Rivet] compile error and patch: OSX 10.6.8 or more std C++ compiler

William Hamish Bell w.bell at cern.ch
Fri Mar 15 14:18:49 GMT 2013


Hi,

Compilation of Rivet 1.8.2 fails on OSX 10.6.8:

[wbell at pb-d-128-141-35-96 ~]$ ./rivet-bootstrap --prefix="/opt/rivet/1.8.2/macosx106-x86_64-gcc-4.2" --with-gsl=/opt/local --with-boost=/opt/local
Getting http://www.hepforge.org/archive/rivet/Rivet-1.8.2.tar.gz
Not overwriting tarball at /Users/wbell/downloads/Rivet-1.8.2.tar.gz
Configuring in /Users/wbell/build/Rivet-1.8.2: ./configure --prefix=/opt/rivet/1.8.2/macosx106-x86_64-gcc-4.2  --with-lcgtag=i386-mac106-gcc42-opt --with-hepmc=/opt/rivet/1.8.2/macosx106-x86_64-gcc-4.2 --with-boost=/opt/local --with-fastjet=/opt/rivet/1.8.2/macosx106-x86_64-gcc-4.2 --disable-pdfmanual --with-gsl=/opt/local

Building in /Users/wbell/build/Rivet-1.8.2: make -j2 && make -j2 install
Making all in src
Making all in Core
  CXX    libRivetCore_la-Jet.lo
  CXX    libRivetCore_la-Event.lo
  CXX    libRivetCore_la-Particle.lo
  CXX    libRivetCore_la-ParticleName.lo
  CXX    libRivetCore_la-ProjectionApplier.lo
  CXX    libRivetCore_la-Projection.lo
  CXX    libRivetCore_la-Analysis.lo
  CXX    libRivetCore_la-AnalysisLoader.lo
  CXX    libRivetCore_la-AnalysisInfo.lo
  CXX    libRivetCore_la-AnalysisHandler.lo
  CXX    libRivetCore_la-Run.lo
  CXX    libRivetCore_la-ProjectionHandler.lo
  CXX    libRivetCore_la-HistoHandler.lo
  CXXLD  libRivetCore.la
Making all in Projections
  CXX    BeamThrust.lo
  CXX    Beam.lo
  CXX    ChargedFinalState.lo
  CXX    ChargedLeptons.lo
  CXX    CentralEtHCM.lo
  CXX    ClusteredPhotons.lo
  CXX    DISFinalState.lo
  CXX    DISKinematics.lo
  CXX    DISLepton.lo
  CXX    FastJets.lo
  CXX    FinalState.lo
  CXX    FoxWolframMoments.lo
  CXX    FParameter.lo
  CXX    HadronicFinalState.lo
  CXX    NonHadronicFinalState.lo
  CXX    Hemispheres.lo
  CXX    IdentifiedFinalState.lo
  CXX    InitialQuarks.lo
  CXX    InvMassFinalState.lo
  CXX    JetAlg.lo
  CXX    JetShape.lo
  CXX    LeadingParticlesFinalState.lo
  CXX    LeptonClusters.lo
  CXX    MergedFinalState.lo
  CXX    MissingMomentum.lo
  CXX    Multiplicity.lo
  CXX    NeutralFinalState.lo
  CXX    ParisiTensor.lo
  CXX    PVertex.lo
  CXX    Sphericity.lo
  CXX    Spherocity.lo
  CXX    SVertex.lo
  CXX    Thrust.lo
  CXX    TotalVisibleMomentum.lo
  CXX    TriggerCDFRun0Run1.lo
  CXX    TriggerCDFRun2.lo
  CXX    TriggerUA5.lo
  CXX    UnstableFinalState.lo
  CXX    VetoedFinalState.lo
  CXX    VisibleFinalState.lo
  CXX    WFinder.lo
  CXX    ZFinder.lo
  CXXLD  libRivetProjections.la
Making all in Tools
Making all in yaml-cpp
  CXX    emitterstate.lo
  CXX    aliascontent.lo
  CXX    map.lo
  CXX    parser.lo
  CXX    scanscalar.lo
  CXX    sequence.lo
  CXX    stream.lo
  CXX    parserstate.lo
  CXX    scalar.lo
  CXX    emitterutils.lo
  CXX    iterator.lo
  CXX    node.lo
  CXX    scantag.lo
  CXX    conversion.lo
  CXX    null.lo
  CXX    regex.lo
  CXX    scanner.lo
  CXX    simplekey.lo
  CXX    tag.lo
  CXX    emitter.lo
  CXX    exp.lo
  CXX    ostream.lo
  CXX    scantoken.lo
  CXXLD  libyaml-cpp.la
  CXX    libRivetTools_la-Logging.lo
  CXX    libRivetTools_la-RivetAIDA.lo
In file included from ../../include/LWH/Histogram1D.h:10,
                 from ../../include/LWH/HistogramFactory.h:9,
                 from ../../include/LWH/AnalysisFactory.h:10,
                 from RivetAIDA.cc:6:
../../include/LWH/Axis.h: In member function 'virtual int LWH::Axis::coordToIndex(double) const':
../../include/LWH/Axis.h:118: error: 'isnan' was not declared in this scope
  CXX    libRivetTools_la-RivetPaths.lo
../../include/Rivet/Math/MathHeader.hh: At global scope:
../../include/Rivet/Math/MathHeader.hh:44: warning: 'Rivet::MAXINT' defined but not used
make[3]: *** [libRivetTools_la-RivetAIDA.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

--------------

where the gsl and boost libraries were make using macports.

The fix is very simple

    assert( ! std::isnan(coord) );

rather than

    assert( ! isnan(coord) );

In the C++ standard isnan should be inside std.  Therefore, the LINUX compiler gcc43 is just being sloppy.  Would it be possible to put this fix in?

Thanks and best regards,

Will


More information about the Rivet mailing list