CVS check-out

The Parang package is available to people with access to the CMS CVS repository. If you want to compile it as part of a CMSSW project, you should check it out to the src directory of your current project ($CMSSW_BASE, if you have properly called cmsenv):

cd $CMSSW_BASE/src
cvs co -dUtilities/Parang UserCode/SAKoay/Utilities/Parang

If you want to compile it as a stand-alone library, you can put it anywhere as long as you preserve the Utilities/Parang directory structure. Utilities/Parang should contain the following sub-directories:

doc README, plus a Doxygen project file that can be used to generate HTML documentation.
interface The package code.
src
test Unit tests run by the author as zeroth-order checks that the package actually compiles (and doesn’t always segmentation fault).
bin Example applications using the Parang library. Also has example rootlogon.C and rootalias.C macros that you can adopt to make life easier.
visualc++ Visual C++ project, ready to go. If you don’t know what this is, you probably don’t care.

It also contains a BuildFile for building with SCRAM, and Makefile plus Makefile.arch for building with make.

p.s. If you are a first-time CVS user, you may not be able to check anything out until you do the following:

    echo "Please login to cvs (the password is 98passwd):"
    cmscvsroot CMSSW
    cvs login

Web download

A very lazily updated tarball of the entire package may be obtained here: Please note that this will rarely be the latest copy of the package unless you specifically remind the author.

Version Requirements

make compilation of Parang has been tested to work with ROOT version 5.18 up to 5.27. It will definitely not work with ROOT version 5.14 or below. 5.17 may work if you replace the Makefile.arch with your/path/to/root/test/Makefile.arch (rootconfig changed…).

SCRAM-based building of Parang has been tested to work with CMSSW up to 4.2.4. As long as your favorite version of CMSSW has ROOT 5.18 or above, it should be able to build Parang.

Building the Library

How To SCRAM

    cd $CMSSW_BASE/src/Utilities/Parang
    scram build

The Parang library can be found at $CMSSW_BASE/lib/$SCRAM_ARCH/libUtilitiesParang.so, and a program that runs some unit tests is $CMSSW_BASE/test/$SCRAM_ARCH/parangUnitTests.

How To make

    cd Utilities/Parang
    make

This creates the following directories:

cint CINT dictionaries generated from Utilities/Parang/src/ParangLinkDef.h.
lib Library object files from compiling the source files.

If successful, it will produce libUtilitiesParang.so, the Parang library, and parangUnitTests, a program that runs some unit tests, both in the Utilities/Parang directory.

make targets

make library Makes the Parang library (libUtilitiesParang.so in Linux/Unix).
make programs Makes Parang programs — out of the box this is parangUnitTests, but you can add more by following that example.
make all Equivalent to both make library and make programs.
make clean Deletes Parang-specific CINT dictionaries, libraries, and programs.
make distclean Deletes all CINT dictionaries, libraries, programs, and other build-related files.

make without a target is equivalent to make all.

How To VisualC++

TODO Probably broken right now, will fix.

There is a basic project file Utilities/Parang/visualc++/Parang.sln that you can load. It should be good to go.

You may want to change the file Utilities/Parang/visualc++/Parang/w32pragma.h, for example to the %ROOTSYS%\include\w32pragma.h in your installation of ROOT. The currently provided copy is the one for ROOT version 5.26.

Building Programs with the Library

SCRAM / Full Framework

In your BuildFile:

      <use name=Utilities/Parang>

Makefile

The provided Utilities/Parang/Makefile has rules for building both the Parang shared object library, and an example Parang-based program, parangUnitTests. You should be able to modify/copy the parangUnitTests rules to make your own executable.

ACliC / FWLite

(a.k.a. Dynamic Compilation in ROOT)

The Parang shared library needs to be loaded, and the Parang location needs to be added to the include paths, before you can compile programs that use Parang classes via the usual "root myMacro.cpp+" trick. You can do this with a rootlogon.C script:

{
   cout << "Loading Parang, a plot-making suite..." << flush;
   if (gSystem->Load("libUtilitiesParang") == 0) {
      gSystem->AddIncludePath(" -I$CMSSW_BASE/src ");
      cout << " OK. " << endl;
   }
   else  cout << " Uh oh! " << endl;
}

The script must have the name rootlogon.C, and must reside in the directory from which you want to compile programs from, in order for it to be automatically loaded by ROOT. You can read about the use of rootlogon scripts in the ROOT manual. You may furthermore have to change the include path as shown in line 4 to the directory in which you have put your copy of Utilities/Parang.

If the above rootlogon.C is loaded, the following macro will now compile:

#if !defined(__CINT__) || defined(__MAKECINT__)
#include "Utilities/Parang/interface/Printer.h"
#include "Utilities/Parang/interface/Procedures.h"
#endif
     
   
Int_t hello_parang_world()
{
  Printer   greetings;
  greetings.setRow(0, Procedures::tokenize("Welcome to the Parang world :-)", " "));
  greetings.print();
  return 0;
}

That is, you just need to call from the command-line:

[prompt@somewhere]  root hello_parang_world.cpp+

If you do not want to mess around with rootlogon, you must compile the macro “indirectly” via another macro (which can only be executed, not compiled):

{
   gSystem->Load("libUtilitiesParang");
   gSystem->AddIncludePath(" -I$CMSSW_BASE/src ");
   gROOT->Macro("hello_parang_world.cpp+");
}

[prompt@somewhere]  root compile_hello_parang_world.C

CINT Session

root [0]  gSystem->Load("libUtilitiesParang")
(int)0
root [1]

The above will allow you to use most of the Parang classes interactively. There are some known issues with templated functions, but the “normal” functions should work just fine.

In case you see "undefined symbol: _ZTI12TLegendEntry"

root [0]  gSystem->Load("libGraf")
(int)0
root [1]  gSystem->Load("libUtilitiesParang")
(int)0
root [2]

The author does not know how to make ROOT load the standard ROOT library libGraf on its own. If you understand the cause of and/or solution to this issue, please do tell.

-- SueAnnKoay - 15-Jun-2011

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip parang_20110614.zip r1 manage 655.1 K 2011-06-14 - 01:59 SueAnnKoay Parang source code, 14 June 2011
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2011-06-15 - SueAnnKoay
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback