Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Does not compile anymore (ppport.h missing) #1

Closed
eserte opened this issue Nov 27, 2015 · 4 comments
Closed

Does not compile anymore (ppport.h missing) #1

eserte opened this issue Nov 27, 2015 · 4 comments

Comments

@eserte
Copy link

eserte commented Nov 27, 2015

See http://matrix.cpantesters.org/?dist=PDL-Parallel-threads%200.03;reports=1#sl=7,1 for a cpantesters report overview --- there are no successful compiles since some months here. Looking at one of the reports I see:

cc -I"/bbbike/perl-5.20.2/lib/site_perl/5.20.2/x86_64-linux/PDL/Core" -I/opt/perl-5.20.2/lib/5.20.2/x86_64-linux/CORE -DXS_VERSION="0.03" -DVERSION="0.03" -fPIC -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o lib/PDL/Parallel/threads.o lib/PDL/Parallel/threads.c
lib/PDL/Parallel/threads.xs:4:20: fatal error: ppport.h: No such file or directory
compilation terminated.

This is on my smoker machine and I can confirm that ppport.h exists here:

$ ls -al /bbbike/perl-5.20.2/lib/site_perl/5.20.2/x86_64-linux/PDL/Core/ppport.h 
-r--r--r-- 1 root root 156706 May 12  2013 /bbbike/perl-5.20.2/lib/site_perl/5.20.2/x86_64-linux/PDL/Core/ppport.h

However it's possible that the double quotes in the -I option are used literally, so the C compiler cannot find the header file.

@abensonca
Copy link

The double quotes do seem to be the problem. Modifying Build.PL to strip them allows it to build successfully:

my $inc = PDL_INCLUDE; $inc =~ s/-I//g; $inc =~ s/"//g;

@hadjiprocopis
Copy link

I can confirm that abensonca's solution works.

@run4flat
Copy link
Member

First, sorry it's taken so long to get this fixed. My Perl work goes in seasons, and the emails for this dropped off my screen and I never realized what was going on. Sorry for the long-lived bug.

Second, hey, people are using my module! Holy cow, I never thought anybody paid any attention to it. Now that I know it's used by stuff I'll try to be a bit more responsive!

Third and finally, thank you for the solution @abensonca. I worry that this might cause things to break on Windows, but I'll let CPAN Testers smoke that out for me.

@mohawk2
Copy link
Member

mohawk2 commented Feb 13, 2022

This is because your Module::Build script is naively passing what PDL gives it directly to the executable, but PDL (being EUMM-orientated) protects things from the shell. The more idiomatic way here would be to use shellwords on the return from PDL_INCLUDE:

use Text::ParseWords qw(shellwords);
# ...
include_dirs => [map {(my $f = $_) =~ s/^-I//; $f} shellwords PDL_INCLUDE],

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants