http://www.perlmonks.org?node_id=863145

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

When I build my own Perl on GNU/Linux, I'd like it to make use of as much standard installed software (extensions) as possible. For example, libreadline, ncurses, sqlite, gdbm, Tk, etc. That is, I don't want the Configure script to throw up its hands and tell me, "Sorry, couldn't find such-and-such on this system so I won't be compiling this Perl to use it. Tsk tsk tsk.".

So which OS packages should you make sure you have installed before configuring and building Perl?

  • Comment on Which prerequisite packages should you have installed before building Perl on GNU/Linux?

Replies are listed 'Best First'.
Re: Which prerequisite packages should you have installed before building Perl on GNU/Linux?
by ambrus (Abbot) on Oct 03, 2010 at 06:46 UTC

    Perl doesn't really need much of anything to compile. A Debian system with all the required and important packages (the ones the installer will install be default) plus the build-essential metapackage (which installs the libc headers, make, and some other things you won't need) is enough. That the INSTALL file in the perl source does not say much about the requirements (though it does now say you need a C89 compiler) is because there aren't many. If all you want to install is the perl core, you don't need libncurses or libreadline, for nothing in the core wants to use these. Certainly nothing like sqlite, gdbm, Tk is needed. (Update: a core module does use libz though if configure detects that you have it, so install the zlib1g-dev package.)

    Later you might need some such packages if you want to install modules, for example Bundle::Cpan lets you use a readline prompt in the cpan shell, so you need libreadline for that. (But then, who wants that when you can just run the cpan shell in rlwrap? A program needs to embed readline only if it actually does something with it, such as defines custom tab completion.) In general, modules from CPAN should tell you about any extra requirements in their INSTALL or README files. For example, if you look at the README in the XML-LibXML distribution, it tells you that it needs the libxml2 library. Installing some dependencies can become complicated in a few cases because you have to do so recursively, but luckily you get useful error messages from which you can figure out what's missing.

      Thanks, ambrus.

      If all you want to install is the perl core, you don't need libncurses or libreadline, for nothing in the core wants to use these. Certainly nothing like sqlite, gdbm, Tk is needed.

      Well, I want Perl to utilize as many extensions as it can.

      When I build Python, it tries to tell me what parts it failed to find. I've had the experience with Python where I wanted to use some piece of it's std lib (say, sqlite) and then came to find out that I didn't have the sqlite-dev package installed when I built it so I had to rebuild. I was looking for a way to avoid this experience with Perl.

Re: Which prerequisite packages should you have installed before building Perl on GNU/Linux?
by JavaFan (Canon) on Oct 03, 2010 at 06:13 UTC
    That is, I don't want the Configure script to throw up its hands and tell me, "Sorry, couldn't find such-and-such on this system so I won't be compiling this Perl to use it. Tsk tsk tsk.".
    Really? What's the harm in that? Running configure takes about a minute. Run it, and see whether it throws up its hand or not.

      Sorry, that was sloppy of me. I meant that I didn't want Configure to silently skip over including pieces that it didn't see present on my system.

      Will Configure indeed tell me about every item that would be beneficial for me to have installed for it to fully-configure the build? I've been through the Configure process many times, but have not noticed this (though some parts do fly by pretty quickly). I have seen it tell me about finding/not-finding various header files and C functions, but I'm generally not able to correlate that information with particular software packages.

      I notice that there is one stage in the Configure process where it asks:

      What extensions do you wish to load dynamically?
      [attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/DProf Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util Math/BigInt/FastCalc MIME/Base64 mro NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex threads threads/shared Time/HiRes Time/Piece Unicode/Normalize XS/APItest XS/APItest/KeywordRPN XS/Typemap]

      but it doesn't indicate which of those can actually be built, or if there are some missing from the list because they cannot be built on this system at this time.

Re: Which prerequisite packages should you have installed before building Perl on GNU/Linux?
by Anonymous Monk on Oct 03, 2010 at 05:36 UTC

      I'm interested to know what configure checks for, but I didn't see the information I was looking for in either the README or the INSTALL file. Not quite sure what that metaconfig.git is for. Will look into it.

        Maybe look in Configure or metaconfig (used to generate Configure)?