ParaView 5.9.0-RC1 superbuild compile issues with scipy

When compiling ParaView 5.9.0-RC1 I have found a number of issues on our Centennial system.
Centennial is a RHEL 7.7 system, where the compiler is gcc 7.3.0

First if

-DENABLE_scipy=ON 

is used then

`building ‘scipy.integrate._quadpack’ extension
compiling C sources
C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -fPIC -fPIC

compile options: ‘-DNO_ATLAS_INFO=1 -Iscipy/_lib/src -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib -I/usr/local/include -I/usr/include -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/include -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib/python3.8/site-packages/numpy/core/include -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/include/python3.8 -c’
/p/app/gnu/7.3.0/bin/gfortran -Wall -g -Wall -g -shared -shared build/temp.linux-x86_64-3.8/scipy/integrate/quadpackmodule.o -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/…/…/…/…/lib64 -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/…/…/…/…/lib64 -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib -Lbuild/temp.linux-x86_64-3.8 -Wl,-rpath=/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib -lquadpack -lmach -llapack -llapack -lblas -lblas -lgfortran -o build/lib.linux-x86_64-3.8/scipy/integrate/quadpack.cpython-38-x86_64-linux-gnu.so -Wl,–version-script=build/temp.linux-x86_64-3.8/link-version-scipy.integrate.quadpack.map
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqagie.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqagpe.o): relocation R_X86_64_32 against .rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqagse.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawce.o): relocation R_X86_64_32 against .rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawfe.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawoe.o): relocation R_X86_64_32 against .rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawse.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqc25c.o): relocation R_X86_64_32 against symbol dqwgtc
’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqc25f.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqc25s.o): relocation R_X86_64_32 against symbol dqwgts
’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqelg.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqk15i.o): relocation R_X86_64_32 against .rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqk15w.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqk21.o): relocation R_X86_64_32 against .rodata’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libmach.a(d1mach.o): relocation R_X86_64_32S against undefined symbol `d9mach
’ 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
/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib/python3.8/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools’ objects directly or at least import Setuptools first.
warnings.warn(
Running from SciPy source directory.
/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib/python3.8/site-packages/numpy/distutils/system_info.py:1914: UserWarning:
Optimized (vendor) Blas libraries are not found.
Falls back to netlib Blas library which has worse performance.
A better performance should be easily gained by switching
Blas library.
if self._calc_info(blas):
/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib/python3.8/site-packages/numpy/distutils/system_info.py:838: UserWarning: Specified path /usr/local/include/python3.8 is invalid.
return self.get_paths(self.section, key)
/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib/python3.8/site-packages/numpy/distutils/system_info.py:838: UserWarning: Specified path /usr/include/python3.8 is invalid.
return self.get_paths(self.section, key)
error: Command “/p/app/gnu/7.3.0/bin/gfortran -Wall -g -Wall -g -shared -shared build/temp.linux-x86_64-3.8/scipy/integrate/_quadpackmodule.o -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/…/…/…/…/lib64 -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/…/…/…/…/lib64 -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib -Lbuild/temp.linux-x86_64-3.8 -Wl,-rpath=/usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/install/lib -lquadpack -lmach -llapack -llapack -lblas -lblas -lgfortran -o build/lib.linux-x86_64-3.8/scipy/integrate/_quadpack.cpython-38-x86_64-linux-gnu.so -Wl,–version-script=build/temp.linux-x86_64-3.8/link-version-scipy.integrate._quadpack.map” failed with exit status 1
CMake Error at /usr/cta/DAAC/build/PV/Build_5.9.0-RC1_mesa_mpich_test/superbuild/sb-scipy-build.cmake:47 (message):
Failed with exit code 1

`

This can be bypassed by setting

-DENABLE_scipy=OFF

Thanks,

Joe

Hmm. Looks like a static library isn’t using -fPIC. This generally means that it cannot be combined with a shared library ever. I don’t know what is causing it not to be added in this case here. It looks like the Fortran objects are missing the (equivalent) flag?

Cc: @chuckatkins

I have just attempted to build ParaView 5.9.0-RC2 with scipy and it still fails with these errors.

compile options: '-DNO_ATLAS_INFO=1 -Iscipy/_lib/src -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib -I/usr/local/include -I/usr/include -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/include -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib/python3.8/site-packages/numpy/core/include -I/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/include/python3.8 -c'
/p/app/gnu/7.3.0/bin/gfortran -Wall -g -Wall -g -shared -shared build/temp.linux-x86_64-3.8/scipy/integrate/_quadpackmodule.o -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib -Lbuild/temp.linux-x86_64-3.8 -Wl,-rpath=/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib -lquadpack -lmach -llapack -llapack -lblas -lblas -lgfortran -o build/lib.linux-x86_64-3.8/scipy/integrate/_quadpack.cpython-38-x86_64-linux-gnu.so -Wl,--version-script=build/temp.linux-x86_64-3.8/link-version-scipy.integrate._quadpack.map
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqagie.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqagpe.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqagse.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawce.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawfe.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawoe.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqawse.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqc25c.o): relocation R_X86_64_32 against symbol `dqwgtc_' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqc25f.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqc25s.o): relocation R_X86_64_32 against symbol `dqwgts_' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqelg.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqk15i.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqk15w.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libquadpack.a(dqk21.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: build/temp.linux-x86_64-3.8/libmach.a(d1mach.o): relocation R_X86_64_32S against undefined symbol `d9mach_' 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
/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib/python3.8/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
  warnings.warn(
Running from SciPy source directory.
/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib/python3.8/site-packages/numpy/distutils/system_info.py:1914: UserWarning:
Optimized (vendor) Blas libraries are not found.
Falls back to netlib Blas library which has worse performance.
A better performance should be easily gained by switching
Blas library.
  if self._calc_info(blas):
/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib/python3.8/site-packages/numpy/distutils/system_info.py:838: UserWarning: Specified path /usr/local/include/python3.8 is invalid.
  return self.get_paths(self.section, key)
/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib/python3.8/site-packages/numpy/distutils/system_info.py:838: UserWarning: Specified path /usr/include/python3.8 is invalid.
  return self.get_paths(self.section, key)
error: Command "/p/app/gnu/7.3.0/bin/gfortran -Wall -g -Wall -g -shared -shared build/temp.linux-x86_64-3.8/scipy/integrate/_quadpackmodule.o -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/p/app/gnu/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib -Lbuild/temp.linux-x86_64-3.8 -Wl,-rpath=/usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/install/lib -lquadpack -lmach -llapack -llapack -lblas -lblas -lgfortran -o build/lib.linux-x86_64-3.8/scipy/integrate/_quadpack.cpython-38-x86_64-linux-gnu.so -Wl,--version-script=build/temp.linux-x86_64-3.8/link-version-scipy.integrate._quadpack.map" failed with exit status 1
CMake Error at /usr/cta/DAAC/build/PV/Build_5.9.0-RC2_osmesa_mpich_test/superbuild/sb-scipy-build.cmake:47 (message):
  Failed with exit code 1