For Programmers: Free Programming Magazines  


Home > Archive > Fortran > November 2005 > help for Library









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author help for Library
TC

2005-11-21, 3:58 am

how include in a fortran90 program a external library?
in C it was #include <...> in fortran?
can you write a example?
Arjen Markus

2005-11-21, 7:57 am

#include in C does little more than make the prototypes visible to the
compiler
(and a bunch of related things, like macros and so on).

In Fortran I usually use a number of modules via the "use" statement.
That does more or less the same thing. Of course, you will need to
specify
the library at link time too.

Regards,

Arjen

Catherine Rees Lay

2005-11-21, 7:57 am

TC wrote:
> how include in a fortran90 program a external library?
> in C it was #include <...> in fortran?
> can you write a example?


If it's in a source file, all you need is

INCLUDE '<name of source file>'

If it comes compiled with its own module file it would be

USE <name of module>

(note that USE isn't referencing a source file)

You need to read your compiler documentation on how to tell the compiler
where to find module files.

If it's an object code library, you need to read the compiler
documentation on how to link it in (these last two are compiler specific).

Catherine.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com