- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can someone point me to the directions for creating a FORTRAN library (instead of an executable) that can be used by other fortran code?
I am looking for intrsructions similar to the following:
http://www.oceanographers.net/forums/showthread.php?378-How-to-make-a-FORTRAN-library
Thanks.
I am looking for intrsructions similar to the following:
http://www.oceanographers.net/forums/showthread.php?378-How-to-make-a-FORTRAN-library
Thanks.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel Fortran User Guide has a whole chapter, Building Applications, which contains sections on building libraries.
In a nutshell, you give the Fortran compiler the /c option to stop it from calling the linker. Then, you use the librarian to build the static library:
C:\> lib.exe /out:mylib.lib *.obj
In a nutshell, you give the Fortran compiler the /c option to stop it from calling the linker. Then, you use the librarian to build the static library:
C:\> lib.exe /out:mylib.lib *.obj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or in Visual Studio, create a Fortran Static Library project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the quick response.
Does one need build separate libraries for 32-bit and 64-bit environments?
Does one need build separate libraries for 32-bit and 64-bit environments?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, one does.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for bumping this one after a long time.
I had managed to create the library, add the library and path and then compile.
I am getting errors in the format of :
I had enabled /Qopenmp on both. Is there something else I should watch out for? Should the compile options match exactly between the library and the project?
Thanks.
I had managed to create the library, add the library and path and then compile.
I am getting errors in the format of :
[bash]Error 17 error LNK2019: unresolved external symbol _UTILS_mp_TIME_STAMP referenced in function _SMOD_mp_PROCESS_S.N smod.obj [/bash]
I had enabled /Qopenmp on both. Is there something else I should watch out for? Should the compile options match exactly between the library and the project?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These routines are in your code, and it has nothing to do with /Qopenmp. You need to make sure that you link against the object or library created when module UTILS was compiled.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page