Source: sundials Followup-For: Bug #1015672 This issue seems to have metastasised, such that the suggested SUSE patch is no longer sufficient. sunlinsol is now affected, not the nvector components
With sundials 7.1.1, optimize=+lto gets [ 82%] Linking Fortran executable test_fsunlinsol_spbcgs_mod_serial cd /projects/mathlibs/build/sundials/debian/build/examples/sunlinsol/spbcgs/serial && /usr/bin/cmake -E cmake_link_script CMakeFiles/test_fsunlinsol_spbcgs_mod_serial.dir/link.txt --verbose=1 /usr/bin/gfortran -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -g -O2 -ffile-prefix-map=/projects/mathlibs/build/sundials=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -fcf-protection CMakeFiles/test_fsunlinsol_spbcgs_mod_serial.dir/test_fsunlinsol_spbcgs_mod_serial.f90.o CMakeFiles/test_fsunlinsol_spbcgs_mod_serial.dir/__/__/__/utilities/test_utilities.f90.o CMakeFiles/test_fsunlinsol_spbcgs_mod_serial.dir/__/__/test_sunlinsol.f90.o -o test_fsunlinsol_spbcgs_mod_serial -Wl,-rpath,/projects/mathlibs/build/sundials/debian/build/src/nvector/serial/fmod_int32:/projects/mathlibs/build/sundials/debian/build/src/sunlinsol/spbcgs/fmod_int32:/projects/mathlibs/build/sundials/debian/build/src/nvector/serial:/projects/mathlibs/build/sundials/debian/build/src/sunlinsol/spbcgs:/projects/mathlibs/build/sundials/debian/build/src/sundials/fmod_int32:/projects/mathlibs/build/sundials/debian/build/src/sundials:/usr/lib/x86_64-linux-gnu/openmpi/lib ../../../../src/nvector/serial/fmod_int32/libsundials_fnvecserial_mod.so.7.1.1 ../../../../src/sunlinsol/spbcgs/fmod_int32/libsundials_fsunlinsolspbcgs_mod.so.5.1.1 -lm ../../../../src/nvector/serial/libsundials_nvecserial.so.7.1.1 ../../../../src/sunlinsol/spbcgs/libsundials_sunlinsolspbcgs.so.5.1.1 ../../../../src/sundials/fmod_int32/libsundials_fcore_mod.so.7.1.1 ../../../../src/sundials/libsundials_core.so.7.1.1 /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so /usr/bin/ld: /tmp/cccP2ly1.ltrans0.ltrans.o: in function `MAIN__': ./debian/build/examples/sunlinsol/spfgmr/serial/./examples/sunlinsol/test_sunlinsol.f90:165:(.text+0x1153): undefined reference to `atimes' /usr/bin/ld: ./debian/build/examples/sunlinsol/spfgmr/serial/./examples/sunlinsol/test_sunlinsol.f90:187:(.text+0x11c6): undefined reference to `psolve' /usr/bin/ld: /tmp/cccP2ly1.ltrans0.ltrans.o:./debian/build/examples/sunlinsol/spfgmr/serial/./examples/sunlinsol/test_sunlinsol.f90:187:(.text+0x11cd): undefined reference to `psetup' collect2: error: ld returned 1 exit status make[3]: *** [examples/sunlinsol/spfgmr/serial/CMakeFiles/test_fsunlinsol_spfgmr_mod_serial.dir/build.make:136: examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial] Error 1 make[3]: Leaving directory '/projects/mathlibs/build/sundials/debian/build' make[2]: *** [CMakeFiles/Makefile2:22702: examples/sunlinsol/spfgmr/serial/CMakeFiles/test_fsunlinsol_spfgmr_mod_serial.dir/all] Error 2 make[2]: *** Waiting for unfinished jobs.... /usr/bin/ld: /tmp/ccaVS6Vi.ltrans0.ltrans.o: in function `MAIN__': ./debian/build/examples/sunlinsol/spgmr/serial/./examples/sunlinsol/test_sunlinsol.f90:165:(.text+0x1153): undefined reference to `atimes' /usr/bin/ld: ./debian/build/examples/sunlinsol/spgmr/serial/./examples/sunlinsol/test_sunlinsol.f90:187:(.text+0x11c6): undefined reference to `psolve' /usr/bin/ld: /tmp/ccaVS6Vi.ltrans0.ltrans.o:./debian/build/examples/sunlinsol/spgmr/serial/./examples/sunlinsol/test_sunlinsol.f90:187:(.text+0x11cd): undefined reference to `psetup' collect2: error: ld returned 1 exit status ... sundials 7.1.1 also already addresses pthread linking in src/nvector/pthreads/CMakeLists.txt with LINK_LIBRARIES PRIVATE Threads::Threads