libcublas.lib vs libcublas.ipl

Hi there!

Hope everyone is doing as well as possible.

I updated to CUDA 10.2 on Windows yesterday. There are examples in CUDA Fortran, within the SDK. However, when I tried the “make all”, I got the following error message:

cd sgemm; make build; make run; make clean
make[1]: Entering directory '/Program Files/PGI/win64/2019/examples/CUDA-Fortran/SDK/sgemm'
pgfortran  -fast  -o sgemm.out sgemm.cuf -lcublas
LINK : fatal error LNK1104: cannot open file 'libcublas.lib'
./sgemm.exf: error STP001: cannot open file
make[1]: *** [Makefile:30: build] Error 2
make[1]: Leaving directory '/Program Files/PGI/win64/2019/examples/CUDA-Fortran/SDK/sgemm'
make[1]: Entering directory '/Program Files/PGI/win64/2019/examples/CUDA-Fortran/SDK/sgemm'
make[1]: *** No rule to make target 'sgemm.out', needed by 'run'.  Stop.
make[1]: Leaving directory '/Program Files/PGI/win64/2019/examples/CUDA-Fortran/SDK/sgemm'
make[1]: Entering directory '/Program Files/PGI/win64/2019/examples/CUDA-Fortran/SDK/sgemm'
Cleaning up...
make[1]: Leaving directory '/Program Files/PGI/win64/2019/examples/CUDA-Fortran/SDK/sgemm'

I do have libcublas.ipl but not libcublas.lib.

Should I have the libcublas.lib somewhere, please?

Thanks,
Erin

Hi Erin,

This may be a problem with the makefile. The makefile tries to find the sting “CYGWIN_NT” in the output from the command “uname -a” and if so, then uses the appropriate Windows flags. It appears that your make command is using the Linux flags. Can you try editing your makefile so the Windows flags are used?

F90FLAGS = -fast
OBJ     = o
EXE     = out
RUN     =
CUBLASLIB    = -lcublas
UNAME := $(shell uname -a)
# comment out or remove the ifeq and endif lines
#ifeq ($(findstring CYGWIN_NT, $(UNAME)), CYGWIN_NT)
OBJ     = obj
EXE     = exe
CUBLASLIB    = -defaultlib:cublas
#endif

I’m curious, what’s the output from the command “uname -a”?

-Mat

Commenting out those lines worked!

Thanks so much,
Erin