I noticed that MB::Pluggable::Fortran cleans the file f77_underscore,
although that file is not generated during the build process. However
that file is generated, for example, in the build process of
PDL::Slatec as a hack to find out if Fortran routine names ought to be
followed by an underscore when called from a .pd file. I had copied
the relevant code from the Makedfile of PDL::Slatec to my Build.PL
file and it did work properly, except for an inconvenience. When I
'./Build clean', that file disappears, so if I './Build' again without
running 'perl Build.PL' first, my underscores dissapear from the calls
to my Fortran routines and they can no longer be linked to my PDL
code. Thus I guess that the file f77_underscore should be rebuilt every time I 
'./Build' my
package, and not only when 'Build' is created. To that end I made a
further change to my MB::Pluggable::Fortran.pm routine, adding the
appropriate code from PDL::Slatec's Makefile.PL to the sub routine
HOOK_build. I attach a patch. So far, it seems to work.

Best regards,
Luis



On Wed, Jan 27, 2016 at 08:49:23AM -0600, Luis Mochan wrote:
> Hello Mark,
> Thank you! The module is simplifying the preparation of my packages,
> and seems to be working nicely now.
> Best regards,
> Luis

-- 

                                                                  o
W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
Apdo. Postal 48-3, 62251             |                           (*)/\/  \
Cuernavaca, Morelos, México          | [email protected]   /\_/\__/
GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB


*** Fortran.pm	2016-01-28 18:10:47.703398767 -0600
--- /home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.1/Module/Build/Pluggable/Fortran.pm	2016-01-28 18:29:56.022810851 -0600
***************
*** 46,51 ****
--- 46,59 ----
  
      my $mycompiler = ExtUtils::F77->compiler();
      my $mycflags   = ExtUtils::F77->cflags();
+     #Find if we need trailing underscores in fortran
+     #if we do, create a notice which may be used by .pd files later on.
+     my $trail = ExtUtils::F77->trail_;
+     unlink("f77_underscore") if -e "f77_underscore";
+     if ($trail) {
+ 	open OUT, ">f77_underscore" or die "unable to write scratch file";
+ 	close OUT;
+     }
      undef $mycflags if $mycflags =~ m{^\s*};    # Avoid empty arg in cmd
  
      my $f_src_files = $self->_fortran_files;
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to