0

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 simply for (i = 0; i < n; ++i) {

  • When I drop the --enable-type-prefix nothing changes. Still the same error.

daniel7558
  • 377
  • 1
  • 5
  • 18
  • "*It should be compiled with pgcc*" should it? Who says so? – alk Apr 15 '18 at 12:00
  • And also it would be interesting to see the code in `twiddle.c` which seems to be using those "undefined symbols". – alk Apr 15 '18 at 12:01
  • Out of the blue: What happens if you drop `--enable-type-prefix` from the pgCC command line? – alk Apr 15 '18 at 12:17
  • Thanks for your reply. I have added some information at the end of the post. – daniel7558 Apr 15 '18 at 12:37
  • Make a clean rebuild *without* any optimisation enabled and then recheck the source references the linker issues within it's warnings. – alk Apr 15 '18 at 12:52
  • The second error is most likely because the libtool is old and doesn't know to add "-lpgm" to the link. Try using CFLAGS="-O3 -fPIC -lpgm". – Mat Colgrove Apr 16 '18 at 19:51

0 Answers0