Skip to content

An example program for the Fortran - C binding. Also uses CMake to generate a Makefile. It is initially designed to be part of Fortran lectures in International Master on Turbulence program. Please contact me if you have any question and/or contribution.

Notifications You must be signed in to change notification settings

ilkaysolak/CMakeExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

An example program for the Fortran - C binding. Also uses CMake to generate a Makefile. It is initially designed to be part of Fortran lectures in International Master on Turbulence program.

Please contact me if you have any question and/or contribution.

DIRECTORIES :

bin : executables

build : where to compile

includes : modules includes files

lib : libraries

src : source files

SOURCE CODE :

For this example there are only 3 files. And there are no subdirectories.

Note: In case of subdirectories, mention each folder accordingly.

main : calls the subroutine

COMPILATION :

  • Go to build directory :
cd build
  • Create Makefile with one of these command choosing compiler (gfortran, ifort, ...) and build type (Debug, Release, ...).
FC=ifort cmake -D CMAKE_BUILD_TYPE=Debug  ..
FC=ifort cmake -D CMAKE_BUILD_TYPE=Release  ..

FC=gfortran cmake -D CMAKE_BUILD_TYPE=Debug  ..
FC=gfortran cmake -D CMAKE_BUILD_TYPE=Release  ..

FC=mpif90 cmake -D CMAKE_BUILD_TYPE=Debug  ..
FC=mpif90 cmake -D CMAKE_BUILD_TYPE=Release  ..
  • Compile :
make

USE :

  • run desired executable(s) from bin folder.
./main

About

An example program for the Fortran - C binding. Also uses CMake to generate a Makefile. It is initially designed to be part of Fortran lectures in International Master on Turbulence program. Please contact me if you have any question and/or contribution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published