Can not compile boiler plate cublas code

This is unfortunate, supposed to be so simple but it just segfaulted due to unreferenced call but I see cublas libraries are installed.
Code example is from:
1. Introduction — cuBLAS 12.8 documentation Section 1.3, literally just copy and pasted.

Below is the error with cublas apparently installed:

nvcc ex1.cu 
/usr/bin/ld: /tmp/tmpxft_00000088_00000000-11_ex1.o: in function `modify(cublasContext*, float*, int, int, int, int, float, float)':
tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0x97): undefined reference to `cublasSscal_v2'
/usr/bin/ld: tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0xdc): undefined reference to `cublasSscal_v2'
/usr/bin/ld: /tmp/tmpxft_00000088_00000000-11_ex1.o: in function `main':
tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0x1d6): undefined reference to `cublasCreate_v2'
/usr/bin/ld: tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0x239): undefined reference to `cublasSetMatrix'
/usr/bin/ld: tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0x279): undefined reference to `cublasDestroy_v2'
/usr/bin/ld: tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0x2e9): undefined reference to `cublasGetMatrix'
/usr/bin/ld: tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0x329): undefined reference to `cublasDestroy_v2'
/usr/bin/ld: tmpxft_00000088_00000000-6_ex1.cudafe1.cpp:(.text+0x34b): undefined reference to `cublasDestroy_v2'
collect2: error: ld returned 1 exit status
[root@localhost tutorial]# yum list installed | grep -i cublas
libcublas-12-6.x86_64                          12.6.4.1-1                       @cuda-rhel9-12-6-local
libcublas-devel-12-6.x86_64                    12.6.4.1-1                       @cuda-rhel9-12-6-local
[root@localhost tutorial]# egrep -irn cublasSetMatrix /usr/include/
[root@localhost tutorial]# egrep -irn cublasSetMatrix /usr/
^C
[root@localhost tutorial]# find /usr -name cublas_v2.h
/usr/local/lib/python3.9/site-packages/nvidia/cublas/include/cublas_v2.h
/usr/local/cuda-12.6/targets/x86_64-linux/include/cublas_v2.h

I guess this worked!
-lcublas