Libraries compiled modules

From: Pierre Asselin (pa_at_see.signature.invalid)
Date: 02/13/04


Date: Fri, 13 Feb 2004 16:31:50 +0000 (UTC)

Is it possible to create and install libraries of Fortran modules?
This would be for modules that are sufficiently useful and mature to
be pre-compiled (pax, Jan!) and installed where other projects can
make use of them.

I realize that "install" is platform dependent, but I am more
concerned with compiler dependencies.

Example: Consider a file "toto.f90" on a Unix box, with

    module extremely_useful
        ! blah, blah, blah
    end module
    module very_handy
        ! blah
    end modle
    ! and so on

If I compile such a file with Portland, I get an object "toto.o" and
a bunch of module files "extremely_useful.mod", etc. The object files
can be bunched into a static or dynamic library (.a, .so) and copied
to /usr/local/lib and the .mod files can go in /usr/local/include/toto/ .
When I compile a main that USEs extremely_useful, I have to give a
flag like "-I/usr/local/include/toto -L/usr/local/lib" and everything works.

On Windows, Compaq Visual Fortran does much the same thing (.obj files
instead of .o) and the visual wizard gizmo lets me create static
libraries or dll's . Same deal, I would copy the libraries and
module files somewhere and specify "/I" flags in client projects.

On Linux, I seem to remember that Intel Fortran creates one module
file *per source file*, not per module, that is: a single file
"toto.mod" . It uses a few "work" files to keep track of what .mod
files to search when it encounters a "use" statement. The "work"
files are created by compiling the modules, do they go in
/usr/local/include/ as well? they are also updated when compiling
client programs so they seem to belong in the compilation directory
as well. What to do? (and, of course, someone correct me if what
I just said is wrong).

I realize that creating libraries lies outside of the scope of the
standard. My question is: do compilers support the process in
practice, when modules are involved?

-- 
pa at panix dot com


Relevant Pages

  • Could not compile pyclamavwith python on Solaris 8
    ... system SFWamake automake - GNU automake ... system SUNWbtoox CCS libraries bundled with SunOS ... system SUNWswmt Install and Patch Utilities ... Installing prerequisites to compile SquidClamAV Redirector: ...
    (SunManagers)
  • Re: Error on ldap library when setting up Samba on Solaris 10
    ... and checkng the binary for the "net" command ... where you compile it and before you install it should tell you where it ... but where are the libraries actually installed? ...
    (comp.protocols.smb)
  • RE: fortran library error
    ... Subject: fortran library error ... checking if libtool supports shared libraries... ... checking for gfortran option to produce PIC... ... compile a simple Fortran program ...
    (RedHat)
  • Re: Trouble using GQOPT
    ... I am able to compile the program properly but when I try to ... >Build GQOPT.exe which contains my fortran program file, ... >program that uses the same library function from GQOPT, namely OPT, it ... Compare the libraries in here ...
    (comp.lang.fortran)
  • Re: gtk+ on embedded device
    ... > Gtk+ installation means to cross compile a lot ... > of libraries, ... > an easier way to install gtk+ using framebuffer ... But when I have to install the ...
    (comp.os.linux.embedded)