PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

libg2c
Goto page Previous  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
mkcolg



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

PostPosted: Mon Jan 09, 2006 1:00 pm    Post subject: Reply with quote

Hi hhegab,

If libg2c.a is installed, it should be in /usr/lib or /usr/lib64 which are added to the link path automatically. So I doubt it's a path problem. What's the error message your getting?

- Mat
Back to top
View user's profile
hhegab



Joined: 28 Jan 2005
Posts: 14

PostPosted: Wed Jan 18, 2006 8:55 am    Post subject: Reply with quote

Hi,

The error message I get is the following:
--------
C-Fortran linking ....failed,
-lg2c does not exist.
--------------

I use FC4 which uses gcc3.4. As you may know, this compiler does not contain g77 nor f77.
libg2c.a also is not contained. I use a package which needs g77 for compiling and linking to C codes some other fortran codes.
I thought that pgf77 may replace g77 (as you said, it does).

So, concerning FC4, could pgf77 replace g77 with all the needed libraries?


hhegab
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jan 18, 2006 10:03 am    Post subject: Reply with quote

Hi hhegab,


"-lg2c" is only needed when part of your code, such as from a library, has been compiled with g77. g77 requires libg2c since g77 converts your program from F77 to C (g2c) and needs a special set of routines to support this. If you are only using pgf77, then you do not need libg2c or the "-g77libs" flag since pgf77 is a "native" Fortran compiler.

Sorry for the confusion. I thought your orignial message meant how do I use pgf77 and g77 together not how can I replace g77 with pgf77.

- Mat
Back to top
View user's profile
hhegab



Joined: 28 Jan 2005
Posts: 14

PostPosted: Wed Jan 18, 2006 1:33 pm    Post subject: Reply with quote

Thank you very much for your concern.
I know I have caused you some trouble. But it is clear now.
The code I use, calls g77 to compile some fortran codes that comes with it. It asks for the libg2c to compile some of the fortran codes.
I have changed the fortran compiler option from g77 into pgf77, but it kept asking about libg2c. Now I understand that it wont be needed by pgf77.

Well, I can give you the code to try it if this may help you.

Thank you for your time,

hhegab
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jan 18, 2006 2:04 pm    Post subject: Reply with quote

It's not problem. I'm glad to help.

It sounds like your build process is putting "-lg2c" on the link line? How are you building your app? Do you use make? Configure? Some other method? It may be as easy as removing "-lg2c" from a Makefile.

- 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 Previous  1, 2, 3  Next
Page 2 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