Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"

by jffry (Hermit)
on Dec 01, 2011 at 22:39 UTC ( [id://941186]=perlquestion: print w/replies, xml ) Need Help??

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

EDIT: While I use dmake to illustrate the problem in the examples below, I originally got these results from simply running cpan <module name>. That is, I am not doing anything unusual (that I know of) when trying to download/build/install these modules.

The initial error looks like this:

C:\strawberry\cpan\build\Math-Pari-2.01080605-0ZIRgM > dmake dmake: Error: -- `C:\strawberry\perl\libConfig.pm' not found, and can +'t be made

It doesn't matter too much which module it is. This happen in a few other modules. For example:

C:\strawberry\cpan\build\IO-React-1.03-52FBIM > dmake dmake: Error: -- `C:\strawberry\perl\libConfig.pm' not found, and can +'t be made

I did find a discussion on this topic, which mirrors my own struggle (except I don't have nmake). However, our problems diverge right at the "I've found the problem..." post. That is, his fix in ActivePerl's Config.pm doesn't look anything like the Config.pm in Strawberry.

What I did to attempt to solve this...

It seems fairly clear that the backslash is missing. There is no file C:\strawberry\perl\libConfig.pm but there certainly is a file C:\strawberry\perl\lib\Config.pm

Taking a look at IO::React's Makefile (with line numbers) where it references Config.pm, I see:

162 # Where is the Config information that we are using/depend on 163 CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)co +nfig.

Where DFSEP gets defined earlier in the file, I see:

52 DIRFILESEP = \ 53 DFSEP = $(DIRFILESEP)

I tried a few modifications, but making it equal to double-backslash seemed to be the fix.

52 DIRFILESEP = \\ 53 DFSEP = $(DIRFILESEP)

But that creates a new problem all together.

C:\strawberry\cpan\build\IO-React-1.03-52FBIM > dmake CreateProcess failed (2). dmake: Error executing 'rem': No such file or directory dmake: Error code -1, while making 'blibdirs'

So let's look at the blibdirs target.

310 # --- MakeMaker blibdirs section: 311 blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).e +xists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exis +ts $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MA +N1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists 312 $(NOECHO) $(NOOP)

Looking at value of NOECHO and NOOP variables:

205 NOOP = rem 206 NOECHO = @

So I'm guessing that these 2 variables together are supposed to be a DOS comment statement with a do-not-echo-to-terminal flag. So I guess that means they are being evaluated in the wrong context somehow. But I can still type that command at the prompt and get no errors:

C:\strawberry\cpan\build\IO-React-1.03-52FBIM > @rem C:\strawberry\cpan\build\IO-React-1.03-52FBIM >

So at this point, I don't know where to go next. Additionally, I am highly suspicious of the entire Makefile output. It feels like something more fundamental is broken, and that no amount of Makefile tweaking will fix this.

So, any ideas?

UPDATE: 2012-02-16, I still can't get a single CPAN module to build even when using a clean installation of Strawberry Perl. I'll document any new steps I take to debug this problem.

UPDATE: 2012-02-17, Solved. Thanks everyone and especially Anonymous.

UPDATE: 2012-02-17, And root cause found. Some ThinkPad software created a Make env var for me.

Replies are listed 'Best First'.
Re: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
by syphilis (Archbishop) on Dec 02, 2011 at 05:56 UTC
    Firstly, check that perl -V:make reports 'dmake'.

    Have you installed a different version of ExtUtils::MakeMaker at some stage ?
    In your lib/ExtUtils/MM_Win32.pm check that "sub init_DIRFILESEP" looks like this:
    sub init_DIRFILESEP { my($self) = shift; # The ^ makes sure its not interpreted as an escape in nmake $self->{DIRFILESEP} = $self->is_make_type('nmake') ? '^\\' : $self->is_make_type('dmake') ? '\\\\' : '\\'; }
    Cheers,
    Rob

      Judging by the fact that his DIRFILESEP was originally set to a single backslash, ExtUtils::MM_Win32's is_make_type() method doesn't seem to identify his make variant as either nmake or dmake, so that's where I would start digging...

      (AFAICT, the implementation of the sub init_DIRFILESEP hasn't changed recently — at least all versions of EU::MM_W32 which shipped with various Perls going back to 5.8.8 do look the same in this respect.)

        Here is that sub.

        I can probably read perlre to figure out what ?: does, but a search of perlop for !! gives me nothing useful. Is that really two Boolean NOTs side-by-side? Can't be. So what is that operator? In any case, I'm guessing the real answer lies in the make method, and I'll pretend this sub makes sense even though I don't understand it now.

        sub is_make_type { my($self, $type) = @_; return !! ($self->make =~ /\b$type(?:\.exe)?$/); }

        I found the make method defined over in ExtUtils::MM_Any, which is required by MM_Win32.pm on line 27.

        sub make { my $self = shift; my $make = lc $self->{MAKE}; # Truncate anything like foomake6 to just foomake. $make =~ s/^(\w+make).*/$1/; # Turn gnumake into gmake. $make =~ s/^gnu/g/; return $make; }

        So self->{MAKE} is some kind of OOesque hash key lookup, right? Sorry, but I don't know Perl OO very well.

        But where does that key get set? Since that is an access to private data in this class (I think), doesn't that particular MAKE hash key value have to get set within this package file? But I can't find it in MM_Any.pm. Well, I find plenty of "MAKE" strings being used to demarcate here-files, but that isn't helping my search.

        Any ideas?

      My other posts in this thread show that I am now starting all over again with a virgin installation, but have the same problem.

      I have not installed a new version of ExtUtils::MakeMaker. It looks like the version I have is 6.56.

      C:\strawberry\perl\lib\ExtUtils > find "our $VERSION" MakeMaker.pm ---------- MAKEMAKER.PM our $VERSION = '6.56';

      That subroutine in MM_Win32.pm is identical to the one you've shown (but I added line numbers).

      127 sub init_DIRFILESEP { 128 my($self) = shift; 129 130 # The ^ makes sure its not interpreted as an escape in nmake 131 $self->{DIRFILESEP} = $self->is_make_type('nmake') ? '^\\' : 132 $self->is_make_type('dmake') ? '\\\\' 133 : '\\'; 134 }

      And my Perl make configvar seems to point at dmake.

      C:\strawberry\cpan\build > perl -V:make make='dmake';
Re: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
by Anonymous Monk on Dec 02, 2011 at 02:56 UTC

    dmake: Error: -- `C:\strawberry\perl\libConfig.pm' not found, and can't be made

    This type of error means the Makefile was written for nmake, not dmake

    You can get it like this

    $ h2xs -b 5.5.0 -X Titikaka Writing Titikaka/lib/Titikaka.pm Writing Titikaka/Makefile.PL Writing Titikaka/README Writing Titikaka/t/Titikaka.t Writing Titikaka/Changes Writing Titikaka/MANIFEST $ cd Titikaka $ perl -V:make make='dmake'; $ perl Makefile.PL make=nmake Checking if your kit is complete... Looks good Writing Makefile for Titikaka Writing MYMETA.yml and MYMETA.json $ dmake dmake: Error: -- `c:\perl\5.14.1\lib\MSWin32-x86-multi-threadConfig.p +m' not found, and can't be made

    Don't do that :)

      Hmmm, I'm not doing that. I am getting these errors from running cpan <module name>. I only used dmake in my original post to succicntly show the problem. I'll do a screen scrape tomorrow of the cpan command output.

        Hmmm, I'm not doing that. I am getting these errors from running cpan <module name>. I only used dmake in my original post to succicntly show the problem. I'll do a screen scrape tomorrow of the cpan command output.

        Sorry, but this is the only way to get this error, esp with strawberry perl

        cpan <module name does about a dozen things, including run perl Makefile.PL ... with arguments from your cpan configuration

        I've seen this crop up a dozen times, and always because Makefile built for nmake was being called with dmake

        You don't actually need to have an nmake.exe anywhere on your system

        Looking for DFSEP ... in the source code is just digging too deep, too soon

        Everything in your posts confirms that perl Makefile.PL make=nmake is the reason, whether its because of cpan configuration or Config_heavy.pl (like say, a different perl in your path gets called for some reason)

Re: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
by admiral_grinder (Pilgrim) on Dec 01, 2011 at 23:30 UTC
    I use strawberry 5.12.3 at work on Win XP and Win 7 64. Is there anything odd about your setup? What command shell are you using? Do you have cygwin in your path or anything else? Strawberry does have a relocate script, I don't know if it will help but you could try it. For me, I have gnuwin32 tools in my path on my Win XP, but on my Win 7 box It has all kinds of corporate things on it including Cygwin and Activestate perl in the path.

      My Windows version is "Windows 7 Enterprise" with "Service Pack 1" and a System type of "32-bit Operating System".

      For my shell, I run C:\Windows\System32\cmd.exe. I just checked the shortcut now. I ran set and manually combed thru the vars for anything related to my shell type. This is all I saw:

      SESSIONNAME=Console TERM=dumb

      I'm pretty sure I've steered clear of cygwin. Here is every env var with the word "path" in it. Hmmm, it looks like I have a few repeating values in there. Should be harmless, but I'll clean up my %PATH% later.

      C:\strawberry\cpan\build\IO-React-1.03-52FBIM > set | find /I "path" CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip HOMEPATH=\Users\bob HummPATH11=C:\Program Files\Hummingbird\Connectivity\11.00\Accessories +\; Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Window +s\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\Empirum ;C:\Program Files\Hummingbird\Connectivity\11.00\Accessories\;;C:\stra +wberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bi n;C:\Program Files\SlikSvn\bin\;C:\Program Files\QuickTime\QTSystem\;C +:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Wind ows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\Empirum;C:\Pr +ogram Files\Hummingbird\Connectivity\11.00\Accessories\;;C:\st rawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\P +rogram Files\QuickTime\QTSystem\;C:\Program Files\SlikSvn\bin\ ;C:\Program Files\PuTTY;C:\Users\bob;C:\Program Files\GnuWin32\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

      From what I recall, I didn't do anything special during the installation. I'm pretty sure I downloaded the typical .msi file. Even tho I can't recall, I'm fairly certain if I had installation choices, I would simply choose the defaults.

Re: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
by jffry (Hermit) on Dec 02, 2011 at 16:48 UTC

    My current action plan is to:

    1. Uninstall Strawberry Perl.
    2. Make sure C:\strawberry directory is gone.
    3. Clean up my PATH -- remove duplicates, strawberry references, stuff I don't recognize.
    4. Reinstall Strawberry Perl, making note of my installation options, if any.
    5. Try to install Net::SSH::Perl by running cpan Net::SSH::Perl.

    If it still fails after that, I'll start looking at my make settings and cpan configuration as suggested by Anonymous, syphilis, and Eliya.

    Thanks, All!

      I performed my steps above and still have similar results.

      Writing Makefile for Math::PARI::libPARI Writing Makefile for Math::Pari dmake.EXE: Error: -- `C:\strawberry\perl\libConfig.pm' not found, and + can't be made ILYAZ/modules/Math-Pari-2.01080605.tar.gz C:\strawberry\c\bin\dmake.EXE -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Running make for T/TU/TURNSTEP/Net-SSH-Perl-1.34.tar.gz Has already been unwrapped into directory C:\strawberry\cpan\build\N +et-SSH-Perl-1.34-bzhIa4 CPAN.pm: Going to build T/TU/TURNSTEP/Net-SSH-Perl-1.34.tar.gz Warning: Prerequisite 'Math::Pari => 2.001804' for 'TURNSTEP/Net-SSH-P +erl-1.34.tar.gz' failed when processing 'ILYAZ/modules/Math-Pa ri-2.01080605.tar.gz' with 'make => NO'. Continuing, but chances to su +cceed are limited. dmake.EXE: Error: -- `C:\strawberry\perl\libConfig.pm' not found, and + can't be made TURNSTEP/Net-SSH-Perl-1.34.tar.gz C:\strawberry\c\bin\dmake.EXE -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible

      And here is my cleaned up path:

      C:\strawberry > echo %Path% C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Sys +tem32\WindowsPowerShell\v1.0\;C:\Windows\System32\Empirum;C:\P rogram Files\Hummingbird\Connectivity\11.00\Accessories\;;C:\Program F +iles\SlikSvn\bin\;C:\Program Files\QuickTime\QTSystem\;C:\stra wberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\str +awberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\b in;C:\Program Files\PuTTY;C:\Users\jmm6ry\bin;C:\Program Files\GnuWin3 +2\bin
      I manually added the "strawberry" parts to my %PATH%. The installation did not do it for me. I installed from the MSI file, not a ZIP file.

      Now off to further investigation....

        Is 'nmake' anywhere to be found in your path ?
        If so, try removing it and see if that makes any difference.

        (Just enter nmake /? at the command prompt to check whether nmake is in the path.)

        Cheers,
        Rob

Log In?
Username:
Password:

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

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

    No recent polls found