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

Cross-Compile Perl Modules for Win x64

by fatmcgav (Novice)
on Dec 30, 2008 at 15:00 UTC ( [id://733262]=perlquestion: print w/replies, xml ) Need Help??

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

Hi there,

I've installed ActiveState Perl 5.10 on a Win 2k3 x86_64 server, and I'm trying to install some modules to support some monitoring scripts that I've written.

The specific modules in question are:
DBD-Oracle
Win32-SystemInfo
Neither of these modules have been built by ActiveState for 5.10 x64.

Is there a way I can cross compile these modules on my desktop - a XP box with a Intel Q6600 - so that they can just be dropped straight onto the server? As I really want to be installing loads of software on a production server.

Any comments welcome...

Cheers
Gavin

Replies are listed 'Best First'.
Re: Cross-Compile Perl Modules for Win x64
by jeffa (Bishop) on Dec 30, 2008 at 15:08 UTC

    Since any comments are welcome -- why are you using Microsoft on a production server? In this day and age I just can't wrap my head around not using open source. I mean ... we use Linux servers and NEVER have these issues. EVER. Plus, it's so cheap it's almost free. YMMV.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Jeffa,

      Many of our production servers are migrating across to Linux, and believe me when i say i would love to migrate these app servers aswell...

      Unfortunately the App in question currently only supports Windows, through a combination of requiring Java 1.4 and a propitiatory, currently Windows only DLL for smart-card readers...
      Yes, i know i know... There is development scheduled to migrate to Linux, but it's a way of yet, so currently have to make do with Windows...

      Cheers for the comment though...
      Anyone else?

      Cheers
      Gavin
Re: Cross-Compile Perl Modules for Win x64
by cdarke (Prior) on Dec 30, 2008 at 15:39 UTC
    You need to link with the same version of Perl DLLs and the same version of the C run-time library, and that means doing that on a 64-bit machine with Microsoft Visual Studio. I expect (though I am not certain) that for the Oracle DBD you will need the Oracle DLLs as well.
Re: Cross-Compile Perl Modules for Win x64
by Bloodnok (Vicar) on Dec 30, 2008 at 15:21 UTC
    If you're determined to go down the M$/AS route, IMO you'll have to (get your employer to) invest in M$ VisualC++, install it on the target platform and hope that nmake etc. will understand all of the make(1) script generated by perl Makefile.PL when you run the standard CPAN perl Makefile.PL, make install sequence.

    A user level that continues to overstate my experience :-))

      Of course, Perl by grace of ExtUtils::MakeMaker tries to do the Right Thing, because ExtUTils::MakeMaker outputs nmake syntax when it sees that the current Perl uses nmake as its make tool.

        That is undoubtedly true Corion ... and many more ++ to the authors & maintainers of said module.

        My point was that my, mostly infuriating, experience(s) attempting to build perl modules using M$ under Windoze suggest that...

        • Adopting Strawberry perl, or similar or ...
        • Making a design decision, at the outset, to use only pure perl modules
        both offer a path of far less resistance, tho' self-evidently, the latter is far more constraining - almost masochistically so;-)

        A user level that continues to overstate my experience :-))
        Ok, i've had a read of the MakeFile.pl for Win32-SystemInfo, and it lists Win32::API as a requirement...

        Am i right in thinking i'm stuck as i cant use Win32::API on a 64Bit box???

        Comments???

        Cheers
        Gavin
      If you don't have VC (cl.exe) on your PATH, but have MingW and dmake installed, then ActivePerl will automatically use them to builds XS code. perl Makefile.PL will automatically generate the correct Makefile, not configuration is required beyond putting MinGW and dmake on the PATH.
Re: Cross-Compile Perl Modules for Win x64
by fatmcgav (Novice) on Dec 31, 2008 at 08:39 UTC
    Ok, lets try and go a different way about this then?

    Does anybody know a way i can get Perl to read the Total/In Use RAM Counters on a 64Bit Windows Server 2k3 with 8Gb+ Ram???

    Cheers
    Gavin
      Does anybody know a way i can get Perl to read the Total/In Use RAM Counters on a 64Bit Windows Server 2k3 with 8Gb+ Ram???

      If you know of a Windows API function that returns the values you want, then you could access that function from perl using XS or Inline::C.
      Obviously, on a 32-bit perl, such an XSub could not return a 'uv' (long) value, as 'uvs' aren't guaranteed to be large enough to store the value being returned. But you could have the XSub return the value to perl as an 'nv' (double) or a 'pv' (string).
      On your 64-bit perl, the XSub could simply return the value as a 'uv' (since it uses 64-bit uvs).

      I would expect that such a Windows API function does exist ... presumably the modules in question are accessing that Windows API function with Win32::API. Do you know which Windows API function(s) you need to access ?

      Cheers,
      Rob
        Rob,

        I was trying to use win32::SystemInfo, so dont know if you can pick the info out of that???

        Source code is here: http://search.cpan.org/src/CJOHNSTON/Win32-SystemInfo-0.10/SystemInfo.pm

        Any ideas?

        Cheers
        Gavin
      Not knowing much and caring less, about Windoze, would parsing output from the perfmon command (if it exists on your host) be any use ??

      Maybe it has a command mode that reports memory only ... or might that be a bit too useful ;-)

      I don't have a Windoze m/c on which to try it ...

      A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

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

    No recent polls found