Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined reference to `psolve' when LTO flags are used #97

Open
sagitter opened this issue Dec 18, 2021 · 0 comments
Open

Undefined reference to `psolve' when LTO flags are used #97

sagitter opened this issue Dec 18, 2021 · 0 comments

Comments

@sagitter
Copy link

sagitter commented Dec 18, 2021

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
@balos1 balos1 self-assigned this Dec 20, 2021
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Mar 24, 2024
It fails with linking errors that are probably fortran related.

An upstream ticket exists since 2021 but no sign anything is being done
about it.

Bug: LLNL/sundials#97
Closes: https://bugs.gentoo.org/862933
Signed-off-by: Eli Schwartz <[email protected]>
Signed-off-by: Sam James <[email protected]>
@balos1 balos1 added triage and removed bug labels Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants