R with OpenACC on new WSL Ubuntu

Hi everyone:

I have started using the WSL Ubuntu on a Windows Machine. I can get regular FORTRAN with OpenACC, MPI, and CUDA Fortran to compile just fine.

But I’m having trouble interfacing OpenACC Fortran with R.

I have a very simple subroutine:

subroutine Rtest5(x,y,n)                                                                                                  integer n,i                                                                                                             real x(n),y(n)                                                                                                                                                                                                                                                                                                                                                          !$acc kernels                                                                                                           do i=1,n                                                                                                                   y(i) = 2.0*i + x(i)                                                                                                  enddo                                                                                                                   !$acc end kernels                                                                                                                                                                                                                             end subroutine Rtest5 

And here is the Makefile
CUDA_FFLAGS=-acc -Minfo=accel -Mlarge_arrays -L/opt/pgi/linux86-64/19.10/bin/pgfortran -L/opt/pgi/linux86-64/19.10/bin/\pgcc -lblas -llapack DLLCUDA_FFLAGS=-ta=tesla:nordc -L/opt/pgi/linux86-64/19.10/lib/acc_inint_link_cuda.o -L/opt/pgi/linux86-64/19.10/lib/\libaccapi.so -L/opt/pgi/linux86-64/19.10/lib/libaccg.so -L/opt/pgi/linux86-64/19.10/lib/libaccn.so -L/opt/pgi/\linux86-64/19.10/lib/libaccg2.so -L/opt/pgi/linux86-64/19.10/lib/libcudadevice.so -L/opt/pgi/linux86-64/19.10/lib/li\bnspgc.a -L/opt/pgi/linux86-64/19.10/bin/pgfortran -L/opt/pgi/linux86-64/19.10/bin/pgcc -lcudafor #mympi.so: mympi.f90 # mpif90 -fPIC -pgf90libs -c mympi.f90 mympi.o -m64 Rtest5.so: Rtest5.f90 pgfortran -Mcuda=cuda10.1 (CUDA_FFLAGS) -fPIC -c Rtest5.f90 -o Rtest5.o -m64 pgfortran -Mcuda=cuda10.1 (CUDA_FFLAGS) -shared -o Rtest5.so Rtest5.o -m64

It compiles fine, but when I try to run it in R, I get the message
libgomp: TODO

Any help much appreciated