Undefined reference to `pythia6_common_address__'

Hello all,

Does anyone know what might cause the error referenced in the subject line? I’m trying to compile an application that uses ROOT for a good portion of its work (so the compile line has the usual litany of -l arguments), and the linker gives up with that error.

/home/lockne89/local/lib/root/libEGPythia6.so: undefined reference to `pythia6_common_address__'  

I just rebuilt and reinstalled libPythia6.so to rule that out; however, the same error persists afterward.

From a ROOT interpreted session, I can gSystem->Load(“libEGPythia”) cleanly. This is done from a fresh build of 5.26 from source.

Thanks,
Matthew Lockner

Additional info: This appears to originate in montecarlo/pythia6/src/TPythia6.cxx. There is an #ifdef block ca. line 91:

# ifdef PYTHIA6_DOUBLE_UNDERSCORE
#  define tpythia6_open_fortran_file tpythia6_open_fortran_file__
#  define tpythia6_close_fortran_file tpythia6_close_fortran_file__
#  define pythia6_common_address pythia6_common_address__
# elif PYTHIA6_SINGLE_UNDERSCORE
#  define tpythia6_open_fortran_file tpythia6_open_fortran_file_
#  define tpythia6_close_fortran_file tpythia6_close_fortran_file_
#  define pythia6_common_address pythia6_common_address
# else
#  define pythia6_common_address pythia6_common_address
#  define tpythia6_open_fortran_file tpythia6_open_fortran_file_
#  define tpythia6_close_fortran_file tpythia6_close_fortran_file_
# endif

What causes PYTHIA6_DOUBLE_UNDERSCORE to be defined? There must be something when I first configure the build I don’t have set properly.

Could you clarify on which machine/OS/compiler you run?
Did you follow the pythia6 installation procedure?
which of the makefiles in ftp://root.cern.ch/root/pythia6.tar.gz did you use?

Rene

[quote=“brun”]Could you clarify on which machine/OS/compiler you run?
Did you follow the pythia6 installation procedure?
which of the makefiles in ftp://root.cern.ch/root/pythia6.tar.gz did you use?

Rene[/quote]

Hello Rene,

This machine is an AMD Sempron; from uname,

Linux warlock 2.6.30 #6 PREEMPT Mon Jan 18 15:30:23 CST 2010 i686 GNU/Linux

The Linux distribution is Debian “testing”, From “gcc -v”:

> gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.2-9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.3 20100108 (prerelease) (Debian 4.4.2-9)

For Pythia, I used makePythia6.linux. I’ve never determined that Pythia has a standard installation procedure, so I just copy the generated libPythia6.so to my ~/local/lib with a “cp” command.

on a 64 bit Linux machine, you should use makePythia6.linuxx8664.
This makes sure that pythia is compiled with the option -fPIC.

Rene

[quote=“brun”]on a 64 bit Linux machine, you should use makePythia6.linuxx8664.
This makes sure that pythia is compiled with the option -fPIC.

Rene[/quote]

I do not believe my processor has a 64-bit architecture. Wouldn’t using that build script only generate an incompatible pythia library?

Could you describe your installation procedure? Did you follow our installation procedure for Pythia descrived at: root.cern.ch/drupal/content/inst … oot-source
You must take ftp://root.cern.ch/root/pythia6.tar.gz
this file includes essential small additional files making the interface between C++ and fortran common blocks.

Rene

[quote=“brun”]Could you describe your installation procedure? Did you follow our installation procedure for Pythia descrived at: root.cern.ch/drupal/content/inst … oot-source
You must take ftp://root.cern.ch/root/pythia6.tar.gz
this file includes essential small additional files making the interface between C++ and fortran common blocks.

Rene[/quote]

Hello Rene,

While I was combing through my config.log, I discovered that it had found a libPythia in /usr/lib on my machine that has a double underscore after the relevant functions. I’m not sure what I did to get all those there, but this is why the configure script set things as it did. I have some cleaning to do; please consider this resolved.

Thanks again,
Matthew Lockner

OK, happy to know that you solved your problem.

Rene