Hugonweb | Creating CMSSW Executables

Make a bin/ subdirectory of a package. Put a build file in there like this:

<bin name="exeName" file="codeName.cpp">
  <use   name="root"/>
</bin>

Libraries are auto-linked and the binary placed in the path, so this will run it:

$ scram b
$ exeName
Using Boost

To use the boost libraries, Add these inside your executable in the build file:

  <use   name="boost"/>
  <lib   name="boost_filesystem"/>
  <lib   name="boost_regex"/>

and these headers:

#include <boost/filesystem.hpp>
#include <boost/regex.hpp>

Links to Boost Docs:

http://www.boost.org/doc/libs/1_47_0/libs/regex/doc/html/boost_regex/introduction_and_overview.html http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/tutorial.html