linker problem with cuda 10.1.105 on cento 7 ............... undefined references

Hi,

when I try to compile some code I get a problem at the linking stage:

ifort -c -O3 sgemm_speed_pinned.f90 -I ../../1.0/ifort_3.10.0-957.5.1.el7.x86_64/
ifort  -o sgemm_speed_cublas_pinned -O3 sgemm_speed_pinned.o ../../1.0/ifort_3.10.0-957.5.1.el7.x86_64/Lib_CUDA_ifort_3.10.0-957.5.1.el7.x86_64_1.0.a -L/usr/local/cuda//lib64 -lcudart_static -lcublas_static -lcusparse_static -lculibos -lrt -lstdc++
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libcublas_static.a(cublas.o): In function `cublasCtxInit(cublasContext**)':
cublas.compute_75.cudafe1.cpp:(.text+0x34b): undefined reference to `cublasLtCtxInit'
cublas.compute_75.cudafe1.cpp:(.text+0x417): undefined reference to `init_gemm_select'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libcublas_static.a(cublas.o): In function `cublasGetProperty':
cublas.compute_75.cudafe1.cpp:(.text+0x2257): undefined reference to `cublasLtGetProperty'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libcublas_static.a(cublas.o): In function `cublasGetVersion_v2':
cublas.compute_75.cudafe1.cpp:(.text+0x484a): undefined reference to `cublasLtGetVersion'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libcublas_static.a(cublas.o): In function `cublasDestroy_v2':
cublas.compute_75.cudafe1.cpp:(.text+0x4fc9): undefined reference to `cublasLtShutdownCtx'
cublas.compute_75.cudafe1.cpp:(.text+0x5064): undefined reference to `free_gemm_select'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libcublas_static.a(cublas.o): In function `cublasGetCudartVersion':
cublas.compute_75.cudafe1.cpp:(.text+0x2a1): undefined reference to `cublasLtGetCudartVersion'

The cuda version is 10.1.105, the linux kernel is centos 3.10-957.

When the same code is compiled using dynamic linking there are NO errors. When the same code is compiled and linked at an arch linux machine, kernel 5, cuda 10.0.130, is compiles and links with NO error either statically or dynamically.

Any suggestions??

I could solve the problem by going back to release 10.0.130. So there might be an issue with release 10.1.150.

You have to link also with -lcublasLt_static also.
cublas.so has a dependancy on cublasLt.so

readelf -d /usr/lib/x86_64-linux-gnu/libcublas.so
0x0000000000000001 (NEEDED) Shared library: [libcublasLt.so.10]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]
0x000000000000000e (SONAME) Library soname: [libcublas.so.10]

So both libs have to be statically linked in correct order.