Hi Hernan, Well ... it was never going to actually be a solution anyway. We would still want to find out why the behaviour was occurring :-)
I’ve just checked, and I’m running the same version of netcdf as you are (4.2.1.1). And PDL::NetCDF built fine for me (on MS Windows). It’s probably not a good idea to be messing with the contents of DynaLoader.pm, but that’s exactly what I’d do if I was getting that error. Line 122 of DynaLoader.pm is currently a blank line. I would change it to: warn “\n\$xs: $xs\n”; If it’s not a coderef, let’s try and find out what the hell it is ! Be aware that the error message could be bogus. Just a few lines before line 123 in DynaLoader.pm we find the following comments: # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of DynaLoader.pm. # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed. However, I think this one might just turn out to be legitimate. Cheers, Rob From: Hernán De Angelis Sent: Sunday, September 15, 2013 10:31 PM To: [email protected] Cc: [email protected] Subject: Re: [Perldl] PDL::NetCDF problem "Not a CODE reference..." Rob, thanks for the answer and the suggested solution. Unfortunately it did not work. I get the same messages as when running "make test": PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01-Netcdf3.t .. 1/52 # Failed test 'use PDL::NetCDF;' # at t/01-Netcdf3.t line 7. # Tried to use 'PDL::NetCDF'. # Error: Not a CODE reference at /usr/lib/perl5/5.16.2/i586-linux-thread-multi/DynaLoader.pm line 213. # END failed--call queue aborted at /root/.cpan/build/PDL-NetCDF-4.17-V_3ZUS/blib/lib/PDL/NetCDF.pm line 213. # Compilation failed in require at (eval 42) line 2. # BEGIN failed--compilation aborted at (eval 42) line 2. Use of uninitialized value in subroutine entry at /root/.cpan/build/PDL-NetCDF-4.17-V_3ZUS/blib/lib/PDL/NetCDF.pm line 1380. put: Cannot define variable -- NetCDF: Not a valid data type or _FillValue type mismatch at t/01-Netcdf3.t line 26. # Looks like you planned 52 tests but ran 5. # Looks like you failed 1 test of 5 run. # Looks like your test exited with 2 just after 5. t/01-Netcdf3.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 48/52 subtests t/02-Netcdf4.t .. 1/21 # Failed test 'use PDL::NetCDF;' # at t/02-Netcdf4.t line 8. # Tried to use 'PDL::NetCDF'. # Error: Not a CODE reference at /usr/lib/perl5/5.16.2/i586-linux-thread-multi/DynaLoader.pm line 213. # END failed--call queue aborted at /root/.cpan/build/PDL-NetCDF-4.17-V_3ZUS/blib/lib/PDL/NetCDF.pm line 213. # Compilation failed in require at (eval 29) line 2. # BEGIN failed--compilation aborted at (eval 29) line 2. Use of uninitialized value in subroutine entry at /root/.cpan/build/PDL-NetCDF-4.17-V_3ZUS/blib/lib/PDL/NetCDF.pm line 1380. put: Cannot define variable -- NetCDF: Not a valid data type or _FillValue type mismatch at t/02-Netcdf4.t line 40. # Looks like you planned 21 tests but ran 14. # Looks like you failed 1 test of 14 run. # Looks like your test exited with 2 just after 14. t/02-Netcdf4.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 8/21 subtests Test Summary Report ------------------- t/01-Netcdf3.t (Wstat: 512 Tests: 5 Failed: 1) Failed test: 2 Non-zero exit status: 2 Parse errors: Bad plan. You planned 52 tests but ran 5. t/02-Netcdf4.t (Wstat: 512 Tests: 14 Failed: 1) Failed test: 1 Non-zero exit status: 2 Parse errors: Bad plan. You planned 21 tests but ran 14. Files=2, Tests=19, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.39 cusr 0.04 csys = 0.47 CPU) Result: FAIL Failed 2/2 test programs. 2/19 subtests failed. make: *** [test_dynamic] Error 2 I keep searching for a solution. No ideas yet .... Hernán 2013/9/15 <[email protected]> From: Hernán De Angelis I repeatedly get the following error during test: Error: Not a CODE reference at /usr/lib/perl5/5.16.2/i586-linux-thread-multi/DynaLoader.pm line 213. Try running the test script as: perl -Mblib t/scriptname.t DynaLoader.pm line 213 (perl-5.16.0) was throwing up a warning for me in a test suite I was running just yesterday. When I ran the particular test file as 'perl -Mblib t/script.t' the warning went away. I'm wondering whether the same approach will make your error go away. Cheers, Rob -- Hernán De Angelis http://talesoficeandstone.blogspot.se/
_______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
