Xtra-Computing / thundersvm

ThunderSVM: A Fast SVM Library on GPUs and CPUs
Apache License 2.0
1.55k stars 215 forks source link

Do not enforce shared library build #197

Closed emmenlau closed 4 years ago

emmenlau commented 4 years ago

This PR removes the explicit setting of SHARED for the library. Instead, users can select whether they want shared or static builds with the standard cmake option -DBUILD_SHARED_LIBS=(ON|OFF), see https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html

We tested thundersvm static successfully against CUDA 10.2 on Ubuntu and CentOS Linux and on Visual Studio 2017 and 2019.

Os is there a reason static can not be used?

zeyiwen commented 4 years ago

Thanks!

shijiashuai commented 4 years ago

Python and other language interfaces rely on shared library, and we don't use static library yet. There is no other reason.

Adding this option is reasonable, but can we build the shared library by default? Otherwise I need to update the documents and building scripts.

emmenlau commented 4 years ago

Python and other language interfaces rely on shared library, and we don't use static library yet.

Ok that is good to know, thanks! I'm using the static build on Linux and macOS from C++ and it works well so far.

Adding this option is reasonable, but can we build the shared library by default? Otherwise I need to update the documents and building scripts.

I'm not 100% certain about the default for BUILD_SHARED_LIBS. To be completely certain, I will add another small PR that sets a default that users can override.