-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.PL
65 lines (58 loc) · 1.89 KB
/
Makefile.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use strict;
use warnings;
use ExtUtils::MakeMaker;
use PDL::Core::Dev;
use ExtUtils::F77;
use utf8; # to get author name right
my $f77 = 'ExtUtils::F77';
die "No fortran compiler found. Will not build PDL::Opt::NonLinear on this system\n" if !$f77->testcompiler;
my @pack = (qw(nonlinear.pd NonLinear PDL::Opt::NonLinear), undef, 1);
my @ffiles = map {s/\.f$//; $_} glob("*.f");
my $fobj = join ' ', map {"$_\$(OBJ_EXT)"} @ffiles;
my @cfiles = qw(hooke asa asa_usr dhc de36 select);
my $cobj = join ' ', map "$_\$(OBJ_EXT)", @cfiles;
my %hash = pdlpp_stdargs(\@pack);
$hash{INC} .= " -I."; # uncomment as required
$hash{OBJECT} .= " $cobj $fobj";
$hash{LIBS}[0] .= $f77->runtime . ' -L/usr/local/lib -lport -lblas' ;
$hash{clean}{FILES} .= " $fobj";
WriteMakefile(
%hash,
'ABSTRACT' => 'Non linear optimization routines for PDL',
'AUTHOR' => [ 'Grégory Vanuxem <g.vanuxem@gmail.com>' ],
'LICENSE' => 'artistic_2',
'CONFIGURE_REQUIRES' => { "PDL" => '2.088', "ExtUtils::F77" => 0 },
'PREREQ_PM' => {
'PDL' => '2.088', # =CALC
'PDL::LinearAlgebra' => 0,
},
TEST_REQUIRES => { "Test::More" => '0.88' },
META_MERGE => {
"meta-spec" => { version => 2 },
resources => {
homepage => 'http://pdl.perl.org/',
repository => {
url => 'git://github.com/PDLPorters/PDL-Opt-NonLinear.git',
type => 'git',
web => 'https://github.com/PDLPorters/PDL-Opt-NonLinear',
},
bugtracker => {web=>'https://github.com/PDLPorters/PDL-Opt-NonLinear/issues'},
},
x_IRC => 'irc://irc.perl.org/#pdl',
},
);
sub MY::postamble {
my $mycompiler = $f77->compiler;
my $mycflags = $f77->cflags;
my $orig = pdlpp_postamble(\@pack);
$orig =~ s/:\s*nonlinear\.pd/: nonlinear.pd/;
$orig .= <<EOF;
FC = $mycompiler
FFLAGS = $mycflags -O3 -fPIC
EOF
$orig .join "\n",map {
("
$_\$(OBJ_EXT): $_.f
\$(FC) -c -o \$@ \$(FFLAGS) \$<
" )} @ffiles;
}