For other software I need fftw-2.1.5 with --enable-mpi --enable-type-prefix --enable-float
installed. It should be compiled with pgcc
PGCC, etc. are installed under the /home
directory. For this post I have shortend it with path-to
.
I do:
./configure --prefix=/path-to/fftw --enable-mpi --enable-type-prefix --enable-float CC=path-to/pgcc CXX=path-to/pgc++ F77=path-to/pgf77 FC=path-to/pgfortran make`
./configure
finishes successful, during make
I get this error message:
/usr/bin/ld: ../fftw/.libs/libsfftw.a(malloc.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: ../fftw/.libs/libsfftw.a(putils.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: ../fftw/.libs/libsfftw.a(twiddle.o): relocation R_X86_64_32 against .data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status
I tried to recompile with the -fPIC
flag:
make clean make CFLAGS="-fPIC"
Then I get:
../fftw/.libs/libsfftw.a(twiddle.o): In function `fftw_compute_twiddle': /home/daniel/fftw-test/fftw-2.1.5/fftw/./twiddle.c:92: undefined reference to `__fd_sincos_1' /home/daniel/fftw-test/fftw-2.1.5/fftw/./twiddle.c:126: undefined reference to `__fd_sincos_1' ../fftw/.libs/libsfftw.a(twiddle.o): In function `fftw_compute_rader_twiddle': /home/daniel/fftw-test/fftw-2.1.5/fftw/./twiddle.c:65: undefined reference to `__fd_sincos_1' collect2: error: ld returned 1 exit status
I've now tried to find a solution to why this happens for hours but I cannot figure it out.
When I configure it to use the gcc compiler (system default) everything works perfectly:
./configure --prefix=/fftw --enable-mpi --enable-type-prefix --enable-float make make install
EDIT, more information:
The program for which I need fftw, needs pgcc. I though it would be best if I compile everything with it as it was recommended on some forum sites.
In twiddle.c there is not a single mention of
__fd_sincos_1
. For example line 92 is simplyfor (i = 0; i < n; ++i) {
When I drop the
--enable-type-prefix
nothing changes. Still the same error.