Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
Wayne
Total Points:
220
Status Points:
170
Green Belt
January 22, 2009 10:22 AM PST
Porting Windows loadLibrary to Mac?

On the Mac, are there Fortran commands loadlibrary, freelibrary, and getprocaddress to dynamically load a user supplied C++ dynamic library? On Windows the program uses, "use kernel32" to access the WinAPI. Does it need to include a compiler option?

Is there any sample code / examples / test cases to illustrate dylibs? Can you point me to the right place in the Intel / Apple documentation for dylibs? Has anyone written a "for dummies" book on the subject? :-)

Steve Lionel (Intel)
Total Points:
115,285
Status Points:
115,285
Black Belt
January 22, 2009 10:54 AM PST
Rate
 
#1
LoadLibrary, etc. are not "Fortran commands".  They are Windows operating system routines and do not exist on operating systems other than Windows.  "use kernel32" is the way in Intel Visual Fortran to declare the routines so that you can call them.  This does not map directly onto anything on MacOS.

On Linux and MacOS, there are usually a set of C library routines that may do some of the things you're looking for. "dlopen" is probably the one to look for.  Intel Fortran does not provide canned declarations of these routines, but you can use the C interoperability features to write your own declaration.

To get started, see this Wikipedia article on dynamic loading.





Intel Software Network Forums Statistics

8488 users have contributed to 31626 threads and 100733 posts to date.
In the past 24 hours, we have 35 new thread(s) 132 new posts(s), and 199 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member chat1983