When you compile a file with one or more modules in it, you get a .mod file for each module along with the .o file. The .mod files must be available at compile time when other fortran files are compiled, and the .o file must be available at link time. The .o file can be moved into a normal library file (.a or .so, etc.) but it still must be available at link time. If you have multiple fortran compilers (or multiple versions of a compiler), then both the .mod files and the .o files for each compiler must be separated and made accessible.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Installing Fortran module files | 15 | 3066 | January 29, 2022 | |
| Why should I use CMake? | 37 | 5719 | April 18, 2021 | |
|
Two modules with the same name in one program
|
15 | 1956 | August 8, 2022 | |
| Is it possible to use a stdlib library generated with one compiler to link a program using a different compiler? | 4 | 748 | September 7, 2021 | |
| First release of the Fortran standard library | 49 | 4520 | November 10, 2021 |