BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone successfully built this (obscure) module on Win32 native? Thanks.

Generate.c Generate.xs(102) : warning C4101: 'val' : unreferenced local variable Generate.xs(220) : warning C4101: 'value' : unreferenced local variabl +e Generate.xs(241) : warning C4101: 'value' : unreferenced local variabl +e Generate.xs(463) : warning C4133: '=' : incompatible types - from 'SV +*' to 'B__CV' Generate.xs(617) : warning C4244: '=' : conversion from 'I32' to 'U16' +, possible loss of data Generate.c(883) : warning C4101: 'RETVAL' : unreferenced local variabl +e Generate.xs(638) : warning C4244: '=' : conversion from 'I32' to 'U16' +, possible loss of data Generate.xs(645) : warning C4013: 'fold_constants' undefined; assuming + extern returning int Generate.xs(645) : warning C4047: '=' : 'B__OP' differs in levels of i +ndirection from 'int' Generate.c(914) : warning C4101: 'RETVAL' : unreferenced local variabl +e Generate.c(1482) : warning C4244: '=' : conversion from 'U32' to 'U16' +, possible loss of data Generate.c(1506) : warning C4244: '=' : conversion from 'U32' to 'U16' +, possible loss of data Generate.xs(1037) : error C2106: '=' : left operand must be l-value Generate.c(2007) : warning C4244: '=' : conversion from 'line_t' to 'U +16', possible loss of data error building dll file from 'lib\B\Generate.c' at C:\Perl\site\lib/Mo +dule/Build/Platform/Windows.pm line 106. NMAKE : fatal error U1077: 'c:\Perl\bin\perl.exe' : return code '0x2' Stop. c:\cl\nmake.exe -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re: B::Generate for Win32?
by PodMaster (Abbot) on Aug 21, 2004 at 07:14 UTC
    http://ppd.develop-help.com/ppd/B-Generate.ppd?

    1st thing I'd do is apply this patch from diotalevi. Then I'd google for error C2106: '=' : left operand must be l-value. The code that generates it is

    #define SVOP_sv(o) (cSVOPo_sv) #define SVOP_gv(o) ((GV*)cSVOPo_sv) MODULE = B::Generate PACKAGE = B::SVOP PREFIX = SVOP_ B::SV SVOP_sv(o, ...) B::SVOP o CODE: GEN_PAD; if (items > 1) cSVOPo_sv = newSVsv(ST(1)); // THIS LINE CAUSES ERROR RETVAL = cSVOPo_sv; OLD_PAD; OUTPUT: RETVAL
    and I believe you knew that. Why that doesn't work is beyond me. cSVOPo_sv is a defined in perl/lib/CORE/op.h If you change it to
    if (items > 1) RETVAL = newSVsv(ST(1));
    it'll compile, but you'll get a link error (unresolved external symbol _Perl_fold_constants). Perl_fold_constants is defined in CORE/embed.h It looks like its not meant to be used outside of PERL_CORE.. I think we need the help of a p5p.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Thanks PodMaster. I tried the .ppd and got the classic

      P:\packages>ppm install B-Generate.ppd Error: no suitable installation target found for package B-Generate.

      which doesn't make sense (to me) given it's contents.

      Your right, I had tracked down the line that caused the error, and tried skipping the middleman* to make the compile work, but when I encountered the unresolved external I knew I'd moved beyond my knowledge.

      *Though I can't see how it would work if the global cSVOPo_sc isn't kept up to date? It must be doing things that way for a reason.

      I thought that there were two possibilities:

      1. It's never been built on Win32 and so the Module::Build process doesn't include everything required to build it (here).
      2. It only builds with some custom (perl.exe) build options and is never going to work against AS builds.

      I've completely screwed my custom perl build environment (trying to hack the build process. D'oh. Hands off. Do not touch! Keep out!), and I didn't want to go through re-instating that if nobody's ever bothered/suceeded, in order to try somethng that is probably beyond my reach anyway.

      Thanks again.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
        I tried the .ppd and got the classic
        P:\packages>ppm install B-Generate.ppd Error: no suitable installation target found for package B-Generate.
        which doesn't make sense (to me) given it's contents.
        Well it looks like that PPD is for 5.6.x only — that's what <ARCHITECTURE NAME="MSWin32-x86-multi-thread"/> tells me. So the complaint is understandable if you're trying to install it for 5.8.x. You'd need "MSWin32-x86-multi-thread-5.8" there, instead.

      Set me straight about that error message, "Error: no suitable installation target found for package...".

      Given that the ppd contains:

      <SOFTPKG NAME="B-Generate" VERSION="0,06,0,0"> <TITLE>B-Generate</TITLE> <ABSTRACT></ABSTRACT> <AUTHOR></AUTHOR> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread" /> <CODEBASE HREF="http://ppd.develop-help.com/ppd/data/B-Generate-0.06.t +ar.gz" /> </IMPLEMENTATION> </SOFTPKG>

      And my perl installation lists:

      P:\test>perl -V Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread [snip]

      PPM is rejecting the install attempt because??

      I googled for the error message, and it turns up a lot in questions, but rarely any answers.

      When it does receive an answer, it is usually some speculation that "Your ppm installation is broken" or "PPM can't find you perl installation and so doesn't know where to install the package". Both of which are clearly wrong as I can successfully install any number of packages using PPM.

      After looking at the ppd's of one or two packages I can install using PPM, I find they tend to look like this:

      <SOFTPKG NAME="FFI" VERSION="1,00,0,0"> <TITLE>FFI</TITLE> <ABSTRACT>Foreign Function Interface for Perl</ABSTRACT> <AUTHOR>Paul Moore &lt;gustav@morpheus.demon.co.uk&gt;</AUTHOR> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread" /> <CODEBASE HREF="FFI-1.00-PPM.5.6.tar.gz" /> </IMPLEMENTATION> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" /> <CODEBASE HREF="FFI-1.00-PPM.5.8.tar.gz" /> </IMPLEMENTATION> </SOFTPKG>

      Which seems to indicate to me that in .ppds, the architecture name: "MSWin32-x86-multi-thread", really means ""MSWin32-x86-multi-thread-5.6"?

      And that despite that Perl (5.8.x) itself lists the architecture as "MSWin32-x86-multi-thread", PPM knows better?

      So what that error message ("Error: no suitable installation target found for package...") should really saying is:

      "Error: no suitable installation source found for package..."

      Or maybe "Error: 'xxxxx.ppd' doesn't contain an installation source for your architecture ('MSWin32-x86-multi-thread-5.8')".


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
        Exactly.

        ActiveState completely screwed the pooch.

        MSWin32-x86-multi-thread means for 5.6.x, MSWin32-x86-multi-thread-5.8 means for 5.8.x.

        ActiveState released perl 5.8 with perl-V:archname reporting the same as that for 5.6.x, and nobody noticed for a while because ppm was requesting stuff from the activestate 5.8 repository. When people started adding other repositories a while later, the bug was reported and the brilliant fix was to patch ppm. Config.pm was left untouched, and if you modify Config.pm, you'll break ppm (and maybe MakeMaker or Module::Build, because one/both of them have the same workaround).

        If you have ppm3, you have nothing to worry about, if you have ppm2, you need my patch (7258).

        I've also read (don't recall exactly where) that "Error: no suitable installation target found for package" can also occur if the ppd is some kind of malformed utf8 or something like that.

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.