Re: Makefile for Root

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Tue, 3 Jun 2008 08:35:00 +0200


In your Makefile, I do not see -lPhysics specified in the list of libs. I cannot test your system, several files are missing. Anyhow, I strongly suggest that instead of Makefules you use simply ACLIC. This will make your program simpler and portable on all architectures. To do that simply replace in Convert.C   //Load the Physics library - needed for the boost & rotations   gSystem->Load("libPhysics.dylib");
  //Load library
  gSystem->Load("Test/libTTree.dylib");

by
  gROOT->ProcessLine(".L Track.cxx+");
  gROOT->ProcessLine(".L Event.cxx+");

then, in ROOT, simply do:
  root > .x Convert.C(1,1)

Rene

Michael Mitrovski wrote:
> Dear Rene,
>
> Thanks for the suggestion. I tried it out but I have still problems to
> use my Macro. Attached you can find my classes (Event.cxx, Event.h,
> Track.cxx, Track.h), my Macro (Convert.C) and the Makefile. I would
> appreciate if you could take a look where I am doing the mistake in my
> Makefile. Thanks a lot in advance.
>
> Best regards,
>
> Michael
>
>
>
>
>
>
>
> Am 02.06.2008 um 17:13 schrieb Rene Brun:
>
>> Add -lPhysics to your ROOTLIBS definition, ie
>> ROOTLIBS = $(shell root-config --libs) -lPhysics -lThread
>> -lMinuit -lHtml -lVMC -lEG -lGeom -L/usr/local/lib
>>
>>
>> Rene Brun
>>
>> Michael Mitrovski wrote:
>>> Dear Rooters,
>>>
>>> I wrote some classes to convert a txt file into TTrees. Compiling
>>> the classes under Scientific Linux SLC 4.4 x86_64 with gcc version
>>> 3.4.6 works fine. Trying to compile the classes under MacOSX Tiger
>>> (10.4) with gcc version 3.3 works without error message too. When
>>> starting a macro under MacOSX which uses compiled dynamic library
>>> above I receive the following error message:
>>>
>>> root [0] .x Convert.C(1,1)
>>> Error in <TUnixSystem::DynamicPathName>: libPhysics.dylib[.so | .sl
>>> | .dl | .a | .dll] does not exist in
>>> .:/Users/mmitrov/root/lib:/Users/mmitrov/root/lib:/Users/mmitrov/root/lib:
>>>
>>> Error in <TUnixSystem::DynamicPathName>:
>>> /Users/mmitrov/Desktop/Physik/UrQMD_Project/Event_by_Event_Fluctuation/UrQMD/TTree/lib/lib/libTTree.dylib[.so
>>> | .sl | .dl | .a | .dll] does not exist in
>>> .:/Users/mmitrov/root/lib:/Users/mmitrov/root/lib:/Users/mmitrov/root/lib:
>>>
>>> Read file :
>>> /Users/mmitrov/Desktop/Physik/UrQMD_Project/Event_by_Event_Fluctuation/UrQMD/TTree/Output_UrQMD/UrQMD_Output_File_1.txt
>>>
>>> Outputfile:
>>> /Users/mmitrov/Desktop/Physik/UrQMD_Project/Event_by_Event_Fluctuation/UrQMD/TTree/ROOT_Output/PbPb_158AGeV_1.root
>>>
>>> Error: Symbol Event is not defined in current scope Convert.C:45:
>>> Error: Symbol Event is not defined in current scope Convert.C:45:
>>> Error: type Event not defined
>>> FILE:/Users/mmitrov/Desktop/Physik/UrQMD_Project/Event_by_Event_Fluctuation/UrQMD/TTree/macros/./Convert.C
>>> LINE:45
>>> Warning: Automatic variable Event*event is allocated Convert.C:45:
>>> Error: Undeclared variable Event*event Convert.C:45:
>>> *** Interpreter error recovered ***
>>>
>>> I think there is something wrong with my Makefile. You can find it
>>> attached. Thanks for the help in advance.
>>>
>>> Best regards,
>>>
>>> Michael
>>>
>>>
>>
>
Received on Tue Jun 03 2008 - 08:35:24 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 03 2008 - 11:50:01 CEST