PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Compilation problem
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
stormlab



Joined: 23 Jul 2005
Posts: 28

PostPosted: Sat Sep 10, 2005 6:43 am    Post subject: Compilation problem Reply with quote

Hello Mat and others,

I have success with the compilation of the FORTRAN and C codes and now I have all *.o files. The final problem is the creation of the exe file under Windwoz. I get this error:

PGI$ make gribprint
pgf90 -o gribprint gribprint.o libpgu.a ../util/libpgu.a
gribprint.o(.text+0x2f3):gribprint.f: undefined reference to `COPEN@2
8'
gribprint.o(.text+0x94b):gribprint.f: undefined reference to `CCLOSE@12'
libpgu.a(gribcode.o)(.text+0x2de):gribcode.f: undefined reference to `BNREAD@24'

libpgu.a(gribcode.o)(.text+0x396):gribcode.f: undefined reference to `BNSEEK@16'

libpgu.a(gribcode.o)(.text+0x3b9):gribcode.f: undefined reference to `BNSEEK@16'

libpgu.a(gribcode.o)(.text+0x1530):gribcode.f: undefined reference to `BNREAD@24
'
make: *** [gribprint] Error 2

COPEN, CCLOSE, BNREAD and BNSEEK are functions defined in the C file which are invoked from the FORTRAN code.

Thanks!

Angel
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Sep 12, 2005 11:03 am    Post subject: Reply with quote

Hi Angel,

The Window's symbol convention adds the size in bytes of the arguments as part of a subprogram symbol name. This can sometimes cause problems during linking. To fix, compile and link with the "-Munix" flag to tell compiler to use UNIX symbol and parameter passing conventions instead.

- Mat
Back to top
View user's profile
stormlab



Joined: 23 Jul 2005
Posts: 28

PostPosted: Wed Sep 14, 2005 6:00 am    Post subject: Thanks! Reply with quote

Thanks!

Angel
Back to top
View user's profile
stormlab



Joined: 23 Jul 2005
Posts: 28

PostPosted: Wed Sep 14, 2005 6:09 am    Post subject: Memory error Reply with quote

Hello,

May be I have to add some flag in the Makefile of PREGRID because I get error:

-----------------------------------
The instruction at <address> referenced memory at <bigger address>. The momery could not be "read".
-----------------------------------

I'm wondering if this problem is related with the PREGRID's FORTRAN/C codes or it's connected with the PGI for windows compiler. I found on the M$ site that this error can be observed if the W2K is not updated to SP4 but I'm with SP4. I will try under real old DOS (from system disk of win98).

Any ideas are welcome!

Angel
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Sep 14, 2005 11:36 am    Post subject: Reply with quote

Hi Angel,

This is a just a good old-fashioned segmentation violation. The program is trying to read memory it doesn't own. It's possible that it's a compiler problem or a problem with porting it to Windows. We have had reports of problem with the Linux version, but I have yet been able to recreate the problem internally since I think its dependent upon the input data. I'm a bit swamped right now but will try and take a look in the next few days. In the mean time, if you could isolate where the violation occur, it would be very helpful.

Thanks,
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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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