What we usually do is to group all the library functions/subroutines in a
single file and by themselves (i.e. not being part of a module). Then we
create a module that only contains interfaces for those subroutines that we
want to expose to the end user. We provide end-users with the compiled
module and the library. The user can then USE the module in his/her programs
and link against the library. We like this method because it is easy to
"hide" functions/subroutines that we don't want to expose to the end user
(for example low-level manipulation of matrices), it makes it easier to
manage function and operator overloads, in general seems to make our life
easier when porting to different compilers, and because the user can check
the syntax of the calls to the library at compile time. Of course, this is
just one of many ways to do the same thing.
Regarding your specific question: some compilers generate a .mod (or
As Dan Nagle already pointed, there is not a standard for the way compilers
> I am attempting to create a mathematical library using Fortran 90.
> However, I ran into the following difficult that I hope someone can give
> some pointer.
> I have the following module that was archived into the library, say
> Module Junk_Library
> A and B are two modules containing all the subroutines of the library.
> In the main program, I would USE the Module Junk_Library in order
> For example,
> Program Main
> END Program
> To create the executable, I compile the program Main and link it with
> So, in the sense, if I wish to distribute the library, I would have to
> Thanks for the info.
> Box F, 182 George Street
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.