2

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:

  1. Setting LD_LIBRARY_PATH in .bash_profile, and yes, exporting it -- No dice.
  2. Following How can I set library and include paths for Makefile.PL for a single installation?, I set o conf makepl_arg in cpan to: LIBS=-L/homedir/lib INC=-I/homedir/include -- Still no dice
  3. 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'

Community
  • 1
  • 1
EMiller
  • 2,792
  • 4
  • 34
  • 55
  • Double check what you did in step 2, please. Do you see `LIBS=-L/homedir/lib INC=-I/homedir/include` when you do `o conf makepl_arg`? – ikegami May 14 '13 at 00:53
  • (Step 3 uses an incorrect value for `mbuild_arg`, but PDL uses `makepl_arg`, so not an issue.) – ikegami May 14 '13 at 00:55
  • I just tried it again ikegami, but unfortunately the problem remains. – EMiller May 14 '13 at 01:20
  • Note: PDL does not depend on the FFTW library, its optional. If you need FFTW support obviously you need it. Otherwise there are a few other FFT components of PDL. – Joel Berger May 14 '13 at 01:27
  • Ok, that's good. AS for `o conf commit`, it's not necessary if you don't exit before doing `install PDL`. – ikegami May 14 '13 at 02:10

1 Answers1

0

The solution was to examine the .cpan/build/PDL-*/ directory.

In it the INSTALL file indicates that the perldl.conf file can be modified to indicate paths to FFTW libs and FFTW include directories.

The process is as follows and can be done after a failed attempt at installing PDL:

  1. Copy the .cpan/build/PDL-*/perldl.conf file to ~/.perldl.conf - notice the . being added before the filename - PDL will look for this file when installing, even under CPAN
  2. Modify FFTW__LIBS and FFTW_INC in ~/.perldl.conf to point to the appropriate locations.
  3. Attempt install of PDL again with CPAN.

A bit confusing that PDL does not adhere to the makepl_arg cpan configuration.

EMiller
  • 2,792
  • 4
  • 34
  • 55