Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

architecture width ?

by shapavi1 (Initiate)
on May 15, 2013 at 18:14 UTC ( #1033726=perlquestion: print w/replies, xml ) Need Help??
shapavi1 has asked for the wisdom of the Perl Monks concerning the following question:

I want to know if the Perl distribution I use has to match the architecture width of my hardware. If I have a 64 bit cpu, do I need a 64 bit release of Perl? Are there other factors in play?


Replies are listed 'Best First'.
Re: architecture width ?
by BrowserUk (Pope) on May 15, 2013 at 22:07 UTC
    If I have a 64 bit cpu, do I need a 64 bit release of Perl?

    No. Leastwise not on Windows or (those varieties of*) *nix I am aware of. The 64-bit versions of will also allow you to build and run 32-bit binaries.

    (* there are so many vareties, there might be some that won't; who knows :)

    Are there other factors in play?

    Other factors that enable or prevent what?

    A 32-bit binary will be limited to using 1 or 2 or 3GB of ram per process depending upon your OS and build parameters; regardless of how much is physical available. But the 32-bit Perl will use somewhat less memory for a given size of array or hash, because it only needs 4 bytes per pointer rather than 8.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    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.
Re: architecture width ?
by Laurent_R (Abbot) on May 15, 2013 at 22:31 UTC

    I am not specialist at all on that type of issue, but I would say that (1) A 32-bit version should work without any problem, and (2) if you want to take advantage of your 64-bit hardware/OS, that it is better to get a 64-bit release.

    Two cases in point:

    - I had a Perl program that failed when the hash grew too big on XP just shortly before having loaded all the data, it now works very fine on Windows 7 and 64 bits.

    - On a totally different subject than Perl, I spent 3 hours a few weeks ago to prepare a very large picture for printing because of lack of memory (several programs failed before I was finally able to do it), I tried again with my new instal (Win 7 + 10 GB memory), I made the same thing in less than one minute.

Re: architecture width ?
by code-ninja (Scribe) on May 16, 2013 at 04:00 UTC
    Speaking of architectures in general, you can run a 32-bit version of a software on a 64-bit machine but not vice-versa. Putting it extremely lucidly, the address space of a 32-bit machine becomes a subset of the 64-bit machine's address space.
Re: architecture width ?
by space_monk (Chaplain) on May 16, 2013 at 09:11 UTC

    In general the answer is no. However it is possible that some operations may only have 32 or 64 bit libraries and your code will need to work with whatever is available.

    I have a vague recollection of encountering this problem with AIX (Unix) about 5 years ago but can't remember the exact circumstances

    If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)
Re: architecture width ?
by Anonymous Monk on May 15, 2013 at 20:32 UTC
    You also need to know what system libraries are on your machine. i.e. 64bit versions of MS Windows come with 32bit libraries in addition to the 64 bit versions.

    Of course if you're running any OS other than Windows, it's often easier to roll up your own perl from source, perhaps using perlbrew....

Re: architecture width ?
by sundialsvc4 (Abbot) on May 16, 2013 at 13:16 UTC

    You should choose the one Perl version that conforms to your operating-system (not necessarily “chip”) type.   This version will know how to correctly access and use the various system libraries that might well already be installed on your machine, and to do so without resorting to what is (quite aptly ...) called “thunking.”

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1033726]
Approved by Perlbotics
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2017-03-24 20:07 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (307 votes). Check out past polls.