- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I am unable to use Fortran submodules with the IFX compiler, even though the classic IFORT succeeds in the same case. I am building a Linux shared library, which can be simplified to these two files libmain.f90 and libsub.f90:
module libmain
implicit none
interface
module subroutine sub_in_sub
end subroutine sub_in_sub
end interface
end module libmain
submodule (libmain) libsub
implicit none
contains
module subroutine sub_in_sub
print *, 'sub_in_sub'
end subroutine sub_in_sub
subroutine other_sub
print *, 'other_sub'
end subroutine other_sub
end submodule libsub
I compile them as
ifx -fPIC -c libmain.f90 -o libmain.o
ifx -fPIC -c libsub.f90 -o libsub.o
ifx libmain.o libsub.o -shared -o lib.so
The last, linking stage fails with
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: lib.so: version node not found for symbol libmain@libsub_mp_other_sub_
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: failed to set dynamic section sizes: bad value
The versions of IFX and ld are
ifx (IFORT) 2022.1.0 20220316
GNU ld (GNU Binutils; openSUSE Tumbleweed) 2.39.0.20220810-1
Using different linkers (via -fuse-ld=gold or -fuse-ld=lld) does not help, one gets similar messages, so this does not seem to be a linker problem.
No problem occurs with IFORT 2021.6.0.
1 솔루션
링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
The error has been reproduced and escalated with a bug report. I will let you know when there is an update on it.
