Aclic compilation

I have some troubles with ROOT 5.08b on solaris5.10, which I didn’t see before on the same platform (and same compiler CC 5.3) with 4.00.08 - TSystem::CompileMacro(…) does not compile. It fails without syntax or any errors in the code but the printout I get is
//======
Undefined first referenced symbol in file main /<compiler_instalation_directory>/lib/crt1.o
//===
and I can’t follow it. The same doesn’t occur when I try from a root session.

Can you give me any hints how to proceed?

I have only Solaris5.9 and I cannot reproduce your problem.
For example in the tutorials directory, I have no problems doing:

Rene

I also have no problems running small scripts but what I’m doing is a huge amount of code where one output is linked against a number of standalone libs. My concerns are libCstd - with >ldd $ROOTSYS/bin/root< or >ldd $ROOTSYS/bin/root.exe< I don’t see root is linked against libCstd.so and at the same time when I call TSystem::CompileMacro() an error concerning ostream is reported.
Can there be a relation between both?

The most likely cause is that not all libraries are built with the same compiler switch and you end up using 2 different iostream implementation.
To see the command line actually used set gDebug to 7:gDebug = 7;

Philippe.

Thanks,
but here comes another question from the printouts - is aclic using the default compiler (according to $PATH, which CC, …) and can I ask it
"which CC" it calls?

try this: gSystem->GetMakeExe() // or gSystem->GetMakeSharedLib()
and see:
root.cern.ch/root/htmldoc//TSyst … eSharedLib

Jan

Usually ACLiC uses the path to determine the compiler to use and uses the default compiler with the same name as the one used to compile ROOT.
In looking at the command line (either via gDebug=7 or via gSystem->GetMakeSharedLib()) you should be able to spot the name of the compiler and whether it is refer to by full pathname or not.

Philippe.

Thank you, Philippe,

I already checked this, changed the flags and came to the point where I started from - again

which is out of my access rights.

Ok.

I suspect that simply doing

root.exe root [] gSystem->Load("libTreePlayer");leads to the same error message. If this is the case, then either
a) your PATH and/or LD_LIBRARY_PATH is not correctly set.
b) the build is incorrect for your machine and you (or your admin) should rebuild it.

Philippe.

No, loading is OK, $LD_LIBRARY_PATH and $PATH - also.
Except this ldd produced_executable does not list libTreePlayer.so at all.

[quote]dd produced_executable
does not list libTreePlayer.so at all.[/quote]
If produced_executable is root.exe, it should not list libTreePlayer.so since this is do be loaded at run-time when needed.

But I am a little confused. Are you saying you can execute properly

but that loading the code compiled by ACLiC leads to

dlopen error: ld.so.1: /opt2/ROOT.5.08.00-SunOS5.10/bin/root.exe: fatal: relocation error: file /opt2/ROOT.5.08.00-SunOS5.10/lib/libTreePlayer.so: symbol __1cDstdNbasic_ostream4Ccn0ALchar_traits4Cc___2l6MX_r1_: referenced symbol not found??

Philippe

no, no, say produced executable is my_out
then ldd my_out does not list lidTreePlayer, in the used makefile I do not use it.
What I tried in fact, in order to follow if I have some linking error, is to produce a dictionary for one more class, then to load all the libraries (only one of them has something to do with root and doesn’t need libTreePlayer.so), to SetIncludePath() and to call aclic. This gave the cited result - the same from root and out of it session.

[quote]then ldd my_out does not list lidTreePlayer, in the used makefile I do not use it. [/quote]That sounds consistent.

[quote]What I tried in fact …[/quote]Sorry but I am even more confused :frowning:
Could you please be much more explicit explaining what you tried, how you tried it and what works and what does. Please give actual compile lines, code fragment, etc …

Philippe.

Excuse me if I’m not clear, it’s getting too confusing for me too.
So, this code was working on solaris5.10 with ROOT4.08. It needs a lot of external libraries as only one of them is using ROOT. External I use for libraries which are normally out of my touch but at the same time I can use a local self-compiled version in order to test.

We decided to go to v5.08 of ROOT and the only lib (call it libABC.so) which needs ROOT in fact seemed to work properly, but after recompiling my code, I couldn’t get any more CompileMacro() work - the error I already posted.

What we wanted to try then is to recompile libABC, use the new one, load all other necessary libraries in a session and check what happens there. Where ACliC comes in - it produces a library from a generated file where 3 classes are defined, each of them is public to an abstract class and then some calculations are performed. There are 4 more classes which define rules for access and calculations and we never had dictionaris for them - now there are in order to try from inside of ROOT.

Well, that was the result and I hope this is sufficient.

So let backup a little bit. Write a sample file testing.cxx:

// Start of testing.cxx #include <Riostream.h> void testing() { std::cout << "iostream works\n"; }and in a session of ROOT where you load NONE of your libraries do:

Then add the lines#include "TTreeFormula.h"andTTreeFormula *f = 0;to testing.cxx
and try the same thing.

Let me know of the results.

Philippe.

With small changes

[code]#include <Riostream.h>
#include “TTreeFormula.h”

void hell(){
cout << “ok iostream” << endl;
TTreeFormula *f = 0;
}[/code]

And the result

root [0] .L whatToHell.cpp++ Info in <TUnixSystem::ACLiC>: creating shared library /home/assova/source/daq/dbr/./whatToHell_cpp.so dlopen error: ld.so.1: /opt2/ROOT.5.08.00-SunOS5.10/bin/root.exe: fatal: relocation error: file /opt2/ROOT.5.08.00-SunOS5.10/lib/libTreePlayer.so: symbol __1cDstdNbasic_ostream4Ccn0ALchar_traits4Cc___2l6MX_r1_: referenced symbol not found Load Error: Failed to load Dynamic link library /home/assova/source/daq/dbr/./whatToHell_cpp.so Undefined first referenced symbol in file main /opt2/SUNWspro6/WS6U2/lib/crt1.o ld: fatal: Symbol referencing errors. No output written to /home/assova/source/daq/dbr/./eaab5aiUJ *** Interpreter error recovered *** root [1]

What does this mean to you?

What was the result without the TTreeFormula part?

Philippe

[code]#include <Riostream.h>
#include “TTreeFormula.h”

void hell(){
cout << “ok iostream” << endl;
//TTreeFormula *f = 0;
}[/code]

And result

root [1] .L whatToHell.cpp++ Info in <TUnixSystem::ACLiC>: creating shared library /home/assova/source/daq/dbr/./whatToHell_cpp.so root [2] hell() ok iostream root [3]

It is not used in my code, nor in the source for the other ROOT library.

Sorry,

in fact with a new session it crashed even only with included header (from the previous post) with the error

root [0] .L whatToHell.cpp++ Info in <TUnixSystem::ACLiC>: creating shared library /home/assova/source/daq/dbr/./whatToHell_cpp.so dlopen error: ld.so.1: /opt2/ROOT.5.08.00-SunOS5.10/bin/root.exe: fatal: relocation error: file /opt2/ROOT.5.08.00-SunOS5.10/lib/libTreePlayer.so: symbol __1cDstdNbasic_ostream4Ccn0ALchar_traits4Cc___2l6MX_r1_: referenced symbol not found Load Error: Failed to load Dynamic link library /home/assova/source/daq/dbr/./whatToHell_cpp.so Undefined first referenced symbol in file main /opt2/SUNWspro6/WS6U2/lib/crt1.o ld: fatal: Symbol referencing errors. No output written to /home/assova/source/daq/dbr/./eaaJta4j0 *** Interpreter error recovered *** root [1]

And without #include - fine

root [0] .L whatToHell.cpp++ Info in <TUnixSystem::ACLiC>: creating shared library /home/assova/source/daq/dbr/./whatToHell_cpp.so root [1] hell() ok iostream root [2]

And you can confirm whether gSystem->Load("libTreePlayer");
works correctly or not?