views:

56

answers:

2

cpan fails with this weird error as follows

Error: Unable to locate installed Perl libraries or Perl source code.

It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.

(You get this message, because MakeMaker could not find "D:\fbl_esc_bcd_tb\tools\perl\lib\CORE\perl.h")
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install

Problem is I can't install new active perl versions in this environment and the tool I want to coverage on does not run outside this environment.

+3  A: 

Active Perl does not use CPAN. If you want to use CPAN use Strawberry Perl. Active Perl uses binary distribution through its ppm system. There are a few third party repos for it if the official one doesn't have Devel::Cover -- though the official probably has Devel::Cover.

Most people these days are moving to Strawberry and away from AS. In my opinion, it is far more stable and CPAN-friendly, and surely less proprietary. Also, expect to be able to get stable versions of most everything - AS has been known to lag years in many occasions in the official repos. strawberry also comes with its own compiler and build environment so you can even get ::XS versions working with ease.

Evan Carroll
Problem is I can't install new active perl versions in this environment and the tool I want to coverage on does not run outside this environment.Also I see the cpan module inside available.
DotDot
@DotDot, Right, but with AS you don't have a build environment so CPAN is only good for PP modules, and at that only sometimes. You have three options: (a) Strawberry Perl, (b) PPM, (c) insanity. You pick.
Evan Carroll
I pick INSANITY! *lights hair on fire and runs screaming out of the room*
Schwern
+3  A: 

Short answer: The ActiveState PPM repository has a precompiled version of Devel::Cover you should be able to install.

Long answer: That's not a normal message from MakeMaker so I'm willing to guess its an ActiveState addition, but its probably true. The problem is exactly what the error message says; your distribution is missing some important files, specifically the C header files for Perl, so it cannot compile C code necessary for modules like Devel::Cover. This is often the result of an overzealous sysadmin or packager looking to save a few dozen K of disk space. You could probably take the header files from the 5.8.7 source, copy them into the CORE directory and it will probably work. It won't make anything worse.

I agree with Evan that, assuming this is a Windows machine, you should switch to Strawberry Perl which plays much better with the rest of the Perl community than ActivePerl.

Otherwise, ActiveState is a commercial company and they have paid Perl support. Give them a ring.

Schwern