This site is migrating to a new forum software on Tuesday, September 24th 2019, you may experience a short downtime during this transition

Main menu


How can I link CUDA FORTRAN code (.cuf ) with Fortran code(. F90)

1 post / 0 new
How can I link CUDA FORTRAN code (.cuf ) with Fortran code(. F90)

Hello! I tried to link a CUDA FORTRAN code with the Fortran code in  CESM.

I eidt the Makefile as follows:

    pgf90 -Mcuda -c bgpu.cuf
OBJS += bgpu.o

CUDALIBS = -L/opt/pgi/linux86-64/15.10/lib -lcudafor -lcudacemu -lcudadevice -lcudafor75 -lcudaforblas -lcudaforemu -lcudapgi
CUDAFLIBS = -L/opt/pgi/linux86-64/2015/cuda/7.5/lib64 -lcublas -lcusparse -lcurand -lcudart -lcufft -lcupti



As you can see, I compiled the bgpu.cuf to bgpu.o, and then I link the bgpu.o object with other object files.

The compilation process was all right. But when  I run the EXEC_SE ( that is cesm.exe), I got the error message "libcublas.7.5 no such file or directory" .

So I add the  libcublas.7.5 into the LD_LIBRARY_PATH, then I got another message, which is "No CUDA device code available".

It seems that the program treats the code bgpu.cuf as the F90 file, just because I directly linked the bgpu.o(which was compiled using pgf90) with other .o files(which were compiled from .F90 files using pgf90).

Is there any proper strategy to solve the problem?  Thinks

Who's new

  • jwolff
  • tinna.gunnarsdo...
  • sarthak2235@...
  • eolivares@...
  • shubham.gandhi@...