Skip to content

Latest commit

 

History

History
67 lines (55 loc) · 2.85 KB

README.md

File metadata and controls

67 lines (55 loc) · 2.85 KB

Table of Contents

Assert Fortran(assert-fortran-git)

Assertion module for gfortran, It is a simple module which adds an assertion function, It works by enabling -cpp the c preprocesor directives in the fortran compiler, many fotrans compilers have this functionality.

To install

Installation with yay

If you have yay installed, just run this command.

yay -S assert-fortran-git

Installation from AUR

This is the link of the repo in AUR, then with git you can install the module, just run these two commands.

git clone https://aur.archlinux.org/assert-fortran-git.git
cd assert-fortran-git
makepkg -si

Installation from source

Before installing make sure that you have these dependencies to be able to compile the project:

  1. ar
  2. make
  3. ranlib
  4. gfortran

You can download the latest realese of the project, then you can build a linux pacakge with souce code locally, by running:

make pkg

Then the library is packaged and ready to be install, depending on your distro of linux and your pacakge manager you maybe will need to execute another commands but in arch:

sudo pacamn -U assert-fortran-git-.x.y.z-a.x86_64.pkg.tar.zst

Getting Started

As I said before this module works by enabling -cpp the c preprocesor directives, then inside of the module where you want to make assertions, you only need to include the header file assertf.h, thats why you need the flag -cpp.

#include <assertf.h>

Then to compile the modules or the program, you need to set these flags.

gfortran -cpp your-program.f90 -I/usr/include -lassert

The -lassert refers to the .a library and the -I/usr/include is needed to be able to include the assert module and assertf.h header.

Examples

Picture Example

This is an example of a failed assertion.

image

image

Video Example

2023-06-16.13-04-58.mp4