Unable to load package library with PAR facility, ROOT5.34/36

Hi ,
I have the following package that has directory structure that looks like this.

All the headers are in include/, library is built in lib/, binaries in bin/ . I am using cmake to build the software. I followed the event.par example in $ROOTSYS/tutorial/proof to use this package in PROOF. However somehow after successfull compilation it doesn’t seem to load the library of the package because of the wrong path. I am attaching modified BUILD.sh and SETUP.C here.

I am trying to run it locally currently.
The .par file and modified runProof.C is attached here.
On root terminal I do,

.L MaceSIM/lib/libMSimIO.so 
.include MaceSIM/include/
.L getProof.C++
.L runProof.C++
TList *ins = new TList()
ins -> Add(new MCskRunManager("steeringCard.in"))
runProof("event++(nevt=8)",0,4,ins)

Ok.
Now I have managed to compile it successfully in /tmp/$USER/.proof-tutorial/packages. In the BUILD.sh I also am able to set the environment variable “SiMACESYS” (which equals /tmp/$USER/.proof-tutorial/packages/MaceSIM as expected). However I in SETUP.C this variable seems to be empty again. Because of that my calls to

gSystem->AddIncludePath("$SiMACESYS/include")
gSystem->Load("$SiMACESYS/lib/libMSimIO")

fail.
Can you please help me in setting these path ?

Note that it should be:
gSystem->AddIncludePath("-I$SiMACESYS/include")

Hi,
Thanks for reply. I will correct that part.
But the main problem is that, environment variable “SiMACESYS” is empty
in SETUP.C . Because of that, I am unable to get the correct INCLUDE/LIB/BIN path for my package on the worker.
Also, gProofServ also seems to be NULL during the SETUP.C, which prohibits
the use of gProofServ->WrokingDirectory() from within SETUP.C.

Hi Chinmay,

I share with you my SETUP.C for one of my PAR archive. It load an external library which need an exported variable and one internal library located in ./lib according to the root of my PAR archive

[code]void SETUP()
{
cout << “-- SETUP.C” << endl;

    // External library
    {
            if( gSystem->Getenv("LIBUIUC") == "" ) {

                    cerr << "Library UIUC not found.. Please define LIBUIUC" << endl;
                   gSystem->Abort(0);
            }

            TString libName = "libUIUC.so";
            TString libPath = gSystem->Getenv("LIBUIUC");
            cout << "--> Loading library " << libName << ".. " << libPath << endl;
            gROOT->ProcessLine(TString(".include ") + libPath + "/include");
            gSystem->Load(libPath + TString("/lib/") + libName);
    }

    // Internal library
    { 
            TString libName = "libTFlux.so";
            TString libPath = "./lib";
            cout << "--> Loading library " << libName << ".. " << libPath << endl;
            gROOT->ProcessLine(TString(".include ") + libPath);
            gSystem->Load(libPath + TString("/") + libName);
    }

}[/code]

Does it help you ?

Yeah a solution similar to this does work for me.
I exported a variable MACESYS containing the package root path
And then it worked right.
Thanks. :slight_smile: