incompatible common block in pgf77

I am trying to compile a large f77/c program. It uses the cray pointer extension.

It uses a header file to define the common block of cray pointers (all integers). In one file, it imports the header and initializes an array contained in the common block. In that same file is a routine (that assigns default values) which also imports the same header file.

Whenever I compile, I get the “incompatible size of common block…” error.

If I move the array initialization into the routine, I do not get that error on compilation. However, when the executable is built I get a warning that the common block has two different sizes.

I can get the program to compile and link on my 32 bit machine at home. The problem is on my 64 bit at work.

Even when I get the executable to build successfully (with no warning or error), I get a segmentation fault — I’m sure it’s related.

Any suggestions would be marvelous. Thanks

Hi kstephens,

In 32-bits, Cray pointers are INTEGER4 but are INTEGER8 in 64-bits. Most likely in the second routine you don’t use the ‘pointer’ statement so the compiler doesn’t know they are pointers and thus uses the default kind of 4. The best fix for this would be to copy your pointer statement to every routine that uses the common block. The compiler would then know the correct kind.

If this is difficult, a quick solution would be to compile with “-i8” to change the default kind to 8, or compile in 32-bits ("-tp k8-32" on AMD64 or “-tp p7” on EM64T). Note that “-i8” may have side effects.

Hope this helps,


I tried your suggestions to no avail. The app did compile but quits unexpectedly, displaying some partial gibberish.
–I used the -i8 flag.
–I included the header file with the pointer declarations.

I cannot compile 32bit on my 64bit machine — joys of RHEL4 not letting me install 64bit and 32bit versions of the same library.

Any more suggestions. I’m running out of ideas.

It sounds like the suggestions got you past the original error but your encountering some other related 64-bit porting issue. Can you determine why it’s printing gibberish? The PGI debugger pgdbg might help here.

  • Mat