Perl: nmake not found - perl

I've seen two threads similar to my question, neither with an answer that helps me.
I have been given a new laptop running Windows 7 Enterprise SP1 64-bit, on which I've installed Active Perl 5 'version 20, subversion 2 (v5.20.2) built for MSWin32-x64-multi-thread' and Microsoft Visual Studio Express 2015.
Both 'C:\perl64' and 'c:\program files (32)\Microsoft Visual Studio 14.0\VC\bin' are in my system path [without the single quotes, of course] and if I run nmake on the command line without any arguments and without a makefile in the pwd I get back the following message, definitely indicating that nmake can be found:
Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
So far, so good. Now, when I run Makefile.PL to start installing a new package, I get the following message:
It looks like you don't have either nmake.exe or dmake.exe on your
PATH, so you will not be able to execute the commands from a Makefile.
You can install dmake.exe with the Perl Package Manager by running:
ppm install dmake
Checking if your kit is complete... Looks good Generating a
dmake-style Makefile
What I don't understand and would like to resolve is why Perl does not see the nmake in my PATH environment? I've installed this same package previously on a number of different machines in the past - the only real variation in any of these has been in the version number of Perl and MSVS release and the bit-version of Perl [in almost all cases I've been working 32-bit instead of 64], but I don't see why either of these would make a difference to Perl not recognizing the MSVS bin directory in my %PATH%
Installing dmake or minGW is not a solution for me: I've already done both and get a series of errors I've never experienced before with this package, so I'd really like to find a solution that would allow me to use nmake - if I still get errors afterwards, I'll work those out when I get to them.
Thanks

Edit C:\Perl64\lib\ExtUtils\MakeMaker.pm and add "require Module::Build;" before "require Exporter;" line. The top should now look something like this:
# $Id$
package ExtUtils::MakeMaker;
use strict;
BEGIN {require 5.006;}
require Module::Build; # THIS IS ADDED
require Exporter;
use ExtUtils::MakeMaker::Config;
use ExtUtils::MakeMaker::version; # ensure we always have our fake version.pm
use Carp;
use File::Path;
That fixed it for me.

Related

INSTALL_BASE=~/perl5 -- NOT OK - While installing Perl Module

I am trying to install one of the Perl module in my local system (Windows 7). But its failing to install the module
Here is what its displaying
C:\Windows\system32>perl -MCPAN -e "install Net::SFTP"
Reading 'C:\Users\AppData\Local\.cpan\Metadata'
Database was generated on Sun, 26 May 2019 05:17:03 GMT
Running install for module 'Net::SFTP'
Checksum for C:\Users\AppData\Local\.cpan\sources\authors\id\L\LK\LKINLE
Y\Net-SFTP-0.12.tar.gz ok
Configuring L/LK/LKINLEY/Net-SFTP-0.12.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Math::Int64 0.54 not found.
Warning: prerequisite Net::SSH::Perl 2.12 not found.
The getpwuid function is unimplemented at C:/Perl64/lib/ExtUtils/MakeMaker.pm li
ne 1064.
Warning: No success on command[C:\Perl64\bin\perl.exe Makefile.PL INSTALL_BASE=~
/perl5]
LKINLEY/Net-SFTP-0.12.tar.gz
C:\Perl64\bin\perl.exe Makefile.PL INSTALL_BASE=~/perl5 -- NOT OK
It was working fine before and I have installed couple of modules, don't know what happens suddenly.
Please help me to resolve this. Do I need to make any modifications in config?
You're telling Perl to into ~/perl5. That's not a Windows path, and ExtUtils::MakeMaker is using a unix-specific function (getpwuid) to expand it. Your problem should go away if you use a Windows path.
That said, if you have access to write to C:\Perl64\..., I suggest that you install modules to the default directory by removing INSTALL_BASE=~/perl5.
If you don't have access to write to C:\Perl64\..., I suggest that you install Perl itself in a directly to which you do have access to write, and then I'd install modules to the default directory by removing INSTALL_BASE=~/perl5.
Since you didn't actually specify INSTALL_BASE=~/perl5 on the command line, you are specifying it through the environment (PERL_MM_OPT and PERL_MB_OPT), or in cpan's configuration (o conf from within cpan).

Error while Installing Math::Pari

I'm trying to install Math::Pari module but getting error.
I'm installing on Windows Server 2012R2, I've Strawberry perl v5.18.4.1 32-bit currently installed on it.
Actually Math::Pari is dependency for Net::SSH::W32Perl and I want to install that module.
Following is the error log. Please Give me step by step installation procedure.
cpanm (App::cpanminus) 1.7039 on perl 5.018004 built for MSWin32-x64-multi-thread
Work directory is C:\Users\script/.cpanm/work/1438929213.2276
You have make C:\strawberry\c\bin\dmake.exe
You have LWP 6.08
Falling back to Archive::Tar 2.02
Searching Math::Pari () on cpanmetadb ...
--> Working on Math::Pari
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.010808.zip
-> OK
Unpacking Math-Pari-2.010808.zip
Entering Math-Pari-2.010808/
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (6.98)
Configuring Math-Pari-2.010808
Running Makefile.PL
Did not find GP/PARI build directory around.
Apparently, you are running a 64-bit Perl built with MicroSoft's compilers.
GP/PARI (at least the versions I know how to work with, 2.1.* and 2.3.*)
cannot be built in this environment. I won't auto-download GP/PARI.
If you believe that this message is printed erroneously, please report
(see files README and INSTALL), and put force_download on the command line:
perl Makefile.PL force_download
One can rerun Makefile.PL after fetching GP/PARI archive (e.g., pari-2.1.7.tgz,
or pari-2.3.4.tar.gz) manually to the current directory, or a (grand)parent
directory of the current directory.
[Keep in mind that the numbers "inside version" of Math::Pari module
correspond to the last versions of GP/PARI it was tested with (additionally,
2.0108* works best with the last 2.1.* version, 2.1.7).
As an alternative to having archive in CWD or its (grand)parent, specify
pari_tgz=PATH_TO_TAR_GZ
option to Makefile.PL.
There is no need to extract the archive, or build GP/PARI; but if you
have it extracted [and patched, if needed], you may specify
paridir=PATH_TO_DIST_DIR
option to Makefile.PL instead of `pari_tgz'. However, in this case
the files WON'T be auto-patched.
As a last-resort solution, there is also a possibility to use an already
compiled PARI library. See the documentation in README and INSTALL files.]
Could not find GP/PARI build directory, please run Makefile.PL
with paridir=/directory option.
-> N/A
-> FAIL Configure failed for Math-Pari-2.010808. See C:\Users\script\.cpanm\work\1438929213.2276\build.log for details.
I thought I'd add a note for anyone coming here as a result of a Google search after their own Math::Pari install fails under Strawberry Perl.
Here is what worked for me (Strawberry 5.22):
A. from the cpan shell, tried to install Math::Pari. this failed
B. Downloaded pari-2.1.7 and placed the extracted folder pari-2.1.7 in the cpan build folder that was created in (0). This is found, by default, in C:\Strawberry\cpan\build
C.perl Makefile.PL Configure machine=none
D. dmake
E. dmake install
It basically means that 64 bit versions of perl are not supported. It also means that if you're sure that you're running a 32 bit version incorrectly detected as 64 bit, you can try opening a command line and then doing
cd C:\Users\script\.cpanm\work\1438929213.2276\
perl Makefile.PL force_download

Perl Install PAR:Packer Problems

My perl version is 5.16.2 on my Windows 7 64bit, I failed to install PAR:Packer. I tried active perl and strawberry perl , both got the same error. Can you please give me some suggestion. Below is my experience:
I tried ppm install PAR:Packer, version 1.013, But when I use pp, I got the error:
Perl lib version (5.16.2) doesn't match executable version (v5.16.0).
I also tried cpan install PAR:Packer, version 1.014. But I got the error during installation. The pop up window says: par.exe has stopped working. Then command prompt got the error:
C:\Perl64\bin\perl.exe -Mblib run_with_inc.pl par.exe -q -B -Oparldyn.exe
system(par.exe -I C:\Users\PAR-Packer-1.014\blib\arch -I C:\Users\PAR-Packer-1.014\blib\lib - IC:/Perl64/site/lib -IC:/Perl64/lib -I. -q -B -Oparldyn.exe) failed:
dmake.exe: Error code 255, while making 'parldyn.exe'
dmake.exe: Error code 255, while making 'subdirs'
I have googled extensively, but as of yet haven't been able to find a solution, any help is greatly appreciated, thanks a lot!
I simply changed the line 60 in .../perl64/Config.pm from
`$^V eq 5.16.3`
to
`$^V eq 5.16.3 or $^V eq 5.16.0`
and voila! My par-packer module 1.013 installed through ppm (ActiveState Perl 5.16.3) works ...
I'll start off with my own environment:
Windows 7 x64 en_US
Strawberry Perl v5.16.2 32bit
I just confirmed that I do have PAR::Packer working on my environment. I'm running PAR::Packer version 1.014.
There is a bug logged about PAR::Packer 1.013 failing to build on certain environments. The bug is logged on CPAN here: https://rt.cpan.org/Public/Bug/Display.html?id=77408
I recommend trying one of the following paths forward (based on your build version requirements):
Install PAR::Packer 1.0.14.
Install the patched version of PAR::Packer 1.013 that is available at http://strawberryperl.com/package/kmx/perl-modules-patched/PAR-Packer-1.013_patched.tar.gz
To build you will need any dependencies as well. Hopefully those work just fine through CPAN.
Download either the patched version listed above or the latest version from the CPAN site, then execute:
perl Makefile.pl
dmake
dmake test
dmake install
Keep in mind PAR::Packer requires a C/C++ compiler to build.
I ran into this exact same error scenario with Perl 5.16.3 on my Windows 7 64 bit machine. I started my Perl tinkering with ActiveState and later installed other related programs like Komodo Edit and finally installed StrawberryPerl. After reading quite a few of these online posts I tried the manual dmake methods and whatever other suggestions I could find. I then tried uninstalling ActiveState. That didn't help either. Finally, I went on an uninstall binge and found that after uninstalling all of the ActiveState and Komodo applications (along with a bunch of other stuff I wasn't using anymore) I was able to successfully install and use pp in two simple steps from the cpan prompt:
install CPAN
install pp
I was going to uninstall and re-install StrawberryPerl next but didn't have to. The install CPAN may not be necessary but it was suggested in the log output in one of my previously failed attempts so I figured I'd try that first. Hope this saves someone all the hassle I went to as a begginer.

Installing GTK2 in windows !

I am trying to install GTK in windows and use GLADE develop GUI interface. For GTK i need to install Glib, which is creating a problem for me. I am trying to do:
perl Makefile.pl
dmake
dmake test
dmake install
but I am getting stuck on the dmake step. The error I am seeing is:
--------------- dmake.exe: Error code 1, while making 'Glib.o'-------------
Is it possible to use GLADE and Glib with perl on windows? If so, am I making a mistake in building it?
I'm using gtk 2.22 in xp and 7 compiled in xp with msvisual c++ 2010 and activePerl 5.012. It was a dirty job but it works for me. I did this a few months ago and these are the notes I had written.
get msvcr100.dll and put it in system32 folder.
compile ExtUtils-Depends and ExtUtils-PkgConfig
get Glib and comment the line with unistd.h in gtk\include\font??foo (it's a linux header!)
add include stdlib.h , io.h and getopt.h in the same file. Get it from http://www.pwilson.net/sample.html
compile Cairo
compile Pango (I had some problems but since I did not pretend to use pango I just comment 3 references to gtk2perl????.xs)
compile gtk (the dirty job again: comment references to gdkcairo.xs and gdkprintcontext)
I just use a few of cairo so it works for me.
PDF creation (for exemple) will fail! If you need all the features may be you need to cross compile all this stuff in linux.

Why can't DynaLoader.pm load SSleay.dll for Net::SSLeay and Crypt::SSLeay?

I have Perl v5.10. I am trying to install Net::SSLeay 1.30 and Crypt::SSLeay 0.57.
I have already installed OpenSSL 0.9.8e.
For Net::SSLeay 1.30 I followed these steps:
perl Makefile.PL -windows C:\openssl
nmake
nmake test -- test fails
nmake install
perl test.pl
but I got an fatal error as:
D:\perl\Net_SSLeay.pm-1.30>perl -w test.pl
1..20
Can't load 'D:/perl/site/lib/auto/Net/SSLeay/SSLeay.dll' for module Net::SSLeay: load_file:The specified module could not be found at D:/perl/lib/DynaLoader.pm line 203.
at test.pl line 25
Compilation failed in require at test.pl line 25.
BEGIN failed--compilation aborted at test.pl line 25.
I got the same results for Crypt::SSLeay 0.57.
Randy Kobes has an answer for this on the Perl Win32 mailing list. Does your PATH environment variable contain the directory that contains libeay32.dll or ssleay32.dll?
There are many other answers that you can find in Google too. In cases like these, I take the whole error message and shove it into the Google search bar. I start cutting out parts of the error message, such as the specific paths, until I get some search results. This almost always works for me since I'm rarely the first person to have a problem.
Shared libs often have external dependencies, and on some operating systems those dependencies need to be immediately fulfilled when the first shared library is loaded, like your SSLeay.dll, which usually needs the two crypto libs. On linux you can check with ldd the run-time behavior, if all libs are found.
To debug this add the env var PERL_DL_DEBUG=5, like set PERL_DL_DEBUG=5 and try again or use the external tool depends.exe to see what dll's exactly are missing.
I had a similar problem with Windows Par::Packer. The resulting myprogram.exe had trouble loading rurban's hint with PERL_DL_DEBUG
Can't load 'temp\7e717f68.xs.dll' for module Crypt::SSLeay: load_file:Das angegebene Modul wurde nicht gefunden at <embedded>/DynaLoader.pm line 193.
at <embedded>/PAR/Heavy.pm line 95.
I was not able to find out which dlls to include with pp. After these hints I was simply looking to the dll-file with a hex editor and found this string: libgcc_s_dw2-1.dll - this was the dll to include into my "compiled" exe-program:
pp -M Crypt::SSLeay ^
-l c:/strawberry/perl/vendor/lib/auto/Crypt/SSLeay/SSLeay.xs.dll ^
-l c:/strawberry/c/bin/libgcc_s_dw2-1.dll ....
I'm having this same problem with a fresh install of Strawberry Perl 5.30. Googling the error just gives a bunch of unanswered, or half answered questions. Rurban is pointing in the right direction with using depends.exe. Opening ssleay.xs.dll and waiting for it to finishing throwing errors shows 5 main dll's that it depends on. 2 of which are windows core dll's, and 3 from openssl and perl. In the strawberry install, the 2 dll's related to crypto are in the [perlinstallpath]\c\bin folder. Add this to your windows %PATH% variable and it will start working.