Xtra-Computing / thundersvm

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

thundersvm.lib not built - VS build fails #152

Closed SauROnmiKE closed 5 years ago

SauROnmiKE commented 5 years ago

Greetings,

Sorry for my extremely beginner question, but since there is so little to search for thundersvm on the web, I thought I'd post this here. I did follow this issue as well: https://github.com/Xtra-Computing/thundersvm/issues/45 but did not help.

I'm not at all experienced with CMake and I've ran into some issues, which I think are not that serious, but my limited experience makes this happen. I've used cmake and I've generated the VS project. When I try to build (ALL_BUILD project), I get the following error: LNK 1181 cannot open input file '....\lib\Release\thundersvm.lib'

I check the folder and it's indeed missing.

What I did so far: 1) Cloned the git 2) Ran CMake (I have a guy version, I guess it's the same?) 3) Used Visual Studio 15 2017 Win64 and CUDA 9.0 as a generator. No optional toolset. Used default native compilers. 4) Configured 5) Generated 6) Opened VS project and ran to the above error. Full output:

1>------ Build started: Project: thundersvm, Configuration: Release x64 ------
1>Building NVCC (Device) object src/thundersvm/CMakeFiles/thundersvm.dir/kernel/Release/thundersvm_generated_kernelmatrix_kernel.cu.obj
1>CMake Error at thundersvm_generated_kernelmatrix_kernel.cu.obj.Release.cmake:222 (message):
1>  Error generating
1>  C:/Users/SauROnmiKE/Documents/GitHub/thundersvm/src/thundersvm/CMakeFiles/thundersvm.dir/kernel/Release/thundersvm_generated_kernelmatrix_kernel.cu.obj
1>
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 1.
1>Done building project "thundersvm.vcxproj" -- FAILED.
2>------ Build started: Project: thundersvm-predict, Configuration: Release x64 ------
3>------ Build started: Project: thundersvm-train, Configuration: Release x64 ------
2>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\thundersvm.lib'
3>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\thundersvm.lib'
2>Done building project "thundersvm-predict.vcxproj" -- FAILED.
3>Done building project "thundersvm-train.vcxproj" -- FAILED.
4>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
========== Build: 1 succeeded, 3 failed, 1 up-to-date, 0 skipped ==========

So, what do I do now, and what do I do when I finish building? Sorry for the newbie questions again,

SauROnmiKE commented 5 years ago

Managed to pass this error (forgot an argument in the cmake configuration), but then I ran to a bunch of "unresolved external symbol" errors, which again fails to build. Also, I got flag warnings like these:

2>CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored.

EDIT : Some search suggested that nvcc doesn't support some C++11 features. Maybe that's the issue?

QinbinLi commented 5 years ago

Hi, @SauROnmiKE

What is your cmake instruction? You can refer to this link. You have to set the parameters "CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS" and "BUILD_SHARED_LIBS" to true in your CMake setting. Thanks.

SauROnmiKE commented 5 years ago

Hello @GODqinbin I forgot to set the first flag to true. Now it builds without a problem. Thank you.

Now, to try it with Python...