When you compile a FORTRAN file containing module declarations, the compiler generates a separate module file for each module declaration in the file. These files are created, by default, in the current directory and in OpenVMS their names consist of the module name followed by the extension F90$MOD.Consider the following FORTRAN source file named hello_m.f90:…
Category: Fortran
Using cmake to build FORTRAN projects with modules
If you are building FORTRAN projects in linux, you can use Cmake as your build system. Let’s build a very simple project consisting a module and a FORTRAN program file. The module is defined in the file hello_mod.f90 which contains following code: The file main.f90 contains the program which in turn uses the the hello…