Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^7: Perl XS binding to a struct with an array of chars*

by GrandFather (Saint)
on Nov 24, 2022 at 21:06 UTC ( [id://11148359]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Perl XS binding to a struct with an array of chars*
in thread Perl XS binding to a struct with an array of chars*

I thought I'd have a crack at demoing how char *[] might hang together. So first I downloaded your code, then realised I didn't have Inline or Inline::C installed, so I set about doing that using cpanm. The Inline install was quick and trouble free. The Inline::C install however has reached:

... Building and testing Tie-IxHash-1.23 ... OK Successfully installed Tie-IxHash-1.23 Building and testing Pegex-0.75 ... OK Successfully installed Pegex-0.75 --> Working on Win32::Mutex Fetching http://www.cpan.org/authors/id/C/CJ/CJM/Win32-IPC-1.11.tar.gz + ... OK Configuring Win32-IPC-1.11 ... OK Building and testing Win32-IPC-1.11 ... OK Successfully installed Win32-IPC-1.11 Building and testing Inline-C-0.82 ...

and has been sitting there for the last half hour with no apparent progress. This is on Windows 10 and Strawberry Perl 5.32.1:

Summary of my perl5 (revision 5 version 32 subversion 1) configuration +: Platform: osname=MSWin32 osvers=10.0.19042.746 archname=MSWin32-x86-multi-thread-64int uname='Win32 strawberry-perl 5.32.1.1 #1 Sun Jan 24 12:17:47 2021 +i386'

Ideas?

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Replies are listed 'Best First'.
Re^8: Perl XS binding to a struct with an array of chars*
by syphilis (Archbishop) on Nov 24, 2022 at 23:26 UTC
    Ideas?

    It can take a few minutes to run through the test suite, but 30 minutes is a bit extreme.

    I see you've got a 32-bit build of Strawberry Perl. That's a little uncommon these days, but should not be an issue.
    I've just installed Inline-C-0.82 on a 32-bit SP-5.32.1.1 using cpanm, and it all went fine.
    Try turning on verbosity (cpanm -vi Inline::C). That should at least show us where the hang is happening.

    Cheers,
    Rob

      Hi Rob, I have had endless trouble installing "interesting" modules on my work machine. No Idea why, but I've found it impossible to install Tk against any version of Strawberry Perl I care to try and a multitude of other modules (which I don't remember) have given grief. I installed Win32::IPC and rerun the Inline::C install. It at least completes now, but fails most of its tests. So I installed it with force. Your sample code then at least starts running, but fails with:

      "C:\STRAWB~2\perl\bin\perl.exe" -MExtUtils::Command -e mv -- noname_pl +_cf1b.xsc noname_pl_cf1b.c gcc -c -iquote"D:/Scratch~~/PerlScratch" -DWIN32 -D__USE_MINGW_ANSI_S +TDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_ +SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 + -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" "-IC:\STRAWB~2\perl\lib\CO +RE" noname_pl_cf1b.c cc1.exe: error: unrecognized command line option "-iquoteD:/Scratch~~/ +PerlScratch" gmake: *** [Makefile:333: noname_pl_cf1b.o] Error 1 A problem was encountered while attempting to compile and install your + Inline C code. The command that failed was: "gmake" with error code 2 ...

      I'm not going to pursue this at work, but I may pick it up again at home.

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
        I'm not going to pursue this at work, but I may pick it up again at home.

        That "work" environment seems pretty weird to me.
        Things might improve there if, rather than using the .msi version they've provided, you installed and ran the "portable" 32-bit SP-5.32.1.1 build on that machine. (I believe you can do that as User.)
        Similarly, on your home PC I recommend installing the portable version over the .msi option.

        And I do encourage people to install and use Inline::C.
        It's the ideal way of doing C and perl API experiments to investigate and tweak the things that will/won't work in the XS environment.

        Cheers,
        Rob.
Re^8: Perl XS binding to a struct with an array of chars*
by Marshall (Canon) on Nov 24, 2022 at 21:34 UTC
    I looked at tester matrix: 5.32.1 Win32 and I don't see any red flags.

    The main CPAN Inline::C page lists:
    - ExtUtils::MakeMaker
    - File::Spec
    - Inline
    - Parse::RecDescent
    - Pegex
    as dependencies. I would suggest making sure each of those are installed by doing them one at a time. Could be some dependency is missing and build of Inline::C doesn't quite handle the error case quite right? Dunno.

      The main CPAN Inline::C page lists ... as dependencies

      There's a module missing from that list. Win32::Mutex, which is part of the Win32::IPC distro, is also a dependency (on Windows only, of course).
      This bug in Inline::C is not normally an issue on Strawberry Perl because that dependency usually gets picked up anyway.
      But you can't be certain if/when/how it will manifest itself and, if it bites, then you just have to cpanm -i Win32::IPC.

      Cheers,
      Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-19 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found