Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pack "D" for ldouble not available for all Perl #374

Closed
zmughal opened this issue Jan 25, 2022 · 1 comment · Fixed by #375
Closed

pack "D" for ldouble not available for all Perl #374

zmughal opened this issue Jan 25, 2022 · 1 comment · Fixed by #375

Comments

@zmughal
Copy link
Member

zmughal commented Jan 25, 2022

$ use PDL;
$ ldouble(0)
Runtime error: Invalid type 'D' in pack at /perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux/PDL/Core.pm line 1211.

But it will be available on more Perls with Perl/perl5#18517.

Perhaps a similar fix to

sub PDL::new {
# ...
      } elsif ($Config{ivsize} < 8 && $pack[$new->get_datatype] eq 'q*') {
         # special case when running on a perl without 64bit int support
         # we have to avoid pack("q", ...) in this case
         # because it dies with error: "Invalid type 'q' in pack"
         $new->setdims([]);
         set_c($new, [0], $value);
# ...

is needed.

zmughal added a commit that referenced this issue Jan 25, 2022
Otherwise use workaround.

Fixes <#374>.
zmughal added a commit that referenced this issue Jan 25, 2022
Otherwise use workaround.

Fixes <#374>.
zmughal added a commit that referenced this issue Jan 25, 2022
Otherwise use workaround.

Fixes <#374>.
mohawk2 pushed a commit that referenced this issue Jan 25, 2022
Check pack("D") is available else use workaround - fix #374
@mohawk2
Copy link
Member

mohawk2 commented Jan 25, 2022

Great work @zmughal! We should probably document this limitation, and PDL::new looks like it might benefit from a proper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants