Undefined symbol: G77_date_y2kbuggy_0 when loading libg2c.so

When loading some necessary shared libraries into a root script with the commands

gSystem->Load("/home/dmacqueen/Analysis/PdfUncertainties/shlib/libElectroweak_mrst2003.so");
gSystem->Load("/home/dmacqueen/Analysis/PdfUncertainties/shlib/libElectroweak_cteq6.so");
gSystem->Load("/home/dmacqueen/Analysis/PdfUncertainties/shlib/libElectroweak_pythia.so");

Root found undefined symbols G77_getenv_0 and z_abs, and the script wouldn’t compile. A bit of searching led me to believe that this was due to fortran code incorporated in the shared libraries which needed the library libg2c.so to be interpreted. However, loading in that shared library fails as well:

gSystem->Load("/home/dmacqueen/Analysis/PdfUncertainties/shlib/libg2c.so");

gives the result

dlopen error: /home/dmacqueen/Analysis/PdfUncertainties/shlib/libg2c.so: undefined symbol: G77_date_y2kbuggy_0
Load Error: Failed to load Dynamic link library /home/dmacqueen/Analysis/PdfUncertainties/shlib/libg2c.so

This appears to be the result of some sort of old anti-Y2K bug code. http://www.slac.stanford.edu/comp/unix/package/rtems/doc/html/g77/g77.info.Year_2000__Y2K__Problems.html describes this symbol as follows:

[quote]“The renaming of EXTERNAL' procedure names of these intrinsics causes unresolved references at link time. For example,EXTERNAL
DATE; CALL DATE(STR)’ is normally compiled by g77' as, in C,date_(&str, 20);’. This, in turn, links to the date_' procedure in thelibE77’ portion of libg2c', which purposely calls a nonexistent procedure namedG77_date_y2kbuggy_0’. The resulting link-time error
is designed, via this name, to encourage the programmer to look up the
index entries to this portion of the `g77’ documentation.”[/quote]

Which means to me that the undefined symbol is not in any code I have written, or in any of the other shared libraries I have loaded into my script.

Is there any way to avoid this error, perhaps via some alternate way of linking in libg2c.so so that the entire library isn’t loaded in and checked for undefined symbols?

I am running on a computer running RHL7.3, using gcc 3.4.3, and version 4.00/08 of Root. Since I am stuck running the CDF run II software version 6.1.4, using a different version of gcc or Root is probably not an option.

(Those of you on the CDF collaboration can get more details in my post to the CDF_SOFTWARE_HELP mailing list here, but I’m hoping some of this problem can be explained by someone here without going into the details of the CDF software’s shared libraries that I’m using.)

Hi,

Humm … it ‘sounds’ like what you would need to do is to fix/rebuild one of the fortran library you are using (to fix the Date problem).

Cheers,
Philippe