Inline::F2003 - An ILSM for modern FORTRAN

I would like to announce the first release of Inline::F2003. The project features the program "matopmul.pl", which performs a matrix multiplication calculation, to showcase the use of Inline::F2003.

The project's URL is: https://sourceforge.net/projects/inline-f2003/

Inline::F2003 is a Perl extension module that allows program units written in modern FORTRAN to be added into the "__DATA__" section of a Perl program. The term "program units" is a collective FORTRAN term that refers to subroutines, functions, and module procedures. The module reads the FORTRAN source code, compiles it into object files, and builds a single shared library file.

Inline::F2003 is dependent on the "Inline" Perl extension module. In Inline terminology, Inline::F2003 is referred to as an ILSM (Inline Language Support Module). Inline performs many functions, including loading the shared library that was built and installed by the ILSM. Inline::F2003 operates differently to other ILSMs in that regard. The shared library that it builds must be loaded by Inline::C rather than Inline. This is discussed in more depth in the "README.txt" file of the project.

The FORTRAN source code that the module user would write must utilise the C Interoperability features of the FORTRAN 2003 standard and higher. The reason for this is that the FORTRAN program units must be callable from C, since Perl's native API is written in C. The compiler that the module user would choose must therefore be compatible with FORTRAN 2003. Older compilers that can only interpret FORTRAN 77 or FORTRAN 90 will definitely fail.

The FORTRAN compilers that have been tested, and are currently supported include:


  • GNU Fortran (free compiler, part of the GCC collection)

  • G95 Fortran (free compiler, standalone)

  • NAG Fortran (commercial compiler, developed by Numerical Algorithms Group)

This initial release of Inline::F2003 was developed and tested on Linux only. This will soon change so that Inline::F2003 is also supported on Apple OS X and Microsoft Windows systems. I would still encourage users to try running the program even if their system is non-Linux. I do hope you'll have an opportunity to try out the software, and report back your findings. If the program fails on your system, I would be so appreciative if you could submit a Sourceforge ticket for the project.

Thank you, and enjoy!

4 Comments

How come it wasn't named Inline::Fortran? That would probably be easier for users to find when searching cpan.

As long as the word Fortran appears in the abstract (the part of the NAME section after the module name and hyphen), it should be easily searchable on metacpan. Regardless, it doesn't appear that this distribution is on CPAN currently.

Leave a comment

About Ron Grunwald

user-pic I consider myself a casual programmer these days, as I'm pursuing a career in writing. My main interests are modern Fortran, Perl and C.