Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

IFX fails to link Fortran submodule

jbenda
Beginner
1,498 Views

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.

Labels (1)
0 Kudos
1 Solution
Xiaoping_D_Intel
Employee
1,217 Views

It has been fixed by the new oneAPI 2023.0 release.


View solution in original post

0 Kudos
2 Replies
Xiaoping_D_Intel
Employee
1,424 Views

The error has been reproduced and escalated with a bug report. I will let you know when there is an update on it.



0 Kudos
Xiaoping_D_Intel
Employee
1,218 Views

It has been fixed by the new oneAPI 2023.0 release.


0 Kudos
Reply