Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • DarrellJanuary 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)January 22, 2009 10:54 AM PST
    Rate
     
    Re: Porting Windows loadLibrary to Mac?

    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.


    Steve

    Attaching or including files in a post
    Doctor Fortran blog
    @DoctorFortran on Twitter

Forum jump:  

Intel Software Network Forums Statistics

16,377 users have contributed to 46,364 threads and 164,041 posts to date.

In the past 24 hours, we have 9 new thread(s) 31 new posts(s), and 20 new user(s).

In the past 3 days, the most popular thread for everyone has been Program compiles in release but not debug The most posts were made to You need to show us the whole The post with the most views is vectorization of sin/cos results in wrong values

Please welcome our newest member fruitbrown


For more complete information about compiler optimizations, see our Optimization Notice.