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.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
R.D
  • 4,781
  • 11
  • 41
  • 58
  • 1
    That's not a weird error; it tells you exactly what the problem is. Can you be more specific about the two points in the last paragraph? Why can't you install new versions of Perl (chances are you can), and why can't you run your tool outside this environment (chances also are you can)? – Ether Aug 04 '10 at 17:47
  • because this perl is needed to bootstrap the environment. the tool is also dependent on the environment. – R.D Aug 04 '10 at 17:51
  • 1
    I can install Devel-Cover just fine with PPM on my AS Perl 5.10 – Fozi Aug 04 '10 at 17:54
  • The latest ActivePerl 5.8 ships with the header files, at least the Mac version does. AS doesn't release older copies so I can't see 5.8.7 (which is five years old). You can't even install the latest supported ActivePerl 5.8? That would save you a lot of pain now and later. – Schwern Aug 04 '10 at 18:04
  • 5.8.7 is ancient. What is preventing you from upgrading? There's lots of improvements and bugfixes since then. – Daenyth Sep 17 '10 at 15:52

2 Answers2

3

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
  • 78,363
  • 46
  • 261
  • 468
  • 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. – R.D Aug 04 '10 at 17:48
  • @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 Aug 04 '10 at 17:49
  • 4
    I pick INSANITY! *lights hair on fire and runs screaming out of the room* – Schwern Aug 04 '10 at 18:01
3

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
  • 153,029
  • 25
  • 195
  • 336