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





  • Posts   Search Threads
  • DarrellJanuary 22, 2009 9: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 9: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

17,025 users have contributed to 48,319 threads and 172,758 posts to date.

In the past 24 hours, we have 11 new thread(s) 54 new posts(s), and 47 new user(s).

In the past 3 days, the most popular thread for everyone has been Optimalization of sine function\'s taylor expansion The most posts were made to Most likely, the issue is that The post with the most views is Optimalization of sine function\'s taylor expansion

Please welcome our newest member redfruit83


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