calling ROOT routines in FLUKA

From: <francesca.belloni_at_libero.it>
Date: Wed, 15 Feb 2012 12:59:35 +0100 (CET)

Dear all,
        I am trying to call someROOT routines inside a source.f file.
I have modified the example http://www.fluka.org/fluka.php?
id=examples&sub=example3&node=4 and everything runs fine.
But not being acquainted with creating classes, dictionaries, makefiles...I
modified that mechanically.

   Since I am filling a simple TTree, I decided to simplify the procedure (no
dictionary anymore). But I make something wrong in the Makefile.
I have no idea if I should tell to use ROOTLIBS and how, or if the mistake is
another.

I oversimplified the called routines (just a printf), but I still get the same
error.
Could someone give a look, please?

Thanks a lot,
regrads,
bye,
Francesca

I have:

1. a file FluLib2.cpp (in attachment)
2. a source.f containing the line

CALL myuserini()

3. the Makefile (in attachment)

The output, when I run the makefile, is

Generating Library
FluLib2...

my-gcc -c FluLib2.cpp -pthread -m64 -
I/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/root64/root/include

/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012/flutil/fff source.
f
/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012/flutil/lfluka -o rootfluka
-m fluka source.o FluLib2.
o
$FLUPRO =
/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012

  now
linking

/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012
my-gfortran
ar x /home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012/libflukahp.a fluka.o
rm: cannot remove `rootfluka.map': No such file or directory
my-gfortran -msse2 -mfpmath=sse -fPIC -O3 -g -mtune=generic -fexpensive-
optimizations -funroll-loops -fstrength-reduce -std=legacy -Wall -
Wuninitialized -Wno-tabs -Wline-truncation -Wno-unused-function -Wno-unused-
parameter -Wno-unused-dummy-argument -Wno-unused-variable -Wunused-label -
Waggregate-return -Wcast-align -Wsystem-headers -ftrapping-math -frange-check -
fbackslash -fdump-core -fbacktrace -ffpe-trap=invalid,zero,overflow -finit-
local-zero -ffixed-form -ffixed-line-length-80 -frecord-marker=4 -funderscoring
-fno-automatic -fd-lines-as-comments -fbounds-check -
I/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012/flukapro -v -o rootfluka -
Xlinker -Map -Xlinker rootfluka.map fluka.o source.o FluLib2.o -
L/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012 -lflukahp
Driving: my-gfortran -msse2 -mfpmath=sse -fPIC -O3 -g -mtune=generic -
fexpensive-optimizations -funroll-loops -fstrength-reduce -std=legacy -Wall -
Wuninitialized -Wno-tabs -Wline-truncation -Wno-unused-function -Wno-unused-
parameter -Wno-unused-dummy-argument -Wno-unused-variable -Wunused-label -
Waggregate-return -Wcast-align -Wsystem-headers -ftrapping-math -frange-check -
fbackslash -fdump-core -fbacktrace -ffpe-trap=invalid,zero,overflow -finit-
local-zero -ffixed-form -ffixed-line-length-80 -frecord-marker=4 -funderscoring
-fno-automatic -fd-lines-as-comments -fbounds-check -
I/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012/flukapro -v -o rootfluka -
Xlinker -Map -Xlinker rootfluka.map fluka.o source.o FluLib2.o -
L/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012 -lflukahp -l gfortran -l m
-shared-libgcc
Using built-in specs.
COLLECT_GCC=my-gfortran

COLLECT_LTO_WRAPPER=/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/libexec/gcc/x86_64-
unknown-linux-gnu/4.6.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --
prefix=/home/gpfs/manip/mnt23/mnm/ntof/programs/usr --enable-languages=c,c++,
fortran --with-gmp=/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/ --with-
mpfr=/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/ --with-
mpc=/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/ --program-prefix=my-
Thread model: posix
gcc version 4.6.2 (GCC)
Reading specs from /home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-
unknown-linux-gnu/4.6.2/../../../../lib64/libgfortran.spec
rename spec lib to liborig
COLLECT_GCC_OPTIONS='-msse2' '-mfpmath=sse' '-fPIC' '-O3' '-g' '-
mtune=generic' '-fexpensive-optimizations' '-funroll-loops' '-std=legacy' '-
Wall' '-Wuninitialized' '-Wno-tabs' '-Wline-truncation' '-Wno-unused-function'
'-Wno-unused-parameter' '-Wno-unused-dummy-argument' '-Wno-unused-variable' '-
Wunused-label' '-Waggregate-return' '-Wcast-align' '-Wsystem-headers' '-
ftrapping-math' '-frange-check' '-fbackslash' '-fdump-core' '-fbacktrace' '-
ffpe-trap=invalid,zero,overflow' '-finit-local-zero' '-ffixed-form' '-ffixed-
line-length-80' '-frecord-marker=4' '-funderscoring' '-fno-automatic' '-fd-
lines-as-comments' '-fbounds-check' '-I'
'/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012/flukapro' '-v' '-o'
'rootfluka' '-L/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012' '-shared-
libgcc' '-march=x86-64'
COMPILER_PATH=/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/libexec/gcc/x86_64-
unknown-linux-gnu/4.6.2/:
/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/libexec/gcc/x86_64-unknown-linux-
gnu/4.6.2/:/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/libexec/gcc/x86_64-
unknown-linux-gnu/:/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-
unknown-linux-gnu/4.6.2/:
/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/bin/../lib64/:/sbin/../lib64/:/usr/bin/../lib64/:/usr/sbin/..
/lib64/:/etc/../lib64/:/usr/local/sbin/../lib64/:/usr/local/bin/../lib64/:
/usr/local/../lib64/:
/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-linux-gnu/4.
6.2/:/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-linux-
gnu/4.6.2/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:
/usr/local/clunix/bin.Linux/:./:/bin/:/sbin/:/usr/bin/:/usr/sbin/:/usr/bin/X11/:
/etc/:/usr/local/sbin/:/usr/local/bin/:/home/usr200/mnt/spec/:
/home/usr200/mnt/comm/bin/:/usr/local/:/scratch/root/bin/:
/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-linux-gnu/4.
6.2/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-msse2' '-mfpmath=sse' '-fPIC' '-O3' '-g' '-
mtune=generic' '-fexpensive-optimizations' '-funroll-loops' '-std=legacy' '-
Wall' '-Wuninitialized' '-Wno-tabs' '-Wline-truncation' '-Wno-unused-function'
'-Wno-unused-parameter' '-Wno-unused-dummy-argument' '-Wno-unused-variable' '-
Wunused-label' '-Waggregate-return' '-Wcast-align' '-Wsystem-headers' '-
ftrapping-math' '-frange-check' '-fbackslash' '-fdump-core' '-fbacktrace' '-
ffpe-trap=invalid,zero,overflow' '-finit-local-zero' '-ffixed-form' '-ffixed-
line-length-80' '-frecord-marker=4' '-funderscoring' '-fno-automatic' '-fd-
lines-as-comments' '-fbounds-check' '-I'
'/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012/flukapro' '-v' '-o'
'rootfluka' '-L/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012' '-shared-
libgcc' '-march=x86-64'
  /home/gpfs/manip/mnt23/mnm/ntof/programs/usr/libexec/gcc/x86_64-unknown-linux-
gnu/4.6.2/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-
x86-64.so.2 -o rootfluka /usr/bin/../lib64/crt1.o /usr/bin/../lib64/crti.o
/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-linux-gnu/4.
6.2/crtbegin.o -L/home/gpfs/manip/mnt23/mnm/ntof/fbelloni/FLUKA_2012 -L/bin/..
/lib64 -L/sbin/../lib64 -L/usr/bin/../lib64 -L/usr/sbin/../lib64 -L/etc/..
/lib64 -L/usr/local/sbin/../lib64 -L/usr/local/bin/../lib64 -L/usr/local/..
/lib64 -L/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-
linux-gnu/4.6.2 -L/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-
unknown-linux-gnu/4.6.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -
L/usr/local/clunix/bin.Linux -L. -L/bin -L/sbin -L/usr/bin -L/usr/sbin -
L/usr/bin/X11 -L/etc -L/usr/local/sbin -L/usr/local/bin -L/home/usr200/mnt/spec
-L/home/usr200/mnt/comm/bin -L/usr/local -L/scratch/root/bin -
L/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-linux-
gnu/4.6.2/../../.. -Map rootfluka.map fluka.o source.o FluLib2.o -lflukahp -
lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/home/gpfs/manip/mnt23/mnm/ntof/programs/usr/lib/gcc/x86_64-unknown-linux-gnu/4.
6.2/crtend.o /usr/bin/../lib64/crtn.o
FluLib2.o: In function `__static_initialization_and_destruction_0(int, int)':
FluLib2.cpp:(.text+0x393): undefined reference to `TVersionCheck::TVersionCheck
(int)'
collect2: ld returned 1 exit status

Received on Sat Feb 18 2012 - 09:55:22 CET

This archive was generated by hypermail 2.2.0 : Sat Feb 18 2012 - 09:55:53 CET