#351 PDL_BOOT has wrong XS code

feature_request
closed-accepted
None
5
2014-04-12
2014-03-04
mohawk
No

PDL::API refers to PDL_Boot (defined in PDL::Core::Dev). That gives code including:
perl_require_pv ("PDL::Core");

That does not work. You need to have:
perl_require_pv ("PDL/Core.pm");

Related

Bugs: #351

Discussion

  • Chris Marshall
    Chris Marshall
    2014-03-04

    Thanks for reporting the problem. It appears that perl_require_pv() has changed usage since the perl 5.005 days. The appropriate replacement for current perls is probably 'load_module'. At the least a documentation update is required.

     
  • mohawk
    mohawk
    2014-04-05

    If you would like me to create a doc patch, please let me know (I am now competent-ish with git).

     
    • Chris Marshall
      Chris Marshall
      2014-04-05

      Please do. Many hands makes light work.

      Thebest place for PDL discussion is via the mailing lists:
      perldl for general problems and pdl-porters more specific
      to PDL internal development discussions. See

      http://pdl.perl.org/?page=mailing-lists

      for links to sign up to the lists (members only discussion).

      On Fri, Apr 4, 2014 at 9:01 PM, mohawk mohawk111@users.sf.net wrote:

      If you would like me to create a doc patch, please let me know (I am now
      competent-ish with git).


      Status: open
      Group: feature_request
      Created: Tue Mar 04, 2014 03:03 AM UTC by mohawk
      Last Updated: Tue Mar 04, 2014 04:17 AM UTC
      Owner: nobody

      PDL::API refers to PDL_Boot (defined in PDL::Core::Dev). That gives code
      including:
      perl_require_pv ("PDL::Core");

      That does not work. You need to have:
      perl_require_pv ("PDL/Core.pm");


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/pdl/bugs/351/

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

       

      Related

      Bugs: #351

  • mohawk
    mohawk
    2014-04-12

    [user@localhost tmp]$ perl -e 'use Inline C=>q#void req() { perl_require_pv ("Math::BigInt"); } #; req; Math::BigInt->bnan'
    Can't locate object method "bnan" via package "Math::BigInt" (perhaps you forgot to load "Math::BigInt"?) at -e line 1.

    [user@localhost tmp]$ perl -e 'use Inline C=>q#void req() { perl_require_pv ("Math/BigInt.pm"); } #; req; Math::BigInt->bnan'

    The answer to your question "how does the path get set correctly that 'PDL/Core.pm' can be gotten to from the current path?" is that require uses @INC, so it "just happens".

     
  • mohawk
    mohawk
    2014-04-12

    By the way, perl_require_pv sets $@ if it fails:

    [user@localhost tmp]$ perl -e 'use Inline C=>q#void req() { perl_require_pv ("Math/BigInt.pm"); } #; req; $@?die:print Math::BigInt->bnan,"\n"'
    NaN

    [user@localhost tmp]$ perl -e 'use Inline C=>q#void req() { perl_require_pv ("Math::BigInt"); } #; req; $@?die:print Math::BigInt->bnan,"\n"'
    Can't locate Math::BigInt in @INC (@INC contains: /tmp/_Inline/lib /usr/local/lib/perl5/site_perl/5.18.1/x86_64-linux /usr/local/lib/perl5/site_perl/5.18.1 /usr/local/lib/perl5/5.18.1/x86_64-linux /usr/local/lib/perl5/5.18.1 .) at (eval 5) line 1.
    ...propagated at -e line 1.

     
  • Chris Marshall
    Chris Marshall
    2014-04-12

    • status: open --> closed-accepted
    • assigned_to: Chris Marshall
     
  • Chris Marshall
    Chris Marshall
    2014-04-12

    Patch applied to pdl-code git repo on core-cleanup branch.
    Thanks.