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

Defect: linking error with event post inside associate #648

Open
1 task done
rouson opened this issue Apr 8, 2019 · 1 comment
Open
1 task done

Defect: linking error with event post inside associate #648

rouson opened this issue Apr 8, 2019 · 1 comment

Comments

@rouson
Copy link
Member

rouson commented Apr 8, 2019

  • I am reporting a bug others will be able to reproduce and not asking a question or requesting a new feature.

System information including:

  • OpenCoarrays Version: 2.6.1-14-gb480f1d
  • Fortran Compiler: gfortran 9.0.1 20190318
  • C compiler used for building lib: gcc 9.0.1 20190318
  • Installation method: ./install.sh
  • All flags & options passed to the installer: (none)
  • Output of uname -a: Linux Sourcery-Institute-VM 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • MPI library being used: MPICH 3.2
  • Machine architecture and number of physical cores: 4
  • Version of CMake: 3.13.4

To help us debug your issue please explain:

Compile and link a program that executes event post inside an associate block.

What happened (include command output, screenshots, logs, etc.)

Linking error.

What you expected to happen

I expected the linker to produce an executable program a.out.

Step-by-step reproduction instructions to reproduce the error/bug

$cat link-error.f90 
module link_error
contains
  subroutine post_event_in_associate
    use iso_fortran_env
    type(event_type), save :: e[*]
    associate( i => 1 )
      event post(e[1])
    end associate
  end
end module
end
$caf link-error.f90 
/tmp/ccApG6rc.o: In function `_caf_init.1.3907':
link-error.f90:(.text+0x4d): undefined reference to `caf_token.0.3905'
/tmp/ccApG6rc.o: In function `__link_error_MOD_post_event_in_associate':
link-error.f90:(.text+0x8b): undefined reference to `caf_token.0.3905'
collect2: error: ld returned 1 exit status
Error: comand:
   `/home/rouson/Builds/opt/gnu/9.0.1/bin/gfortran -I/home/rouson/Desktop/Builds/opt/opencoarrays/2.6.1/gnu/9.0.1/include/OpenCoarrays-2.6.1_GNU-9.0.1 -fcoarray=lib -Wl,-rpath -Wl,/home/rouson/Builds/opt/mpich/3.2/gnu/9.0.1/lib -Wl,--enable-new-dtags -L/home/rouson/Desktop/Builds/opt/mpich/3.2/gnu/9.0.1/lib link-error.f90 /home/rouson/Desktop/Builds/opt/opencoarrays/2.6.1/gnu/9.0.1/lib/libcaf_mpi.a /home/rouson/Builds/opt/mpich/3.2/gnu/9.0.1/lib/libmpifort.so /home/rouson/Builds/opt/mpich/3.2/gnu/9.0.1/lib/libmpi.so`
failed to compile.

The linking problem goes away if the use statement and type(event_type) declaration are moved to just after the associate statement and wrapped in block/end block.

@rouson
Copy link
Member Author

rouson commented Apr 18, 2019

I suspect this is a gfortran error. I just submitted it to the gfortran developers as Bug report 90133 and via email 2019-04/00091.

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