#77 PDL::LinearAlgebra - lapack&blas detection compatible with SPP PDL edition

open
nobody
5
2014-05-21
2014-05-21
kmx
No

Hi,

please find enclosed patch with modified lapack&blas lib detection in a way that works with straberry perl PDL/portable.

--
kmx

1 Attachments

Related

Patches: #77

Discussion

  • Chris Marshall
    Chris Marshall
    2014-05-21

    Thanks for the patch. A couple of thoughts/questions:

    (1) Notice the patch uses/assumes pkg-config is present
    which is not always the case. Have you tried adding
    PkgConfig as a dependency and using that directly
    from the Makefile.PL? That should work for SPP and
    a pre-configured ASperl.

    (2) Re LDLOADLIBS, is that required for MSVC builds
    and so may need to be conditionalized?

    --Chris

    On Wed, May 21, 2014 at 5:35 AM, kmx kmx1@users.sf.net wrote:


    Status: open
    Group:
    Labels: LinearAlgebra
    Created: Wed May 21, 2014 09:35 AM UTC by kmx
    Last Updated: Wed May 21, 2014 09:35 AM UTC
    Owner: nobody

    Hi,

    please find enclosed patch with modified lapack&blas lib detection in a
    way that works with straberry perl PDL/portable.

    --
    kmx


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/pdl/patches/77/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Patches: #77

    •  kmx
      kmx
      2014-05-21

      (1) Notice the patch uses/assumes pkg-config is present
      which is not always the case. Have you tried adding
      PkgConfig as a dependency and using that directly
      from the Makefile.PL? That should work for SPP and
      a pre-configured ASperl.

      With the new strawberry perl 5.20.x all these methods will work:
      - pkg-config command
      - PkgConfig module
      -ExtUtils::PkgConfig module

      I am not sure whether it is a good idea to make PkgConfig a dependency but
      we can do something like this:

      my $libs;
      if (eval {require PkgConfig}) {
      $libs = PkgConfig->find('lapack')->get_ldflags;
      }
      if (!$libs && eval {require ExtUtils::PkgConfig}) {
      $libs = ExtUtils::PkgConfig->libs('lapack');
      }
      if (!$libs && pkg-config lapack --modversion}) {
      $libs = pkg-config lapack --libs;
      }
      if (!$libs) {
      $libs = '-llapack -lblas -lgfortran'
      }

      (2) Re LDLOADLIBS, is that required for MSVC builds
      and so may need to be conditionalized?

      I am not sure but EU::MM throws some warnings saying that it does not know
      about LDLOADLIBS

      --
      kmx

       
      •  kmx
        kmx
        2014-05-21

        Or more compressed form:

        my $libs = eval {require PkgConfig; join ' ', PkgConfig->find('lapack')->get_ldflags} ||
                   eval {require ExtUtils::PkgConfig; ExtUtils::PkgConfig->libs('lapack')} ||
                   `pkg-config lapack --libs` ||
                   '-llapack -lblas -lgfortran';
        

        --
        kmx

         
        Last edit: kmx 2014-05-21