Undefined reference linking ACliC_dict.o

Hello,
I am trying to run my analysis program, but I obtain the follow error:
/f2users/lquadran/macro_new/src/analysis_C_ACLiC_dict.o(.text+0x35): In function analysis::UBegin()': : undefined reference toTOF_charge::Begin()’
/f2users/lquadran/macro_new/src/analysis_C_ACLiC_dict.o(.text+0x63): In function analysis::UProcessFill()': : undefined reference toTOF_charge::Fill()’
/f2users/lquadran/macro_new/src/analysis_C_ACLiC_dict.o(.text+0xf5): In function analysis::UTerminate()': : undefined reference toTOF_charge::Terminate()’
*** Interpreter error recovered ***

The Makefile I use is:
CXX = icc

SRC = /f2users/lquadran/macro_new/src
INC = /f2users/lquadran/macro_new/include
DIC = /f2users/lquadran/macro_new/dict

SRCS = (SRC)/analysis.C (SRC)/TOF_charge.C
INCS = (INC)/analysis.h (INC)/TOF_charge.h (DIC)/analysis_LinkDef.h DICT = (DIC)/analysis_dict.C

PROGRAM = analysis

CXXFLAG = -g -Wall -I$(ROOTSYS)/include -I$(INC) root-config --cflags --glibs
AMSLIB = /f2users/lquadran/AMS/lib/linux/ntuple_slc4_icc.so

all: $(PROGRAM)

(PROGRAM): (SRCS)
@echo “Generating Dictionary …”
rootcint -f (DICT) -c (INCS)
@echo "Compiling and Linking (PROGRAM) ..." (CXX) (SRCS) (DICT) (CXXFLAG) (AMSLIB) -o $(PROGRAM)
@echo “done”

clean:
@rm -f $(PROGRAM)

In attachment you can find the source code of my program.
Thanks.
Lucio
analysis.C (1.24 KB)
TOF_charge.h (157 Bytes)
analysis.h (331 Bytes)
TOF_charge.C (277 Bytes)

Hi,

I don’t get the connection between your Makefile and ACLiC: why and where does your Makefile invoke ACLiC (gSystem->CompileMacro() or .L analysis.C+)?

Cheers, Axel.

I generate the dictionary with
DIC = /f2users/lquadran/macro_new/dict
INC = /f2users/lquadran/macro_new/include

rootcint -f $(DIC)/analysis_dict.C -c $(INC)/analysis.h $(INC)/TOF_charge.h $(DIC)/analysis_LinkDef.h

where $(DIC)/analysis_LinkDef.h:
#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class analysis+;
#pragma link C++ class TOF_charge+;
#endif

Lucio

Hi,

I still don’t understand what you are doing, i.e. what makes the ACLiC file appear. Could you post the complete input and output, i.e. showing what exactly you do, and what exactly it prints? If it involves runnign something inside ROOT, could you simply say
root [0] gDebug=7
and then proceed with what you were doing before, and again send us the in- and output?

Cheers, Axel.

Hi,

You makefile is missing the step were your create the shared library itself (using the 3 .o files).

The error your show, indicates that you have created the library using aclic (by doing something like .L analysis.C+).

Technically you can probably solve that problem by loading (via ACLiC) the library for TOF_charge first, i.e. do .L TOF_charge.C+ .L analysis.C+

Cheers,
Philippe.

Hi,
I do make… the output is in attachment (makeout.txt)… a lot of remark and warning, but no errors.
The I run my standalone program (analysis), with the command:
bsub < myscript

myscript:

#!/bin/tcsh
#BSUB -J analysis # Name of the job.
#BSUB -o %J.out # Appends std output to file %J.out. (%J is the Job ID)
#BSUB -e %J.err # Appends std error to file %J.err.
#BSUB -m pcamsr1 # External host: ams, pcamsr0 or pcamsr1, pcamsf3, pcamsf4
#BSUB -q 8nm # Queue name: 8nm=8min; 1nh=1hour; 8nh=8hour; 1nd=1day; 1nw=1week; 2nw=2week
#BSUB -n 1 # Number of CPUs.

submit jobs

bsub < myscript

setenv WORKDIR /f2users/lquadran/macro_new
setenv SRCDIR $WORKDIR/CC
if ( -f $WORKDIR/analysis ) then
echo "Running "$WORKDIR/analysis
# Run serial executable on 1 cpu of one SMP node
$WORKDIR/analysis
else
echo “Error running “$WORKDIR/analysis”. Read file job.err”
endif
#End of LSF Script

and obtain two files 12541.err and 12541.out, with the errors and the output (in attachment).

Cheers,
Lucio
makeout.txt (138 KB)
12541.out.txt (2.54 KB)
12541.err.txt (7.17 KB)

Hi,

It looks like you are compiling your library using icc while using a version of ROOT compiled with icc. This might be a problem.

Also the code in analysis.C is requesting ROOT to ‘recompile’ the file analysis.C! This is done via: char classfile[100]="/f2users/lquadran/macro_new/src/analysis.C+"; .... chain.Process(classfile,rfile);where the analysis.C+ ask ROOT to compile the file analysis.C … which is not needed since you already did! This should lead to duplicated symbols (but instead because of the gcc/icc issue it seems to lead to unresolved symbols).

Either way, using the following pattern will work better!: analysis *selector = new analysis(); chain.Process(selector,rfile);

In addition do NOT use gROOT->Reset() instead a function.
Also you should not need to call gApplication->Terminate();
in analysis::UTerminate() … If you mean to exit the process at the end of the chain.Process, just do not include the call to theApp.Run().

Cheers,
Philippe.

Thank you very much… now it works :smiley: .
Cheers,
Lucio