Failed to find pgf77 using -m32

I installed PGI 16.10 with Linux RHEL 7.7 so I could try to compile 32-bit code on 64-bit HP Z6 machine. When using the -m32 compiler option the pgf77 can’t be found *all works fine without -m32). I tried setting LD_LIBRARY_PATH to both linux and linux-64 paths with no luck.

Is there a trick to getting -m32 to work with PGI 16.10 on a RHEL 7.7 machine?

Hi mcolozzi,

Unclear, but this sounds like an install issue. If you’re OS doesn’t have the appropriate 32-bit compatibility libraries, the installer wont install the PGI 32-bit compilers. Did you see any error messages during install?

Also, do you have a sample of the actual error message?
What’s the output from the command “which pgf77”?
Does pgf77 exist in the “$PGI/linux86/16.10/bin”? If so, if you set your PATH to include this directory does it work around the issue?

-Mat

Yes. which pgf77 works and points to the 32 bit path. I was successful getting pgf77 -m32 to work when I re-installed the compiler locally (vice network). Now I’m getting a different error related to pgc++. It tells me:

Catastrophic Error: cannot open source file filename.cpp : not a regular file.

Works fine when not using -m32 option

Typically an error like this is a permission issue with a file but since it works with -m32, that seems unlikely. Maybe a problem with accessing the TEMP directory, but again TEMP should be the same for the 64 and 32-bit compilers.

Can you please post the full command line your using as well as the verbose output (i.e. add “-v” to the command line)? That may give some clues as to the problem.

-Mat

pgc++ -m32 -g -B -Bstatic_pgi -c /.cpp -I

fails with a catastrophic error

pgc++ -m64 -g -B -Bstatic_pgi -c /.cpp -I

works fine

I’ll post the -v output as soon as I can

Output from -v

pgc++ -m32 -v -c -g -Bstatic_pgi -B -DSIM_LINUX=l -l<library_path> /.cpp

Export PGl=/opt/pgi

/opt/pgi/linux86/16.10/bin/pggpp1 --nollalign -Dunix -D_unix -D_unix_ -Dlinux -D_linux - D_linux_
-Di386 -D_i386 -D_i386_ -D_NO_MATH_INLINES -Dlinux86 ‘-D_SIZE_TYPE_=unsigned int’ -D THROW= -D
extension = -D SSE_ -D_MMX_ -D_SSE2_ -D_SSE3_ -D_SSSE3_ - D_STDC_HOSTED_ -D_PGI -D_linux86
-D_signed_=signed -D_GNU_SOURCE -D_PGCG_SOURCE -l -l/opt/pgi/linux86/16.10/include-gcc48 -l/opt/pgi/linux86/16.10/include -l/usr/include/c++/4.8.5
-l/usr/include/c++/4.8.5/x86 64-redhat-linux/32 -l/usr/include/c++/4.8.5/backward
-l/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include -l/usr/local/include -l/usr/include
-l/opt/pgi/linux86/16.10/include-gcc48 -l/opt/pgi/linux86/16.10/include
-l/usr/lib/gcc/x86_64-redhat­ linux/4.8.5/include -l/usr/local/include -l/usr/include -DSIM_LINUX=l
–zc_eh --gnu_version=40805 - D_pgnu_vsn=40805 -g --dwarf2 --preinclude stdarg.h
–preinclude_macros _cplus_macros.h -q -o

/tmp/pgc++yqUyi4GIFWfO.il /.cpp

Catastrophic error: cannot open source file “/.cpp”: not a regular file

Thanks, though I’m not seeing anything amiss.

I did dig into the compiler source to understand what triggers this error. Basically it calls the system’s “stat” routine (stat(2) - Linux manual page) and checks the “st_mode” field to determine if it’s a regular file or not. Unclear why, but for some reason the system thinks this isn’t a regular file.

Can you try running the Linux command “stat /.cpp” to see what stat thinks this file is?

Still doesn’t explain why it works in 64-bits so it might be some type of incompatibility with the OS and the stat command when called from a 32-bit exe especially as most Linux OS are phasing out 32-bit support.
Though, this is just a guess.

What OS are you using?

If I can recreate the issue, I might be able to determine the issue, but so far I’ve not had luck reproducing it.

-Mat

I’ll give stat a try.

I’m using RHEL 7.7

I tried stat .cpp. It identified it as a Regular File. I tried stat .c, which gave identical results.

Any other ideas?

I was able to successfully compile on a RHEL 7.7 system with PGI 16.10 in both 32 and 64-bit compilations.

So unfortunately, not sure what to do next. Seems likely something specific to your system, but I have no idea what it would be.

Sorry I can’t be of more help.

-Mat