0

This error happens when I try to execute a Makefile:

/usr/bin/ld: cannot find -lrfftw_mpi
/usr/bin/ld: cannot find -lfftw_mpi
/usr/bin/ld: cannot find -lrfftw
collect2: error: ld returned 1 exit status

The corresponding .so libraries are placed in /usr/lib:

librfftw_mpi.so.2 (libc6,x86-64) => /usr/lib/librfftw_mpi.so.2
librfftw.so.2 (libc6,x86-64) => /usr/lib/librfftw.so.2

libfftw_mpi.so.2 (libc6,x86-64) => /usr/lib/libfftw_mpi.so.2

I tried to create symbolic links:

sudo ln -s /usr/lib/libfftw.so.2 /usr/bin/libfftw.so

but it didn't work. Can anybody help me?

2
  • Suggestion: Edit your question and include the content of Makefile, which might help other users to figure out what didn't work.
    – user37165
    Nov 28, 2015 at 16:38
  • Thank you. Actually, I asked the question offline and now my problem has been solved. First I have to edit the Makefile so that the library is linked to the actual path on my computer: Dec 17, 2015 at 4:46

1 Answer 1

0

Actually my problem has been solved (I asked the question offline):

  • For this particular code, double precision FFTW must be used, so I edited back this Makefile line to return it into its original state:

    FFTW_LIB =  $(FFTW_LIBS) -ldrfftw_mpi -ldfftw_mpi -ldrfftw -ldfftw
    

Single-precision FFTW does generate a Makefile, but it won't work.

  • Edit the FFTW_LIBS line so that the correct path to my computer (/home/van/fftw/lib/) is linked:

    FTW_LIBS=  -L/home/van/fftw/lib/
    
  • Add this line to the ~/.bashrc file so that the executable is always linked to all its dependencies:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/van/fftw/lib
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .