[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Shlibs with fortran source in ccc


I'm having some trouble with ccc/fort and shared libs. My PETSc package has the option of being built using Compaq compilers and libs for increased performance. It includes the shared lib libpetsc.so (among others) which is built from some C sources with ccc and some fortran sources with fort.

When I go to link a C-based binary to that lib, if I use -lfor -lFutil -lcpml, it can't find MAIN__, which is a symbol only generated by compiling a Fortran source with PROGRAM (AFAICT). If I build with just -lcpml, it can't find for_write_seq_lis symbol, which is in libfor.

The really bizarre thing is that for PETSc 2.1.0 and the older fort (the -2 RPM, installed by cfal...-1.deb), it worked just fine with -lcpml. The old libpetsc.so contains the symbol for_write_seq_lis, but the linker is somehow finding it without -lfor. But with 2.1.1 and the newer fort (the -3 RPM, installed by cfal...-2.deb which I just uploaded), it fails. (Apologies to Naotaka Yamamoto for taking over a month to upload the new cfal installer and close 132951!)

The old and new shared libs were linked in exactly the same way, using:

${LD} -shared -soname $$LIBNAME.${SLSUFFIX}.${SLVERSION} -whole-archive $$LIBNAME.a -o $$LIBNAME.${SLSUFFIX}.${SLVERSION}

I also tried mkdir tmp; ar x ../$$LIBNAME.a; same LD command with *.o instead of $$LIBNAME.a, same error.

It's a real PITA that the old non-free cfal doesn't work any more because the "beta period expired", so I can't try building PETSc using that to verify that the compiler is making the difference. I guess that's what I get for using non-free software. :-(

Thanks in advance for any help you can provide,

-Adam P.

GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6

Welcome to the best software in the world today cafe! <http://lyre.mit.edu/%7Epowell/The_Best_Stuff_In_The_World_Today_Cafe.ogg>

Reply to: