PR 85510 - Linking error when accessing a coindexed variable inside an associate block

Damian Rouson damian@sourceryinstitute.org
Mon Apr 23 21:31:00 GMT 2018


The code below compiles without error with -fcoarray=single; whereas compiling with -fcoarray=lib generates the link-time error message shown. This occurs with the gfortran 7.2.0 and with the trunk dated 20180412. I haven’t tried other versions.  

The gfortran command comes from the output of the OpenCoarrays command 'caf --show'. Some of the paths have been truncated for presentation purposes:

$ cat communicate-inside-associate.f90 module foo
contains
  subroutine bar()
    integer, save :: i[*]=0
    associate(n=>1)
      print*,i[1]
    end associate
  end subroutine
end module

use foo
end
$ gfortran -I/opt/opencoarrays/include/OpenCoarrays-2.0.0-26-g840374a_GNU-8.0.1 -fcoarray=lib -Wl,-rpath -Wl,/opt/mpich/3.2/lib -Wl,--enable-new-dtags communicate-inside-associate.f90 /opt/opencoarrays/lib/libcaf_mpi.a /opt/mpich/3.2/lib/libmpifort.so /opt/mpich/3.2/lib/libmpi.so
/tmp/ccA8dGYe.o: In function `_caf_init.1.3816':
communicate-inside-associate.f90:(.text+0x4d): undefined reference to `caf_token.0.3815'
/tmp/ccA8dGYe.o: In function `__foo_MOD_bar':
communicate-inside-associate.f90:(.text+0x153): undefined reference to `caf_token.0.3815'
collect2: error: ld returned 1 exit status
rouson@sourcery-VirtualBox:~/Desktop/Builds/adhoc/src/gnu/nrc/emulated-collectives$ gfortran --version
GNU Fortran (GCC) 8.0.1 20180412 (experimental)



More information about the Fortran mailing list