psiz
psiz

Reputation: 69

How to specify external library file locations when installing CPAN modules

I'm trying to get Perl's Finance::Quote module working after MacOS upgrade to 11.4. One of the dependencies is B::Keywords. B::Keywords installation fails a test with this error:

> sudo cpan B::Keywords
[...]
Can't open /System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h: No such file or directory at t/11keywords.t line 25

Digging around, I see that keywords.h exists on my system in this location:

/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h

Is there a way to tell cpan (or cpanm, or some other installation tool) where to look for these headers? Or, any other approach to get this working would be welcome.

Upvotes: 5

Views: 336

Answers (1)

Håkon Hægland
Håkon Hægland

Reputation: 40718

It seems like they removed the keywords.h from the CORE directory (relative to the path given from $Config{archlibexp}) for the system perl on macOS 10.14, see this bug report.

The reason you are not able to install B::Keywords is due to a failed test 11keywords.t see line 24. Some possible solutions:

  • Install the module without running the tests (sudo cpan -T B::Keywords)
  • Submit an issue at the GitHub issue tracker so the author of the module can fix the problem.
  • Install the module with perlbrew instead of using the system perl (I tested this and it worked fine here).

Upvotes: 5

Related Questions