Remove non-include paths from INC in pre-build checks #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to get
PDL::Graphics::PLplot
to install, I found it kept telling me that it needed a plplot library compiled with the--with-double
option:After having tried the advice about reinstalling
Alien::PLplot
and failing, and having checked thatlibplplot
had been installed using double precision, I happened to stumble upon the issue that the option-pthread
was appearing in the$plplot_include_path
variable. I noticed this by replacing the call tocheck_lib
(fromDevel::CheckLib
) withcheck_lib_or_exit
. When using this function, the error output was this instead:Upon reading the docs for
Devel::CheckLib
, it turns out that theINC
option to bothcheck_lib
andcheck_lib_or_exit
needs to be a space-delimited list of options, all of which start with-I
. Since-pthread
doesn't start with-I
the argument was badly formed, hence theanalyze_binary
callback was never called. Thus no check code was compiled which then resulted in$size
being set toundef
. Because$size
wasundef
, the uninitialized value warning mentioned in the first error message mentione above and the check for a double precision library failed. In other words, because-pthread
was turning up in the$plplot_include_path
string, the test for a library compiled with the--with-double
option was failing and hencePDL::Graphics::PLplot
failed to install.By filtering only for include paths from the list of options originally found in
$plplot_include_path
(i.e. selecting only options starting with-I
and hence excluding in this particular instance the-pthread
option), one avoids the issue of a badly formed INC argument and thus the checks inMakefile.PL
compile and run. Because all checks run, theMakefile
is created as per normal and the test suite passes.More background info: I found this issue on Debian version 11.11 with a perlbrewed perl, version 5.32.1.
This PR is submitted in the hope that it is useful. If you'd like anything changed, please let me know and I'll update and resubmit as necessary.