Compile error nvfortran

Hi
I have configured hdf5 with the following.
FC=/opt/nvidia/hpc_sdk…/bin/compilers/nvfortran ./configure --prefix=/usr/local/hdf5/ --enable-fortran
That seems to run through with no error.
Then when I try and Make, I hit an error that doesn’t tell me a lot.

/usr/bin/ld: .libs/H5f90global.o: relocation R_X86_64_32 against.rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: .libs/H5_ff.o: relocation R_X86_64_32 against symbol _h5global_10_' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: .libs/H5Aff.o: relocation R_X86_64_32S against.rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: .libs/H5Dff.o: relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: .libs/H5Fff.o: relocation R_X86_64_32S against.rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: .libs/H5Pff.o: relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: .libs/H5Rff.o: relocation R_X86_64_32S against.bss’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: .libs/H5Sff.o: relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: .libs/H5Tff.o: relocation R_X86_64_32 against.rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: .libs/H5VLff.o: relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: .libs/H5fortkit.o: relocation R_X86_64_32 against.rodata’ can not be used when making a shared object; recompile with -fPIC
make[3]: *** [Makefile:1044: libhdf5_fortran.la] Error 2
make[2]: *** [Makefile:958: all] Error 2
make[1]: *** [Makefile:903: all-recursive] Error 1
make: *** [Makefile:726: all-recursive] Error 1

I captured the whole output in a txt file but it won’t allow me to upload it.

Have you tried setting CFLAGS=-fPIC and possibly FCFLAGS=-fPIC? Or adding -fPIC if they are already set?

1 Like