Re: rootfluka example ("rootfluka" cannot run on 64-bit architecture)

From: Vassili Maroussov <Vassili.Maroussov_at_cern.ch>
Date: Wed, 24 Feb 2010 14:01:34 +0100

Dear Marco,

sure, the "lfluka" script links the ResultsDict.o to "rootfluka"
executable, here is a fragment of "make -f Makefile.static" output
(where the ResultsDict.o is clearly presented) along with the screen
output of the "rootfluka" run:

******

g77 -O3 -g -mcpu=pentiumpro -fexpensive-optimizations -funroll-loops
-fstrength-reduce -Wall -fno-automatic -fno-silent -m32
-ffortran-bounds-check -I/home/testuser/fluka/2008.3c/flukapro -v -o
rootfluka -Xlinker -Map -Xlinker rootfluka.map fluka.o usrini.o usrout.o
mgdraw.o FluLib.o Results.o ResultsDict.o -L/home/testuser/fluka/2008.3c
-lRoot -lstdc++ -ldl -lcurses -lpthread -lflukahp
Driving: g77 -O3 -g -mcpu=pentiumpro -fexpensive-optimizations
-funroll-loops -fstrength-reduce -Wall -fno-automatic -fno-silent -m32
-ffortran-bounds-check -I/home/testuser/fluka/2008.3c/flukapro -v -o
rootfluka -Xlinker -Map -Xlinker rootfluka.map fluka.o usrini.o usrout.o
mgdraw.o FluLib.o Results.o ResultsDict.o -L/home/testuser/fluka/2008.3c
-lRoot -lstdc++ -ldl -lcurses -lpthread -lflukahp -lfrtbegin -lg2c -lm
-shared-libgcc
Reading specs from /usr/lib/gcc/i686-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-languages=c,c++,f77
--disable-libgcj --host=i686-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-18)
/usr/libexec/gcc/i686-redhat-linux/3.4.6/collect2 --eh-frame-hdr -m
elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o rootfluka
/usr/lib/gcc/i686-redhat-linux/3.4.6/../../../crt1.o
/usr/lib/gcc/i686-redhat-linux/3.4.6/../../../crti.o
/usr/lib/gcc/i686-redhat-linux/3.4.6/crtbegin.o
-L/home/testuser/fluka/2008.3c -L/usr/lib/gcc/i686-redhat-linux/3.4.6
-L/usr/lib/gcc/i686-redhat-linux/3.4.6
-L/usr/lib/gcc/i686-redhat-linux/3.4.6/../../.. -Map rootfluka.map
fluka.o usrini.o usrout.o mgdraw.o FluLib.o Results.o ResultsDict.o
-lRoot -lstdc++ -ldl -lcurses -lpthread -lflukahp -lfrtbegin -lg2c -lm
-lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/i686-redhat-linux/3.4.6/crtend.o
/usr/lib/gcc/i686-redhat-linux/3.4.6/../../../crtn.o
[testuser_at_Ezhik-HDX18-i386 example]$
[testuser_at_Ezhik-HDX18-i386 example]$ $FLUPRO/flutil/rfluka -e
$HOME/fluka/example/rootfluka -N0 -M1 $HOME/fluka/example/root
$TARGET_MACHINE = Linux
$FLUPRO = /home/testuser/fluka/2008.3c
/home/testuser/fluka/2008.3c/libec_thihecufealw_10t.pemf

Initial seed copied from /home/testuser/fluka/2008.3c
Running fluka in /home/testuser/fluka/example/fluka_6769

======================= Running FLUKA for cycle # 1 =======================
/home/testuser/fluka/2008.3c/flutil/rfluka: line 329: 6798 Segmentation
fault (core dumped) "${EXE}" < "$INPN" 2> "$LOGF" > "$LOGF"
[testuser_at_Ezhik-HDX18-i386 example]$

******

as I can see in root001.log (in temporal directory, created by fluka),
the core dump happens at the USERINI call, more precisely, at
RootTree->Branch(...) line of "void myusrini (Double_t &pluto)" in
FluLib.cpp :

****** Slightly modified "myusrini":

extern "C" {
void myusrini (Double_t &pluto)
{
printf("Executing MYUSRINI\n");
RootFile = new TFile("Out.root","recreate");
printf("...ROOT file has been created\n");
RootTree = new TTree("ResultsTree","Protons");
printf("...TTree has been created\n");
RootTree->Branch("Results", "Results", &TheResults, 64000, 1);
printf("...TBranch file has been added to TTree\n");

printf("%f\n", pluto);

}
}

****** End of "root001.log":

Notes: The "FLUKA User Routines" mentioned at point 3) in the
FLUKA User License are those (and only those) contained
in the directory usermvax, both in the source and binary
versions of the code

The Nuclear Energy Agency Data Bank is an authorized
distributor of the code

Executing MYUSRINI
...ROOT file has been created
...TTree has been created
<EOF>

******

I have no idea what causes the core dump in "rootfluka", statically
linked with 32-bit ROOT libraries (maybe static libRoot.a must be built
in a special way to be properly linked to executable by "lfluka"?), but
that's it. At the moment I can run the customized (with ROOT output)
FLUKA only in virtual 32-bit machine, with very limited resources,
compare to the powerful 64-bit Fedora 12 host, since dynamically linked
FLUKA cannot run on 64-bit architecture (direct copying of 32-bit ROOT
libraries and rootcint to the host, with setting of fake ROOTSYS doesn't
work for numerous reasons). So, waiting until
fluka_XXXX-linux_x86_64.tag.gz, compiled with gfortran instead of g77
appears at FLUKA web site :)

Regards,

Vassili

On 02/23/2010 10:39 PM, Marco Calviani wrote:
> Dear Vassili,
>
> few things to check:
> - is the core dump created before FLUKA starts or after?
> - when creating a static link you should load the dictionary, for
> example by adding all the .o files at the linking level in the Makefile.
>
> Hope this help,
>
> Regards,
> Marco
>
> On Feb 23, 2010, at 1:08 AM, Vassili Maroussov wrote:
>
>> Dear Marco,
>>
>> Thank you so much! Initially I've included the current directory in
>> the LD_LIBRARY_PATH as "./", but it doesn't work for the following
>> reason: the "rfluka" script first makes "cd" to a temporary
>> subdirectory (fluka_XXXX) and then starts the executable, so the
>> current directory is "./fluka_XXXX". Another (a bit more general...)
>> solution, to include the "../" in the LD_LIBRARY_PATH works
>> perfectly. Thank you again. Now I'm trying to make a step further, to
>> link FLUKA with static ROOT libraries (which can be obtained with
>> "./configure ; make ; make static". Actually for the ROOT version
>> 5.26.00 "make static" produces several static ROOT libraries and I
>> merge manually libRoot.a and libpcre.a) The goal is to obtain a
>> custom FLUKA executable which can produce the ROOT output both on 32-
>> and 64-bit architectures with no specific requirements for the ROOT
>> version installed, if any (all we need is inside the rootfluka). I've
>> attached the Makefile.static I'm using to produce such a statically
>> linked fluka executable. However, "make -f Makefile.static" makes the
>> executable, but the statically linked rootfluka cases a core dump :-(
>> Don't know why...
>>
>> Regards,
>>
>> Vassili
>>
>> On 02/22/2010 11:33 PM, Marco Calviani wrote:
>>>
>>> Dear Vassili,
>>>
>>> In order to properly run the example it is necessary to have a
>>> careful look at the settings of environmental variables.
>>> Did you try to include your current directory in the
>>> LD_LIBRARY_PATH? Assuming your executable is located in
>>> /home/testuser/fluka/example:
>>>
>>> $ export LD_LIBRARY_PATH=/home/testuser/fluka/example:$LD_LIBRARY_PATH
>>>
>>> In this case I'm able to run the above mentioned example.
>>>
>>> Cheers,
>>> Marco
>>>
>>>
>>> On Feb 22, 2010, at 7:33 PM, Vassili Maroussov wrote:
>>>
>>> > Dear FLUKA users and maintainers,
>>> >
>>> > I cannot make working the rootfluka example
>>> > (http://www.fluka.org/fluka.php?id=examples$B">(B=example3&node=4
>>> <http://www.fluka.org/fluka.php?id=examples&sub=example3&node=4>) using
>>> > files given in
>>> http://www.fluka.org/content/examples/example.tar.gz The
>>> > "make" produces the rootfluka executable, but it hangs up (becomes
>>> > zombie) while trying to run with Flair, then timed out. Below is the
>>> > session (with some comments) with use of "rfluka":
>>> >
>>> > *** Checking if a proper environment variables are set ***
>>> >
>>> > [testuser_at_Ezhik-HDX18-i386 example]$ env | grep ROOT
>>> > LD_LIBRARY_PATH=/usr/local/ROOT/26.00-g34/lib:.
>>> >
>>> PATH=/usr/local/ROOT/26.00-g34/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/testuser/bin
>>> > ROOTSYS=/usr/local/ROOT/26.00-g34
>>> > [testuser_at_Ezhik-HDX18-i386 example]$ env | grep FLU
>>> > FLUTIL=/home/testuser/fluka/2008.3c/flutil
>>> > FLUPRO=/home/testuser/fluka/2008.3c
>>> >
>>> > *** Running rfluka ***
>>> >
>>> > [testuser_at_Ezhik-HDX18-i386 example]$ $FLUTIL/rfluka -e rootfluka
>>> -N0 -M1
>>> > root.inp
>>> > $TARGET_MACHINE = Linux
>>> > $FLUPRO = /home/testuser/fluka/2008.3c
>>> > /home/testuser/fluka/2008.3c/libec_thihecufealw_10t.pemf
>>> >
>>> > Initial seed already existing
>>> > Running fluka in /home/testuser/fluka/example/fluka_28581
>>> >
>>> > ======================= Running FLUKA for cycle # 1
>>> =======================
>>> > [testuser_at_Ezhik-HDX18-i386 example]$
>>> >
>>> > *** End of the session ***
>>> >
>>> > So neither way produces the output expected. I'm using FLUKA 2008.3c.0
>>> > and ROOT 5.26.00 on Fedora 12 i686 (32-bit) installed on Sun
>>> VirtualBox
>>> > 3.1.4 r57640 The standard FLUKA executable runs with no problems
>>> on this
>>> > machine.
>>> >
>>> > What's wrong? How can I make the rootfluka example running?
>>> >
>>> > Regards,
>>> >
>>> > Vassili
>>> >
>>> >
>>>
>>> **************************
>>> Marco Calviani
>>> CERN-EN/STI
>>> CH-1211 Geneva 23
>>> Switzerland
>>> tel. +41 22 7675582
>>> gsm. +41 76 4872687
>>> fax +41 22 7668213
>>> **************************
>>>
>>>
>>>
>>
>> <Makefile.static>
>
> **************************
> Marco Calviani
> CERN-EN/STI
> CH-1211 Geneva 23
> Switzerland
> tel. +41 22 7675582
> gsm. +41 76 4872687
> fax +41 22 7668213
> **************************
>
>
>
Received on Wed Feb 24 2010 - 14:57:01 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 24 2010 - 14:57:01 CET