PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

linking fortran DLL directory paths to c binary at runtime

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



Joined: 03 Dec 2009
Posts: 1

PostPosted: Thu Dec 03, 2009 10:10 am    Post subject: linking fortran DLL directory paths to c binary at runtime Reply with quote

I am compiling a C program using the pgicc wrapper and linking a fortran object when building the executable. However, at runtime, the binary does not recognize the location of the *.so files linked during the building of the execuatable. How do I specify this location so that the library fortran path is recognized at runtime?
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Dec 03, 2009 1:03 pm    Post subject: Reply with quote

Hi Stockerr,

You mention both DLL and .so so I'm not sure if you're on Windows or Linux. Also, I'm not sure what the "pgicc wrapper" is? Do you mean the pgcc (no i) driver? Finally, I'm sure which so libraries you mean, the PGI Fortran runtime or your own .so?

On Linux, you need to set the environment variable "LD_LIBRARY_PATH" to include path to the location of the .so libraries. Though, if you're running on the same system you built your program on, the default paths are embedded in your binary so you shouldn't need to set LD_LIBRARY_PATH. Hint: use "ldd myprogram.out" to see which .so the program need and the location where the loader thinks they are located.

On Windows, the location of your DLLs must be in your PATH environment variable. Though, the default on Windows is for the PGI runtime to be statically linked (unless you linked with -Bdynamic).

Hopefully this helped, but if not please let me know.

- 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