cvxgrp / scs

Splitting Conic Solver
MIT License
553 stars 136 forks source link

Add support for GPU in CMake buildsystem #162

Open traversaro opened 3 years ago

traversaro commented 3 years ago

https://github.com/cvxgrp/scs/pull/161 added a CMake-based buildsystem, but at the moment the GPU builds are not supported there. It would be convenient to modify it to support also GPU builds. I plan to work on this as part of https://github.com/conda-forge/scs-feedstock/issues/18, this is just a placeholder issue to make sure that anyone interested is aware of this.

traversaro commented 3 years ago

I am definitely not an expert in this, but given that apparently this is just a C library that links CUDA libraries, it should be sufficient to use https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html . If instead the library contained .cu files, we should have enabled the CUDA language, see https://cliutils.gitlab.io/modern-cmake/chapters/packages/CUDA.html .

h-vetinari commented 1 year ago

Hello @bodono, happy new year! :)

Could we come back to this issue?

I'd add that it might be a good idea to consider moving the reference build system to CMake completely - it's just much more portable than a Makefile; otherwise it's a constant battle to keep them in sync resp. working equivalently.

bodono commented 1 year ago

On the GPU stuff - the GPU code is still broken in some way that I haven't had time to track down. Overall the GPU doesn't provide much benefit anyway and users are probably better off using MKL (if they can).

I agree that CMake is better than Make overall. Unfortunately I don't know much about CMake, and I didn't contribute the original CMake code to SCS. I'd be happy to accept a PR that removes the Makefile and cleans up the CMake file if anyone is able to help!