PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

incompatible common block in pgf77

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
kstephens



Joined: 22 Jun 2005
Posts: 6

PostPosted: Tue Aug 23, 2005 2:54 pm    Post subject: incompatible common block in pgf77 Reply with quote

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
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6123
Location: The Portland Group Inc.

PostPosted: Tue Aug 23, 2005 5:14 pm    Post subject: Reply with quote

Hi kstephens,

In 32-bits, Cray pointers are INTEGER*4 but are INTEGER*8 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,
Mat
Back to top
View user's profile
kstephens



Joined: 22 Jun 2005
Posts: 6

PostPosted: Thu Sep 15, 2005 2:38 pm    Post subject: RE: incompatible common block in pgf77 Reply with quote

Mat.

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.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6123
Location: The Portland Group Inc.

PostPosted: Thu Sep 15, 2005 3:08 pm    Post subject: Reply with quote

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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group