I need to install the Perl PDL library via CPAN as the non-root user.
CPAN for non-root works thanks to this SO question: How can I use CPAN as a non-root user?
Now, PDL depends on the FFTW library. Evidently, my sysadmin has the 32-bit version installed when I require the 64-bit for this machine.
I base this on the following error message during the CPAN install:
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic FFTW.o -o ../../blib/arch/auto/PDL/FFTW/FFTW.so \
-lm -L/lib -L/usr/lib -L/usr/local/lib -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -ldfftw -ldrfftw \
/usr/bin/ld: skipping incompatible /usr/local/lib/libdfftw.a when searching for -ldfftw
/usr/bin/ld: skipping incompatible /usr/local/lib/libdfftw.a when searching for -ldfftw
/usr/bin/ld: cannot find -ldfftw
Now I have successfully installed fftw in $HOME/lib
, indeed libdfftw.a
.
The problem is I can't get this gcc compilation instance to use that locally installed copy.
I have tried the following:
- Setting LD_LIBRARY_PATH in .bash_profile, and yes, exporting it -- No dice.
- Following How can I set library and include paths for Makefile.PL for a single installation?, I set
o conf makepl_arg
incpan
to:LIBS=-L/homedir/lib INC=-I/homedir/include
-- Still no dice - I did the same as step 2 but for
o conf mbuild_arg
--- Again, no dice.
None of these attempts had any effect on the gcc
line above; there were no additional paths specified with -L
flags.
What else can I try in cpan
to get this compilation command to reference my copy of fftw?
Update 1
I should add that before I make any changes, makepl_arg
is:
makepl_arg [INSTALLDIRS=site]
Hence, I am setting makepl_arg
to:
makepl_arg [INSTALLDIRS=site LIBS=-L/homedir/lib INC=-I/homedir/include]
I am setting these configurations without doing o conf commit
to permit experimentation. Should I be commiting these changes?
Update 2
I see that those -L
flags in the above gcc
line are coming from the makefile, which itself seems to be made by MakeMaker which I presume is reading the file 'Makefile.PL'