Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Help on how to create a library with F90
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marco A. Garcia  
View profile  
 More options Sep 7 1999, 3:00 am
Newsgroups: comp.lang.fortran
From: "Marco A. Garcia" <mgar...@canaimasoft.com>
Date: 1999/09/07
Subject: Re: Help on how to create a library with F90
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
whatever name the compiler gives to it) file and a library file. The .mod
file has the symbols; the library file contains the executable code included
in the module. When this is the case, you must distribute both files to your
end users. If the module does not have executable code (for example, if the
module only has interfaces), some compilers only generate a .mod file. Also,
some compilers (in particular f95) put the symbols and the executable code
into a single .mod file. In the last two cases, you only need to provide the
.mod file to your end users.

As Dan Nagle already pointed, there is not a standard for the way compilers
handle module objects, so your best shot is to consult the documentation of
your specific compiler(s).

--
Marco A. Garcia
Canaima Software
1632 Dale Street
San Diego, CA 92102
Tel/Fax: (619) 233-6831
http://www.canaimasoft.com
Developers of f90SQL the database connectivity
library for Fortran, and f90VB the library for seamless
integration of VB and Fortran

Wai Sun Don <ws...@hydra.cfm.brown.edu> wrote in message
news:37D3E8A6.CF0DA937@hydra.cfm.brown.edu...

> I am attempting to create a mathematical library using Fortran 90.
> However, I ran into the following difficult that I hope someone can give
> me
> some pointer.

> I have the following module that was archived into the library, say
> libjunk.a

> Module Junk_Library
>   USE A
>   USE B
> END 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
> to
> access the subroutines  contained in modules A and B

> For example,

> Program Main
>   USE Junk_Library

> .....

> END Program

> To create the executable, I compile the program Main and link it with
> the library  libjunk.a
> (without the lib and a, of course.)  However, the F90 compiler would
> complaint that
>    it is unable to access the module symbol file for the module
> Junk_Library, namely
>      Junk_Library.mod
> which was deleted after the creation of the library  libjunk.a

> So, in the sense, if I wish to distribute the library, I would have to
> also distribute the module symbol
> file   Junk_Library.mod ?   Is there anyway to get around this problem?
> If so, How?

> Thanks for the info.

> --
> .....................................................................
> Prof. Wai Sun Don, PhD

> Box F, 182 George Street
> Div. of Applied Math.                 Tel : (401)-863-2250
> Brown University                      Fax : (401)-863-1355
> Providence, RI 02912


 
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.