Trouble with cuML C++ integration

Hi, I am having trouble using the libcuml++ library from the Rapids cuML project.

The branch “branch-23.04” (GitHub - rapidsai/cuml at branch-23.04) is the most recent one that compiles on my machine with the following settings:
“-DENABLE_CUMLPRIMS_MG=OFF -DSINGLEGPU=ON -DBUILD_CUML_TESTS=OFF -DBUILD_PRIMS_TESTS=OFF -DBUILD_CUML_EXAMPLES=OFF -DBUILD_CUML_BENCH=OFF -DDETECT_CONDA_ENV=OFF -DBLAS_LIBRARIES=/usr/local/cuda-11.4/targets/x86_64-linux/lib/libcublas.so -DLAPACK_LIBRARIES=/usr/local/cuda-11.4/targets/x86_64-linux/lib/liblapack_static.a -DCMAKE_INSTALL_PREFIX=…/install”
“make libcuml++.so” can then successfully create the library file.

However, when trying to use this library, either in my own code or the example projects (https://github.com/rapidsai/cuml/tree/branch-23.04/cpp/examples), the linker complains about the following undefined references:

libcuml++.so: undefined reference to ‘sgeqrf_’
libcuml++.so: undefined reference to ‘sgesvd_’
libcuml++.so: undefined reference to ‘dsyev_’
libcuml++.so: undefined reference to ‘dgesvd_’
libcuml++.so: undefined reference to ‘sorgqr_’

As far as I can tell, these functions should be part of the lapack distribution, to which I also tried to link (no luck).
I’m linking against “cusparse cusolver lapack_static cublas cublasLt”.

I also tried the official install path of cuML using pip. Using the resulting libcuml++.so has the same undefined reference problems described above.

Does anyone have an idea on what is missing in my setup, so I can use libcuml++?
Thanks in advance, and let me know if I can provide more information about the problem.

yes, they are part of (ordinary CPU/host) lapack. I don’t know anything about your host machine setup, but if you are expecting to find those in:

that would be strange to me. CUDA doesn’t provide any ordinary CPU/host lapack libraries, and in an typical CUDA install, there is no liblapack_static.a in that directory.

You have to provide your own lapack libraries. Likewise your -DBLAS_LIBRARIES is not set correctly from what I can see. That is wanting a host/CPU BLAS library.

Such libraries generally have open source alternatives, like OpenBLAS, and also other alternatives such as via Intel MKL.

I don’t think you’ll find a lot of Rapids experts here. If you go to the rapids landing pages, they suggest slack, SO, and twitter communication handles to reach the community.

Thanks, that already helps a lot!
If I can’t figure out a solution using ordinary lapack and blas, I will reach out to some Rapids expert as suggested.
Thanks again!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.