llnl / llnl/sundials

Undefined reference to `psolve' when LTO flags are used

Open
#97 0 comments 0 reactions 1 assignee View on GitHub

@balos1 is already working on this.

Since Dec 20, 2021.

build-error Fortran triage
Dominant language
C
Stars
686
Forks
167
Avg merge
1d 20h
Merged PRs (30d)
17

Description

Hi all.

Linker fails to compile the `test_fsunlinsol_*' tests when i use LTO flags (-flto=auto -ffat-lto-objects -fexceptions)

[ 81%] Linking Fortran executable test_fsunlinsol_sptfqmr_mod_serial
cd /home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/build/examples/sunlinsol/sptfqmr/serial && /usr/bin/cmake -E cmake_link_script CMakeFiles/test_fsunlinsol_sptfqmr_mod_serial.dir/link.txt --verbose=1
/usr/bin/gfortran -Wl,-z,relro   -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/flexiblas CMakeFiles/test_fsunlinsol_sptfqmr_mod_serial.dir/test_fsunlinsol_sptfqmr_mod_serial.f90.o CMakeFiles/test_fsunlinsol_sptfqmr_mod_serial.dir/__/__/__/utilities/test_utilities.f90.o CMakeFiles/test_fsunlinsol_sptfqmr_mod_serial.dir/__/__/test_sunlinsol.f90.o -o test_fsunlinsol_sptfqmr_mod_serial  ../../../../src/nvector/serial/fmod/libsundials_fnvecserial_mod.so.6.0.0 ../../../../src/sunlinsol/sptfqmr/fmod/libsundials_fsunlinsolsptfqmr_mod.so.4.0.0 -lm ../../../../src/nvector/serial/libsundials_nvecserial.so.6.0.0 ../../../../src/sunlinsol/sptfqmr/libsundials_sunlinsolsptfqmr.so.4.0.0 
/usr/bin/ld: /tmp/cccMESVR.ltrans0.ltrans.o: in function `MAIN__':
/home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/examples/sunlinsol/test_sunlinsol.f90:213: undefined reference to `psolve'
/usr/bin/ld: /tmp/cccMESVR.ltrans0.ltrans.o:/home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/examples/sunlinsol/test_sunlinsol.f90:213: undefined reference to `psetup'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/sunlinsol/sptfqmr/serial/CMakeFiles/test_fsunlinsol_sptfqmr_mod_serial.dir/build.make:133: examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial] Error 1
make[2]: Leaving directory '/home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/build'
make[1]: *** [CMakeFiles/Makefile2:13609: examples/sunlinsol/sptfqmr/serial/CMakeFiles/test_fsunlinsol_sptfqmr_mod_serial.dir/all] Error 2
make[2]: Entering directory '/home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/build'
[ 81%] Linking Fortran executable test_fsunlinsol_pcg_mod_serial
cd /home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/build/examples/sunlinsol/pcg/serial && /usr/bin/cmake -E cmake_link_script CMakeFiles/test_fsunlinsol_pcg_mod_serial.dir/link.txt --verbose=1
/usr/bin/gfortran -Wl,-z,relro   -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/flexiblas CMakeFiles/test_fsunlinsol_pcg_mod_serial.dir/test_fsunlinsol_pcg_mod_serial.f90.o CMakeFiles/test_fsunlinsol_pcg_mod_serial.dir/__/__/__/utilities/test_utilities.f90.o CMakeFiles/test_fsunlinsol_pcg_mod_serial.dir/__/__/test_sunlinsol.f90.o -o test_fsunlinsol_pcg_mod_serial  ../../../../src/nvector/serial/fmod/libsundials_fnvecserial_mod.so.6.0.0 ../../../../src/sunlinsol/pcg/fmod/libsundials_fsunlinsolpcg_mod.so.4.0.0 -lm ../../../../src/nvector/serial/libsundials_nvecserial.so.6.0.0 ../../../../src/sunlinsol/pcg/libsundials_sunlinsolpcg.so.4.0.0 
/usr/bin/ld: /tmp/cc7biGAn.ltrans0.ltrans.o: in function `MAIN__':
/home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/examples/sunlinsol/test_sunlinsol.f90:213: undefined reference to `psolve'
/usr/bin/ld: /tmp/cc7biGAn.ltrans0.ltrans.o:/home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/examples/sunlinsol/test_sunlinsol.f90:213: undefined reference to `psetup'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/sunlinsol/pcg/serial/CMakeFiles/test_fsunlinsol_pcg_mod_serial.dir/build.make:133: examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial] Error 1
make[2]: Leaving directory '/home/sagitter/rpmbuild/BUILD/sundials-6.0.0/sundials-6.0.0/build'
make[1]: *** [CMakeFiles/Makefile2:13667: examples/sunlinsol/pcg/serial/CMakeFiles/test_fsunlinsol_pcg_mod_serial.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.