Skip to content

Usage

In the source code of the consumer program

The name of the module that you must use in your Fortran program is jumble. For example:

use jumble, only: new_unit

Building the consumer program with CMake

If your program using Jumble is built with CMake, then add the following lines to the file CMakeLists.txt for your program:

find_package(Jumble)
target_link_libraries(my_program PRIVATE Jumble::jumble)

(replacing my_program by the actual name of the CMake target for your program).

With Jumble installed from conda-forge

You have to compile your consumer program with gfortran version \(\ge\) 8. Activate your conda environment before running CMake for your consumer program, and CMake should then automatically find the location of Jumble.

With Jumble compiled from source

If you installed Jumble in ~/.local then CMake for your consumer program should also automatically find the location of Jumble.

If you installed Jumble in a directory other than ~/.local then, when you run CMake for your consumer program, you may need to add the option -DCMAKE_PREFIX_PATH=$jumble_install_dir, where $jumble_install_dir is the name of the directory where you installed Jumble.

Building the consumer program without CMake

With Jumble installed from conda-forge

You have to compile your consumer program with gfortran version \(\ge\) 8. Activate the conda environment containing Jumble. Take into account that your program will require jumble.mod at compile time and libjumble.a at link time. The options you will need to add are:

-I$CONDA_PREFIX/include

at compile time and:

-L$CONDA_PREFIX/lib -ljumble -Wl,-rpath=$ CONDA_PREFIX/lib

at link time.

With Jumble compiled from source

Take into account that your program will require jumble.mod (and possibly other .mod files produced by compilation of Jumble) at compile time and libjumble.a at link time. For most compilers, the options you will need to add are:

-I$jumble_install_dir/include

at compile time and:

-L$jumble_install_dir/lib -ljumble

at link time, where $jumble_install_dir is the name of the directory where you installed Jumble (the one you specified after -DCMAKE_INSTALL_PREFIX=).