There are a couple of perl modules I often use on my *nix systems (FreeBSD, Linux, Mac). I always install these from cpan. Earlier this year I needed to use some of these on a 64-bit Windows system, and in about 2 hours I got the then-most-recent Strawberry Perl package installed, and from cpan I installed the modules of my desire the same way I used to do under *nix. Everything worked as expected.
On another 64-bit Windows system I am now attempting to set up a cygwin64 environment instead of installing Strawberry Perl. There are a handful of tools we need on that system, and those are already working fine under cygwin64, so it seems like a good idea to add the new perl functionality to the already existing cygwin64 environment. To test this possibility without messing with the production environment, I am performing trial/error setups on a separate, clean Windows system.
I downloaded the now current cygwin64 installer, and can get all the tools we required in the past installed fine. I can also get perl5 installed. But installing modules via "cpan install" does not work. Unfortunatelly, I am not really aware of the *nix packages that cpan depends on, because all on my unices (and apparently with Strawberry Perl under Windows too) every dependency is installed automatically, and I never had to care about these. My cygwin64 environment obviously misses some packages required by the build process run by cpan. But cpan in cygwin64 does a very bad job of communicating what is missing or what is wrong.
I tried installing multiple combinations of clang, gcc, mingw and other developer tools using the cygwin installer, but still could not get "cpan install desired::module" working. Depending on the package mixture I used, I get different errors (or signs of errors).
As a fairly reliable starting point, could you please give me a list of cygwin packages I should most certainly install, in order to have an environment where "cpan install ..." is supposed to succeed.
Addition#1:
If I install only the most basic cygwin packages (zsh, perl) and those that come anyway, I end up with this ...
keve@cygtest ~
$ perl -v
This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-cygwin-threads-multi
(with 7 registered patches, see perl -V for more detail)
Copyright 1987-2018, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
keve@cygtest ~
$ curl --version
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
Any of make, gmake, cmake, nmake, gcc, clang results in a "command not found" response.
Starting cpan does this ...
$ cpan
Loading internal null logger. Install Log::Log4perl for logging messages
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters. Configuration will be written to
<</home/Valaki/.cpan/CPAN/MyConfig.pm>>
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl5/5.26/App/Cpan.pm line 669, <STDIN> line 1.
<install_help>
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib]
ALERT: 'make' is an essential tool for building perl Modules.
Please make sure you have 'make' (or some equivalent) working.
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
and that "Press SPACE and ENTER" line keeps filling my screen until I press Ctrl+C.
So, I start the Cygwin installer again, and install the devel/make package. That way I have this ...
$ make -v
GNU Make 4.2.1
Built for x86_64-unknown-cygwin
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ cpan
Loading internal null logger. Install Log::Log4perl for logging messages
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters. Configuration will be written to
<</home/Valaki/.cpan/CPAN/MyConfig.pm>>
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl5/5.26/App/Cpan.pm line 669, <STDIN> line 1.
<install_help>
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib]
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
This time there is no warning about "make" missing, but the same "Press SPACE and ENTER" line fills the screen. There is still that "uninitialised $what", and the warning about not having proper permissions to folders. Which I have seen in questions by others, usually fixed by reinstalling the perl package with the most recent one (I have the most recent one).
So, what package do I miss? Or did I make a wrong choice above by accepting the default? Please note: I have installed additional devel packages with my earlier attempts. But to keep things simple for now, I only have "perl" and "make".
Addition#2
Following the answers by Håkon and mob, I started the cygwin installer again, and installed the recommended packages. So now I have devel/binutils, devel/clang, devel/cmake, devel/gcc-core, devel/gcc-g++, gccmakedep, and make installed. Also available is curl, which was already present so I did not need to install (perhaps came as a dependency).
Unfortunately, I still get this when starting "cpan":
$ cpan
Loading internal null logger. Install Log::Log4perl for logging messages
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters. Configuration will be written to
<</home/Valaki/.cpan/CPAN/MyConfig.pm>>
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl5/5.26/App/Cpan.pm line 669, <STDIN> line 1.
<install_help>
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib]
Press SPACE and ENTER to disable curl
Press SPACE and ENTER to disable curl
Regarding the $what warning: Lines 660 to 670 of Cpan.pm go like this ...
BEGIN {
my $scalar = '';
sub _hook_into_CPANpm_report
{
no warnings 'redefine';
*CPAN::Shell::myprint = sub {
my($self,$what) = @_;
$scalar .= $what;
I can get rid of the warning by modifying line 669 to this ...
$scalar .= ($what // '');
... but this does not solve the problem of why $what is undefined anyway. However, I still end up seeing that "Press SPACE and ENTER to disable curl" filling up the screen. And the same happens if I type "manual" and hit Enter instead of accepting the default local::lib option.