in reply to Re^3: Writing threadsafe perl extensions
in thread Writing threadsafe perl extensions

What happens with this?

Still segfaults, unfortunately.

Cheers,
Rob
  • Comment on Re^4: Writing threadsafe perl extensions

Replies are listed 'Best First'.
Re^5: Writing threadsafe perl extensions
by BrowserUk (Patriarch) on Oct 22, 2007 at 00:01 UTC

    Sorry I can't help more. I grabbed Math::GMP and whilst it built fine, but craps out very early in make test with "The procedure entrypoint __gmpz_sqrt could not be located in the DLL gmp.dll". There seems to be a fundemental conflict between an XS extension to call functions in a file called gmp.dll, itself being called gmp.dll.

    (As an aside, why do so few of these modules that have dependancies on third party libraries never bother to give pointers to where to get them, or even mention the dependancy, in the POD?)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Sorry I can't help more

      That's ok - you've alrready gone to more trouble than is warranted.

      There seems to be a fundemental conflict between an XS extension to call functions in a file called gmp.dll, itself being called gmp.dll

      Yes (on Win32 anyway), the dll that perl builds needs to have a different name to the the third party dll. I struck a similar problem trying to build PGPLOT. One workaround is to have perl build a dll with a different extension by specifying in WriteMakefile() something like:
      DLEXT => 'xs.dll',
      The bootstrap() call in GMP.pm then also needs to be changed:
      if($^O =~ /mswin32/i) { local $DynaLoader::dl_dlext = 'xs.dll'; bootstrap Math::GMP $VERSION; } else {bootstrap Math::GMP $VERSION}
      That should result in perl building a dll called gmp.xs.dll - which won't get confused with the gmp.dll that you already have.

      .. why do so few of these modules that have dependancies on third party libraries never bother to give pointers to where to get them, or even mention the dependancy

      Good question - and I can't really answer for Math::GMP. In my view, that info should be provided in the README - and I have GMP-based modules that do that. I guess it wouldn't hurt to duplicate that info in the POD - which I will do.

      Cheers,
      Rob

        Bah, fooey! One day, someone is going to realise that this build system is ...

        c:\Perl\packages\Math-GMP-2.04>nmake Microsoft (R) Program Maintenance Utility Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSO +LE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTE +XT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DN +DEBUG -O1 -DV cl : Command line warning D4029 : optimization is not available in the + standard edition compiler GMP.c Running Mkbootstrap for Math::GMP () C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 GMP.bs C:\Perl\bin\perl.exe -MExtUtils::Mksymlists -e "Mksymlists('N +AME'=>\"Math::GMP\", 'DLBASE' => 'GMP', 'DL_FUNCS' => { }, 'FUNCLIST +' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" link -out:blib\arch\auto\Math\GMP\GMP.xs.dll -dll -nologo -nod +efaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -machine: +x86 GMP.obj C:\Perl\lib\CORE\perl58.lib gmp.lib c:\cl\lib\oldnames. +lib c:\cl\lib\ke Creating library blib\arch\auto\Math\GMP\GMP.xs.lib and object blib +\arch\auto\Math\GMP\GMP.xs.exp GMP.xs.exp : warning LNK4070: /OUT:GMP.dll directive in .EXP differs f +rom output filename 'blib\arch\auto\Math\GMP\GMP.xs.dll'; ignoring di +rective C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 755 blib\arc +h\auto\Math\GMP\GMP.xs.dll C:\Perl\bin\perl.exe -MExtUtils::Command -e cp GMP.bs blib\arc +h\auto\Math\GMP\GMP.bs C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 blib\arc +h\auto\Math\GMP\GMP.bs c:\Perl\packages\Math-GMP-2.04>nmake test Microsoft (R) Program Maintenance Utility Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harn +ess(0, 'blib\lib', 'blib\arch')" t\gmppm.t t\gmppm....Can't load 'C:\Perl\packages\Math-GMP-2.04\blib\arch/auto/M +ath/GMP/GMP.xs.dll' for module Math::GMP: load_file:The specified pro +cedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. at t\gmppm.t line 7 Compilation failed in require at t\gmppm.t line 7. BEGIN failed--compilation aborted at t\gmppm.t line 7. t\gmppm....dubious Test returned status 255 (wstat 65280, 0xff00) FAILED--1 test script could be run, alas--no output ever seen NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x2' Stop.

        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.