Module::Build::Pluggable::Fortran - Plugin for Module::Build to compile Fortran .f files
.f
version 0.27
# Build.PL use strict; use warnings; use Module::Build::Pluggable ('Fortran'); my $builder = Module::Build::Pluggable->new( dist_name => 'PDL::My::Module', license => 'perl', f_source => [ 'src' ], requires => { }, configure_requires => { 'Module::Build' => '0.4004', 'Module::Build::Pluggable' => '0', 'Module::Build::Pluggable::Fortran' => '0.20', }, ); $builder->create_build_script();
This is a plugin for Module::Build (using Module::Build::Pluggable) that will assist in building distributions that require Fortran .f files to be compiled. Please see the Module::Build::Authoring documentation if you are not familiar with it.
build_requires => { 'ExtUtils::F77' => '0', 'ExtUtils::CBuilder' => '0.23', },
You can, or course, require your own versions of these modules by adding them to requires = {}> as usual.
requires =
The directories specified by the f_source array within your distribution will be searched for .f files which are, immediately prior to the build phase, compiled into .o files. This is accomplished (effectively) by running:
.o
my $mycompiler = ExtUtils::F77->compiler(); my $mycflags = ExtUtils::F77->cflags(); system( "$mycompiler -c -o $file.o $mycflags -O3 -fPIC $file.f" );
extra_linker_flags => $PDL::Config{MALLOCDBG}->{libs} if $PDL::Config{MALLOCDBG}->{libs}; extra_linker_flags => ExtUtils::F77->runtime, <your fortran object files>
Adds the linker flags from ExtUtils::F77 and all the .o object files created from the .f Fortran files.
ExtUtils::F77
Module::Build::Pluggable, Module::Build
Mark Grimes, <mgrimes@cpan.org>
This software is copyright (c) 2019 by Mark Grimes, <mgrimes@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Module::Build::Pluggable::Fortran, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Build::Pluggable::Fortran
CPAN shell
perl -MCPAN -e shell install Module::Build::Pluggable::Fortran
For more information on module installation, please visit the detailed CPAN module installation guide.