[Rivet-svn] r1869 - in trunk/src: . Tools

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Oct 5 16:36:13 BST 2009


Author: buckley
Date: Mon Oct  5 16:36:13 2009
New Revision: 1869

Log:
If yaml-cpp not found, use the pre-install .la file when linking Rivet (otherwise make fails until make install has been run in the yaml-cpp directory)

Modified:
   trunk/src/Run.cc
   trunk/src/Tools/Makefile.am

Modified: trunk/src/Run.cc
==============================================================================
--- trunk/src/Run.cc	Mon Oct  5 15:44:31 2009	(r1868)
+++ trunk/src/Run.cc	Mon Oct  5 16:36:13 2009	(r1869)
@@ -5,9 +5,9 @@
 #include "Rivet/Projections/Beam.hh"
 #include <limits>
 
-
 namespace Rivet {
 
+
   Run::Run(AnalysisHandler& ah) : _ah(ah), _xs(-1.0),
     _maxEvtNum(std::numeric_limits<long>::max()), _numEvents(0) {
   }
@@ -89,23 +89,25 @@
         if (_ah.needCrossSection()) {
           Log::getLog("Rivet.Run") << Log::ERROR
               << "Total cross-section needed for at least one of the analyses. "
-              << "Please set it on the command line." << endl;
+              << "Please set it (on the command line with '-x' if using the 'rivet' program)" << endl;
           return false;
         }
       }
-      
+
+      // Analyze event and delete HepMC event object      
       _ah.analyze(*evt);
       delete evt;
-      
+
+      // Increment, log, and check event number 
       ++_numEvents;
       logNEvt();
+      if (_numEvents == _maxEvtNum) return false;
       
-      if (_numEvents==_maxEvtNum) {
-        return false;
-      }
-      
+      /// @todo Can we just clear the event, to save on all this mallocing?
       evt = new GenEvent();
     }
+
+    // Final HepMC object clean-up
     delete evt;
     delete io;
     

Modified: trunk/src/Tools/Makefile.am
==============================================================================
--- trunk/src/Tools/Makefile.am	Mon Oct  5 15:44:31 2009	(r1868)
+++ trunk/src/Tools/Makefile.am	Mon Oct  5 16:36:13 2009	(r1869)
@@ -25,5 +25,9 @@
   -DDEFAULTDATADIR=\"$(datadir)\" \
   -DDEFAULTLIBDIR=\"$(libdir)\"
 
+if WITH_YAML_CPP
 libRivetTools_la_LDFLAGS = $(AM_LDFLAGS) -L$(builddir)/yaml-cpp
 libRivetTools_la_LIBADD = -lyaml-cpp
+else
+libRivetTools_la_LIBADD = $(builddir)/yaml-cpp/libyaml-cpp.la
+endif


More information about the Rivet-svn mailing list