32/64b compiles, again

I have a similar problem to Mr. Borg, who posted earlier today …

I am trying to compile an object (on a 64b linux machine) and link it with existing 32b .o’s and libs (compiled/linked on a different, 32b, machine). As expected, this doesn’t work. The path of least resistance that I’d like to follow is to compile my .o 32b and direct the linker to link it with the existing binaries in 32b mode. But I can’t seem to make this happen …

I tried the “-tp k8-32” option to pgf90 but got the following


/fs/opt/pgi/linux86/bin/pgf90 -g -fpic -g77libs -Mbackslash -Mpreprocess -tp k8-32 -I/fs/opt/pgi/linux86/include -I…/TEXT -I/fs/hseb.djs/ob81/ohd/ofs/inc -I/fs/hseb.djs/ob81/ohd/calb/inc -I/fs/hseb.djs/ob81/ohd/util/inc -I/fs/hseb.djs/ob81/ohd/ifp/inc -I/fs/hseb.djs/ob81/ohd/icp/inc -I/fs/hseb.djs/ob81/ohd/xsets/inc -I/fs/hseb.djs/ob81/ohd/xdat/inc -I/fs/hseb.djs/ob81/ohd/xnav/inc -I/fs/hseb.djs/ob81/ohd/idma/inc -I/fs/hseb.djs/ob81/ohd/ofsde/inc -c llgd.f
&& chmod 664 llgd.o
&& echo “o - llgd.o”
|| echo “e - llgd”
pgf90-Error–tp k8-32 not supported in this installation

Is this not the correct -tp option? A “uname -a” on my compilation (64b) system says

Linux cucharas.riverside.com 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:29:47 EST 2005 x86_64 x86_64 x86_64 GNU/Linux

A “file” on the object I generated says

llgd.o: ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), not stripped

BTW, a “file” on a representative object I’m trying to link against (32b) says

ublock.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped

I should probably note that I had some minor license issues, in that we had a 32b license and I just yesterday got a temp 64b license. Is it possible that my license doesn’t allow access to the 32b function of the compiler?

Thanks for any advice.

-Darrin

Hi Darrin,

32 and 64-bit object can not be mixed, so you’re correct to use the 32-bit PGI compilers. However my best guess as to the problem is that it appears that you (or someone else) has created a “bin” directory under “linux86”, which (I’m assuming) was copied from a particular PGI version. A typical installation should have a release number: “linux86//bin”. Your ok so long as you’ve also copied all other PGI directories, but will inhibit your use of the “-tp” and “-V” switches.

Why? When you use “-tp” or “-V”, which ever driver (pgf90, pgcc, etc.) you use will re-invoke the correct driver using relative links. For example, you have your PATH set to use the pgf90 7.0 64-bit compilers (/opt/pgi/linux86-64/7.0/bin/pgf90) but wanted to compile using the pgf90 6.1 32-bit compilers. Instead of resetting your PATH, you can just add “-tp k8-32 -V6.1” and the driver will invoke “…/…/…/linux86/6.1/pgf90”. Since you’ve removed the directory with the release number, the driver in /fs/opt/pgi/linux86/bin doesn’t know where to find the correct driver.

The solution is to either remove the -tp switch or restore the compilers to their original directory structure.

Hope this helps,
Mat