1.

How Do I Produce A Library?

Answer»

To build a static library libfoo.a containing all modules and PROCEDURES in the .f90 files in the current directory on Linux:

% gfortran -c *.f90
% ar cr libfoo.a *.o

The first command builds the object files and the second archives the object files into a static archive.
To build a shared library libfoo.so:

% gfortran -shared *.f90 -o libfoo.so -FPIC

In both CASES, other compiler flags such as -O2 can be used.

 

To build a static library libfoo.a containing all modules and procedures in the .f90 files in the current directory on Linux:

The first command builds the object files and the second archives the object files into a static archive.
To build a shared library libfoo.so:

In both cases, other compiler flags such as -O2 can be used.

 



Discussion

No Comment Found