PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

libg2c
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
hhegab



Joined: 28 Jan 2005
Posts: 14

PostPosted: Sat Dec 31, 2005 10:59 am    Post subject: libg2c Reply with quote

Hi,
How are you?
I use a code which uses g77 as a fortran compiler and uses -lg2c as a fortran C linker.
My question is: Is it possible to specify pgf77 as the fortran compiler and what is then the equivalent to -lg2c option.

thank you very much,

hhegab
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Jan 02, 2006 10:13 am    Post subject: Reply with quote

Hi hhegab,


pgf77 can be used in place of and is compatible with g77. We do have a flag "-g77libs" which adds all necessary g77 libraries, including "-lg2c" to the link line. However if you prefer, since "-lg2c" is a library, it can simply be added to the link line.

Note that g77 adds two underscores to the end of function names while pgf77 only adds one. If you mix g77 and pgf77 compiled objects, you may need to add the flag "-Msecond_underscore" to the pgf77 compilation line to instruct pgf77 to use two underscores instead of one.

- Mat
Back to top
View user's profile
hhegab



Joined: 28 Jan 2005
Posts: 14

PostPosted: Mon Jan 02, 2006 9:02 pm    Post subject: Reply with quote

Hi,
thanks for the reply.

Do you mean I can use -g77libs instead of -lg2c?
I shall try what you said to see what shall happen?

hhegab
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Jan 03, 2006 8:52 am    Post subject: Reply with quote

Quote:
Do you mean I can use -g77libs instead of -lg2c?


Yes. "-g77libs" adds the appropriate g77 libraries for you. Some systems use "-lf2c" instead of "-lg2c" so using "-g77libs" is more portable since it will select the correct library for your system.

- Mat
Back to top
View user's profile
hhegab



Joined: 28 Jan 2005
Posts: 14

PostPosted: Sun Jan 08, 2006 6:48 am    Post subject: Reply with quote

Hi,

Thanks for your reply, and sorry for the late answer.
I have tried the solutions you told me, but neither of them did work. May be because their path is not defined. How may I defined the path?

thanks.
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