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

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

hi, I'm relatively new to Perl, I have written a few Perl scripts but this is related to a manually compiled Perl.

I have just compiled Perl 5.16.0 from source on Windows 7 32 bit using VC 9.0/nmake. The perl.exe is created and installed; it seems to run OK, make test did have some errors but most passed ; no other comprehensive tests but a basic perl script returns the printed message. Now I want to install CPAN modules, but unable to, it's the same for any module I try - YAML , JSON , common::sense .

Warning: No success on commandC:\path\to\perl\bin\perl.exe Makefile.PL

I also have Strawberry perl installed on same machine, but have removed it from %PATH% in order to work with my version. However, I did test the Strawberry perl.exe with Makefile.PL and it produced the makefile. So it does look like my compiled perl.exe or its related binaries are missing something.

Can someone provide more information/hints as to why Strawberry's perl.exe works but my perl.exe does not ?

Error message: Checking if your kit is complete... Looks good Writing Makefile for YAML JSON 2.5 is required for $ENV{PERL_JSON_BACKEND} = 'JSON::XS' at C:/path/to/perl/lib/CPAN/Meta/Converter.pm line 23. at C:/path/to/perl/lib/ExtUtils/MM_Any.pm line 1335. END failed--call queue aborted. Warning: No success on command[C:\path\to\perl\bin\perl.exe Makefile.P +L] 'YAML' not installed, will not store persistent state MSTROUT/YAML-0.84.tar.gz C:\path\to\perl\bin\perl.exe Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Could not read metadata file. Falling back to other methods to determi +ne prerequisites Failed during this command: MSTROUT/YAML-0.84.tar.gz : writemakefile NO 'C:\p +ath\to\p erl\bin\perl.exe Makefile.PL' returned status 512

TIA

Replies are listed 'Best First'.
Re: perl.exe Makefile.PL fails to create makefile
by Anonymous Monk on Mar 26, 2013 at 07:45 UTC

    Looks like you don't have JSON module installed, so try  cpan JSON or  cpanp -i JSON

    OTOH, in general, to debug problems like this you would execute

    cpan>look YAML $ nmake realclean $ perl Makefile.PL $ nmake test TEST_VERBOSE=1

    Then copy / paste everything from perl Makefile.PL up to nmake test, this is the start of figuring it out

    Reporting the output of  perl -V and of perl -MData::Dumper -e " print Dumper(\%ENV) " couldn't hurt either

Re: perl.exe Makefile.PL fails to create makefile
by agentsmith (Initiate) on Mar 26, 2013 at 09:26 UTC

    Thanks for your reply. I really cannot install any module, either using cpan module or cpanp or directly or perl -MCPAN or shell. As far as I can tell, there is no Linux-like configure equivalent for Windows, I simply used nmake /f Makefile , as per instructions found in README file

    Output of cpan look YAML

    U:\.cpan\build\YAML-0.84-q_8Aj2>C:\path\to\perl\bin\perl.exe Makefile. +PL Checking if your kit is complete... Looks good Writing Makefile for YAML JSON 2.5 is required for $ENV{PERL_JSON_BACKEND} = 'JSON::XS' at C:/path/to/perl/lib/CPAN/Meta/Converter.pm line 23. at C:/path/to/perl/lib/ExtUtils/MM_Any.pm line 1335. END failed--call queue aborted.
    But it won't let me install JSON or JSON::XS when I try that. I have JSON::PP 2.53 in the perl/lib directory, which it does show in @INC.

    Output of perl -V

    Summary of my perl5 (revision 5 version 16 subversion 0) configuration +: Platform: osname=MSWin32, osvers=6.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D +_CONSOLE - DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DP +ERL_TEXTMO DE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='15.00.30729.01', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"C: \path\to\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32 +' name=' Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitec +ture='*' p ublicKeyToken='6595b64144ccf1df' language='*'"' libpth=\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib +comdlg32.l ib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid. +lib ws2_32 .lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.l +ib msvcrt. lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.l +ib comdlg 32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib u +uid.lib ws 2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl +32.lib msv crt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl516.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf - libpath:"C:\path\to\perl\lib\CORE" -machine:x86 "/manifestdependency: +type='Wi n32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' proces +sorArchite cture='*' publicKeyToken='6595b64144ccf1df' language='*'"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PL_OP_SLAB +_ALLOC USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Mar 20 2013 13:27:17 %ENV: PERL_JSON_BACKEND="JSON::XS" PERL_YAML_BACKEND="YAML" @INC: C:/path/to/perl/site/lib C:/path/to/perl/lib .

    Output of perl -MData::Dumper -e " print Dumper(\%ENV) "

    perl -MData::Dumper -e " print Dumper(\%ENV) " $VAR1 = { 'USERPROFILE' => 'C:\\Users\\rahul', 'USERDNSDOMAIN' => 'MY_COMPANY.COM', 'HOMEDRIVE' => 'U:', 'VS90COMNTOOLS' => 'c:\\Program Files\\Microsoft Visual Stud +io 9.0\\Co mmon7\\Tools\\', 'CLIENTNAME' => 'My_Computer_name', 'COMMONPROGRAMFILES' => 'C:\\Program Files\\Common Files', 'WINDOWS_TRACING_FLAGS' => '3', 'APPDATA' => 'C:\\Users\\rahul\\AppData\\Roaming', 'PROGRAMFILES' => 'C:\\Program Files', 'OS' => 'Windows_NT', 'LOCALAPPDATA' => 'C:\\Users\\rahul\\AppData\\Local', 'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.W +SH;.MSC', 'PROMPT' => '$P$G', 'NUMBER_OF_PROCESSORS' => '1', 'FP_NO_HOST_CHECK' => 'NO', 'HOMEPATH' => '\\', 'PATH' => 'C:\\Windows\\system32;C:\\Windows;C:\\Windows\\Sy +stem32\\Wb em;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;c:\\Program Files\ +\Microsoft SQL Server\\90\\Tools\\binn\\;C:\\Program Files\\Microsoft Visual Stu +dio 9.0\\V C\\bin', 'PERL_YAML_BACKEND' => 'YAML', 'USERDOMAIN' => 'MY_DOMAIN', 'PROGRAMDATA' => 'C:\\ProgramData', 'TERM' => 'dumb', 'PROCESSOR_ARCHITECTURE' => 'x86', 'PSMODULEPATH' => 'C:\\Windows\\system32\\WindowsPowerShell\ +\v1.0\\Mod ules\\', 'PERL_JSON_BACKEND' => 'JSON::XS', 'TEMP' => 'C:\\Users\\rahul\\AppData\\Local\\Temp', 'WINDOWS_TRACING_LOGFILE' => 'C:\\BVTBin\\Tests\\installpack +age\\csilo gfile.log', 'PROCESSOR_REVISION' => '1a05', 'SYSTEMDRIVE' => 'C:', 'SYSTEMROOT' => 'C:\\Windows', 'COMSPEC' => 'C:\\Windows\\system32\\cmd.exe', 'HOMESHARE' => '\\\\servername\\users\\rahul', 'LOGONSERVER' => '\\\\SERVER', 'SESSIONNAME' => 'RDP-Tcp#0', 'WINDIR' => 'C:\\Windows', 'FTP_PASSIVE' => '1', 'PROCESSOR_LEVEL' => '6', 'PUBLIC' => 'C:\\Users\\Public', 'USERNAME' => 'rahul', 'PROCESSOR_IDENTIFIER' => 'x86 Family 6 Model 26 Stepping 5, + GenuineIn tel', 'VS80COMNTOOLS' => 'C:\\Program Files\\Microsoft Visual Stud +io 8\\Comm on7\\Tools\\', 'ALLUSERSPROFILE' => 'C:\\ProgramData', 'COMPUTERNAME' => 'VMWIN-7', 'TMP' => 'C:\\Users\\rahul\\AppData\\Local\\Temp' };

      Why do you have $ENV{PERL_JSON_BACKEND} set if your Perl does not have JSON::XS installed?

        I'm not sure, I haven't set/changed anything , I referred to README.Win32 file in the source. Perhaps it's because of the Strawberry Perl installed. Let me see if I can remove/clean it.

      But it won't let me install JSON or JSON::XS when I try that.

      Well OK, YAML Makefile.PL aborting because JSON isn't installed won't exactly tell us whats wrong with getting JSON installed :), so copy/paste the failed JSON/JSON::XS install message, please

      OTOH, what corion asked ;)

        Corion's hint seems to be the one! Thanks, Corion. Now install progresses to running the tests, but fails at :

        'C:\Program' is not recognized as an internal or external command,oper +able program or batch file.
        I suppose the string needs to be put in quotes someplace - which place ? Is it in MyConfig.pm file in .cpan ?