Making fortran libraries 
Author Message
 Making fortran libraries

I am having some trouble making my own library. I have a whole bunch of
modules I want to combine in to a single library (so that I dont have
to link to them all individually). I compile them all with :

"f95 -c mod_blah.f95"

 where mod_blah  is my module name and then combine them in to a
library using :

"ar q libName.a *.o *.mod" where Name is the name of my library.

This all works fine but when I try to link this to a program that uses
the modules in the library using :

f95 programName.f95 -L/libraryDirectory/ -lStu

It says it cant find the library. :

"Fatal Error: testPowerMulti.f95, line 3: Cannot find module
MOD_NUMERICS8

Anyone have any ideas what I am doing wrong?? I am using nag fortran
(f95)

cheers

stuart



Mon, 15 Sep 2008 22:58:24 GMT  
 Making fortran libraries
Never mind... sorted it ... turns out I am basically an idiot. I needed
to not add the module files in and just include them with an -I include
path. Sorry for clogging up the board with a question that I figured
out two seconds later.


Mon, 15 Sep 2008 23:07:12 GMT  
 Making fortran libraries

Quote:
> "ar q libName.a *.o *.mod" where Name is the name of my library.

And your compiler can find .mod files inside archives ?  There
was a thread about that just today.

Quote:
> f95 programName.f95 -L/libraryDirectory/ -lStu
> It says it cant find the library. :
> "Fatal Error: testPowerMulti.f95, line 3: Cannot find module
> MOD_NUMERICS8


It seems to me it can't find the *module* at compile time,
and it never got to looking for the library at link time.
If your compiler knows how to pull module files out of
archives, it may need an option different from "-L" to
tell it where to look.  If it can't use archives, you need
to copy your .mod files somewhere else (and you still need
to tell the compiler where that is).

--
pa at panix dot com



Mon, 15 Sep 2008 23:30:11 GMT  
 Making fortran libraries

Quote:
>Sorry for clogging up the board with a question that I figured
>out two seconds later.

That's a common enough phenomenon, happens to just about all of us at one time or antoher.


Tue, 16 Sep 2008 02:42:43 GMT  
 Making fortran libraries

Quote:

>>Sorry for clogging up the board with a question that I figured
>>out two seconds later.

> That's a common enough phenomenon, happens to just about all of us at one time or antoher.

The term I've heard for it is "debugging by confession".

- Brooks

--
The "bmoses-nospam" address is valid; no unmunging needed.



Wed, 17 Sep 2008 13:07:35 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. making library in Lahey fortran

2. MAKING A FORTRAN LIBRARY ON UNIX.

3. Get the version of IMSL/Fortran Mathematics and Statistics and NAG/Fortran Numeric Algorithms Library Library

4. Xeffort library (1.2.15) -- Open Source GUI Library for Visual Fortran

5. image library for Fortran (WSQ image library for fingerprints) released

6. Does anybody knows who made SilverClip library..

7. Making Own Library

8. Making Own Library

9. Making of VI libraries

10. Making C Dll with Ada libraries

11. Making simple gates out of LPM libraries

12. making libraries

 

 
Powered by phpBB® Forum Software