- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error has been reproduced and escalated with a bug report. I will let you know when there is an update on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It has been fixed by the new oneAPI 2023.0 release.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page