Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PDL CPAN distribution.

Report information
The Basics
Id: 67568
Status: resolved
Priority: 0/
Queue: PDL

People
Owner: Nobody in particular
Requestors: kmx [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.4.8
Fixed in: 2.014



Subject: Improved ext. libraries detection
Hi,

please find enclosed patch enhancing ext. lib. detection logic.

The patch is focused mostly on strawberryperl users but could be handy also for other platforms.

--
kmx
Subject: PDL-2.4.8.diff
diff -ru PDL-2.4.8.orig\Graphics\PLplot\Makefile.PL PDL-2.4.8\Graphics\PLplot\Makefile.PL --- PDL-2.4.8.orig\Graphics\PLplot\Makefile.PL Tue Mar 22 02:40:18 2011 +++ PDL-2.4.8\Graphics\PLplot\Makefile.PL Mon Apr 18 23:00:17 2011 @@ -69,6 +69,7 @@ '/opt/lib', '/ops/tools/lib', '/sw/lib/', # default FINK installation + split(/ /, $Config{libpth}), $PDL::Config{WHERE_PLPLOT_LIBS}, # Add new library paths here!! ) { @@ -103,6 +104,7 @@ '/ops/tools/include/plplot', '/ops/tools/include', '/sw/include/plplot/', # default FINK installation + $Config{usrinc}.'/plplot', $PDL::Config{WHERE_PLPLOT_INCLUDE}, # Add new header paths here!! ) { diff -ru PDL-2.4.8.orig\IO\GD\Makefile.PL PDL-2.4.8\IO\GD\Makefile.PL --- PDL-2.4.8.orig\IO\GD\Makefile.PL Fri Mar 18 17:16:31 2011 +++ PDL-2.4.8\IO\GD\Makefile.PL Tue Apr 19 00:22:02 2011 @@ -6,6 +6,7 @@ # use ExtUtils::MakeMaker; +use Config; PDL::Core::Dev->import(); BEGIN @@ -26,10 +27,12 @@ '/usr/lib', '/usr/local/lib', '/lib', + split(/ /, $Config{libpth}), ); @inc_locations = ( '/usr/include', '/usr/local/include', + $Config{usrinc}, ); # diff -ru PDL-2.4.8.orig\IO\HDF\Makefile.PL PDL-2.4.8\IO\HDF\Makefile.PL --- PDL-2.4.8.orig\IO\HDF\Makefile.PL Wed Mar 23 02:28:33 2011 +++ PDL-2.4.8\IO\HDF\Makefile.PL Mon Apr 18 23:55:07 2011 @@ -35,7 +35,8 @@ '/opt/local/lib', '/usr/lib', '/usr/lib/hdf', - '/opt/lib' + '/opt/lib', + split(/ /, $Config{libpth}), ); @HDF_inc_locations = ( '/usr/local/include', @@ -43,7 +44,8 @@ '/opt/local/include', '/usr/include', '/usr/include/hdf', - '/opt/include' + '/opt/include', + $Config{usrinc}, ); # get locations from perldl.conf, if specified there: diff -ru PDL-2.4.8.orig\Lib\FFTW\Makefile.PL PDL-2.4.8\Lib\FFTW\Makefile.PL --- PDL-2.4.8.orig\Lib\FFTW\Makefile.PL Sat Jul 24 20:39:28 2010 +++ PDL-2.4.8\Lib\FFTW\Makefile.PL Tue Apr 19 00:24:13 2011 @@ -2,6 +2,7 @@ # Makefile.PL for a package defined by PP code. use ExtUtils::MakeMaker; +use Config; PDL::Core::Dev->import(); @@ -33,8 +34,8 @@ # Look for FFTW includes/libs # default locations: - @FFTW_inc_locations = ('/usr/local/include'); - @FFTW_lib_locations = ('/lib','/usr/lib','/usr/local/lib'); + @FFTW_inc_locations = ('/usr/local/include', $Config{usrinc}); + @FFTW_lib_locations = ('/lib','/usr/lib','/usr/local/lib',split(/ /, $Config{libpth})); # get locations from perldl.conf, if specified there: @FFTW_inc_locations = @{$PDL::Config{FFTW_INC}} if( defined $PDL::Config{FFTW_INC} ); diff -ru PDL-2.4.8.orig\Lib\GIS\Proj\Makefile.PL PDL-2.4.8\Lib\GIS\Proj\Makefile.PL --- PDL-2.4.8.orig\Lib\GIS\Proj\Makefile.PL Fri Mar 25 01:04:51 2011 +++ PDL-2.4.8\Lib\GIS\Proj\Makefile.PL Tue Apr 19 00:24:38 2011 @@ -6,6 +6,7 @@ # use ExtUtils::MakeMaker; +use Config; PDL::Core::Dev->import(); use lib '../../../inc'; @@ -27,11 +28,13 @@ '/lib64', '/usr/lib', '/usr/local/lib', - '/lib' + '/lib', + split(/ /, $Config{libpth}), ); @inc_locations = ( '/usr/include', - '/usr/local/include' + '/usr/local/include', + $Config{usrinc}, ); # diff -ru PDL-2.4.8.orig\Lib\Transform\Proj4\Makefile.PL PDL-2.4.8\Lib\Transform\Proj4\Makefile.PL --- PDL-2.4.8.orig\Lib\Transform\Proj4\Makefile.PL Fri Mar 25 01:04:56 2011 +++ PDL-2.4.8\Lib\Transform\Proj4\Makefile.PL Tue Apr 19 00:27:00 2011 @@ -27,11 +27,13 @@ '/lib64', '/usr/lib', '/usr/local/lib', - '/lib' + '/lib', + split(/ /, $Config{libpth}), ); @inc_locations = ( '/usr/include', - '/usr/local/include' + '/usr/local/include', + $Config{usrinc}, ); #
On strawberryperl (with incdir like d:/strawberry/include) I need to patch also perldl.conf  (on the top of the previous patch).

In perldl.conf I have commented the following lines:
Show quoted text
#        FFTW_LIBS => [ '/lib','/usr/lib','/usr/local/lib'],
#        FFTW_INC => ['/usr/include/','/usr/local/include'],

as it makes autodetection in Lib/FFTW/Makefile.PL useless

--
kmx


Thanks for the patch suggestion.  One of our development
priorities for the next PDL release is to refactor the many
external dependencies for PDL using the Alien::XXX framework.
Good detection logic will be important for that to work well.

Another approach I would like to see PDL move to
is to use the Devel::CheckLib module as the default
mechanism to test for library features.

FYI: PDL development takes place on our sf.net site
and discussion via the mailing lists.  See the official
PDL web site to links to both:

    http://pdl.perl.org

It can be hit or miss as to when we get to the cpan
bugs tracker reports since we don't use it beyond
checking and forwarding any bugs that show up.

Thanks for helping out,
Chris


CC: kmx [...] cpan.org
Subject: Re: [rt.cpan.org #67568] Improved ext. libraries detection
Date: Tue, 19 Apr 2011 09:10:07 +0200
To: bug-PDL [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Dne 19.4.2011 1:33, Chris Marshall via RT napsal(a): Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=67568 > > > Thanks for the patch suggestion. One of our development > priorities for the next PDL release is to refactor the many > external dependencies for PDL using the Alien::XXX framework. > Good detection logic will be important for that to work well.
OK. BTW I am (co)maintainer of 3 Alien::* distributions on CPAN - if you wanna discuss my experiences drop me an e-mail when PDL comes nears the switch to Alien::* approach. Show quoted text
> FYI: PDL development takes place on our sf.net site > and discussion via the mailing lists. See the official > PDL web site to links to both: > > http://pdl.perl.org > > It can be hit or miss as to when we get to the cpan > bugs tracker reports since we don't use it beyond > checking and forwarding any bugs that show up.
Sorry, I have missed that (I simply click on "bug report" link at PDL's cpan page). Should I repost my patch to sf.net? or create a patch against got repo? In that case I propose to add some meta information into the main Makefile.PL - for example: --- Makefile.PL.orig Sat Mar 12 18:23:32 2011 +++ Makefile.PL Tue Apr 19 09:02:50 2011 @@ -511,6 +511,13 @@ 'VERSION_FROM' => 'Basic/Core/Version.pm', 'EXE_FILES' => \@exe_files, 'PM' => { @podpms }, #so that the script docs are picked up + 'META_MERGE' => { + resources => { + homepage => 'http://pdl.perl.org/', + bugtracker => 'http://sourceforge.net/tracker/?atid=100612&group_id=612&func=browse', + repository => 'http://pdl.git.sourceforge.net/git/gitweb.cgi?p=pdl/pdl', + }, + }, 'MAN1PODS' => { 'perldl' => '$(INST_MAN1DIR)/perldl.$(MAN1EXT)', 'pdldoc' => '$(INST_MAN1DIR)/pdldoc.$(MAN1EXT)' }, 'MAN3PODS' => {}, # don't pick up the script pods again These meta infos will show on PDL's cpan page. -- kmx
On Tue Apr 19 03:10:18 2011, kmx@volny.cz wrote:
Show quoted text
>
> OK. BTW I am (co)maintainer of 3 Alien::* distributions on CPAN - if you
> wanna discuss my experiences drop me an e-mail when PDL comes nears the
> switch to Alien::* approach.

Will do.  In reviewing the various existing Alien::* implementations,
I noticed that you had a number of them and that they appeared
to be more feature complete than some of the others.  Given
that I would be starting from scratch with Module::Build and
the Alien process, your modules looked like the best source
for a starting template.  Since PDL has a large number of
external dependencies, I would like to make a template framework
that could be rapidly populated for each dependency, sort of
an Devel::Alien::Builder...

Show quoted text
>
> > FYI: PDL development takes place on our sf.net site
> > and discussion via the mailing lists. See the official
> > PDL web site to links to both:
> >
> > http://pdl.perl.org
> >
> > It can be hit or miss as to when we get to the cpan
> > bugs tracker reports since we don't use it beyond
> > checking and forwarding any bugs that show up.
>
> Sorry, I have missed that (I simply click on "bug report" link at PDL's
> cpan page).
>
> Should I repost my patch to sf.net? or create a patch against got repo?

It would appreciate if you could repost it to sf.net.  The patch
is simple enough that it should apply to current git.  Of course,
patches against current git are optimal.  :-)

Show quoted text
> In that case I propose to add some meta information into the main
> Makefile.PL - for example:
>
> --- Makefile.PL.orig Sat Mar 12 18:23:32 2011
> +++ Makefile.PL Tue Apr 19 09:02:50 2011
> @@ -511,6 +511,13 @@
> 'VERSION_FROM' => 'Basic/Core/Version.pm',
> 'EXE_FILES' => \@exe_files,
> 'PM' => { @podpms }, #so that the script docs are picked up
> + 'META_MERGE' => {
> + resources => {
> + homepage => 'http://pdl.perl.org/',
> + bugtracker =>
> 'http://sourceforge.net/tracker/?atid=100612&amp;group_id=612&amp;func=browse',
> + repository =>
> 'http://pdl.git.sourceforge.net/git/gitweb.cgi?p=pdl/pdl',
> + },
> + },
> 'MAN1PODS' => { 'perldl' =>
> '$(INST_MAN1DIR)/perldl.$(MAN1EXT)',
> 'pdldoc' =>
> '$(INST_MAN1DIR)/pdldoc.$(MAN1EXT)' },
> 'MAN3PODS' => {}, # don't pick up the script pods again

Thanks for the META info tip.  Will definitely fold
that in (anything that makes it easier for PDL
users to ask questions through the mailing list
or to contribute or to report bugs benefits the
PDL community).

--Chris
Show quoted text
>
> These meta infos will show on PDL's cpan page.
>
> --
> kmx
>


Thanks kmx.  The patches are applied to PDL git
and will appear in the next PDL developers release.
Show quoted text
> > Should I repost my patch to sf.net? or create a patch against got repo?
>
> It would appreciate if you could repost it to sf.net. The patch
> is simple enough that it should apply to current git. Of course,
> patches against current git are optimal. :-)

reposted, closing this ticket

--
kmx

Subject: Re: [rt.cpan.org #67568] Improved ext. libraries detection
Date: Wed, 20 Apr 2011 14:08:31 +0200
To: bug-PDL [...] rt.cpan.org
From: Dvaid Miko <david.miko [...] email.cz>
Show quoted text
> Will do. In reviewing the various existing Alien::* implementations, > I noticed that you had a number of them and that they appeared > to be more feature complete than some of the others. Given > that I would be starting from scratch with Module::Build and > the Alien process, your modules looked like the best source > for a starting template. Since PDL has a large number of > external dependencies, I would like to make a template framework > that could be rapidly populated for each dependency, sort of > an Devel::Alien::Builder...
I could even imagine something like Module::Build::Alien which could be used like: ######## Build.PL ######## use strict; use warnings; use Module::Build::Alien; my $builder = Module::Build::Alien->new( module_name => 'Alien::Whatever', dist_version_from => 'lib/Alien/Whatever.pm', dist_author => 'KMX, kmx@cpan.org', license => 'perl', requires => { ... }, configure_requires => { ... }, build_requires => { ... }, alien_src_tarball => { url=>'http://..../whatever.tgz', sha1=>'12e23f7c1b5...' }; alien_src_patches => ['patches/patch1.diff','patches/patch1.diff']; alien_build_commands => [ [qw(./configure --disable-dependency-tracking --enable-static=yes --enable-shared=no --with-extra-lib --prefix=__BUILDROOT__)], [qw(make all)], [qw(make install)], ]; ); $builder->create_build_script(); ######## end of Build.PL ######## with properly sub-classed methods ACTION_install(), ACTION_code() -- kmx
sorry, should be a private message to chris
Yes, that is a better namespace for the functionality.  It is
compatible with the Alien::XXX preferred use of Module::Build

Also, thanks for the META_MERGE suggestion for our
Makefile.PL.  It worked where I copied your syntax.  Where
I went by the documentation search.cpan.org did not
pick it up.

--Chris

On Wed Apr 20 08:08:45 2011, david.miko@email.cz wrote:
Show quoted text
>
> > Will do. In reviewing the various existing Alien::* implementations,
> > I noticed that you had a number of them and that they appeared
> > to be more feature complete than some of the others. Given
> > that I would be starting from scratch with Module::Build and
> > the Alien process, your modules looked like the best source
> > for a starting template. Since PDL has a large number of
> > external dependencies, I would like to make a template framework
> > that could be rapidly populated for each dependency, sort of
> > an Devel::Alien::Builder...
>
> I could even imagine something like Module::Build::Alien which could be
> used like:
>
> ######## Build.PL ########
> use strict;
> use warnings;
> use Module::Build::Alien;
>
> my $builder = Module::Build::Alien->new(
> module_name => 'Alien::Whatever',
> dist_version_from => 'lib/Alien/Whatever.pm',
> dist_author => 'KMX, kmx@cpan.org',
> license => 'perl',
> requires => {
> ...
> },
> configure_requires => {
> ...
> },
> build_requires => {
> ...
> },
> alien_src_tarball => { url=>'http://..../whatever.tgz',
> sha1=>'12e23f7c1b5...' };
> alien_src_patches => ['patches/patch1.diff','patches/patch1.diff'];
> alien_build_commands => [
> [qw(./configure --disable-dependency-tracking --enable-static=yes
> --enable-shared=no --with-extra-lib --prefix=__BUILDROOT__)],
> [qw(make all)],
> [qw(make install)],
> ];
> );
>
> $builder->create_build_script();
> ######## end of Build.PL ########
>
> with properly sub-classed methods ACTION_install(), ACTION_code()
>
> --
> kmx
>