Xtra-Computing / thundersvm

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

Build/libs not built #161

Closed leexamine closed 5 years ago

leexamine commented 5 years ago

Hi,

I'm actually a beginner in python and C++ programming, and this is my first time to use Github.

I tried my best to follow the installation guide scripts, but I cannot run the thundersvm.py.

I'm using Windows10, Python 3.7, Cuda 10.0, CMAKE 3.15, VisualStudio 2019(but I reinstall the 2015 version)

I'd like to use this thundersvm.py in python environment and import SVC,

but in my jupyter notebook error message occurs.

FileNotFoundError Traceback (most recent call last)

in 1 import sys 2 sys.path.insert(0, "C:/test2/thundersvm/python/thundersvm") ----> 3 import thundersvm C:/test2/thundersvm/python/thundersvm\thundersvm.py in 62 thundersvm = CDLL(lib_path) 63 else: ---> 64 raise FileNotFoundError("Please build the library first!") 65 SVM_TYPE = ['c_svc', 'nu_svc', 'one_class', 'epsilon_svr', 'nu_svr'] 66 KERNEL_TYPE = ['linear', 'polynomial', 'rbf', 'sigmoid', 'precomputed'] FileNotFoundError: Please build the library first! ----------------------------------------------------------------------------------- So I opened the thundersvm.py to figure out what is the problem, and I found that there's no 'lib' folder and "thundersvm.dll" file in by thundersvm/build directory. There was no error message and Cmake error log when I type this ---------------------------------------------------------------------------------- mkdir build cd build cmake .. -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 14 2015 Win64" ---------------------------------------------------------------------------------- so I can't figure out what am I doing wrong and why there's no lib folder and .dll file in my build directory. Also, -------------------------------------------------------------------- cd python && python setup.py install ----------------------------------------------------------------- the above line doesn't work because of the same Build/lib problem. I've been trying to fix it for 18 hours, but nothings changed. So, any suggestions or comments would be really helpful I'm totally a beginner of github, so please let me know if this is not a right place for asking these kind of trivial questions. Thank you all and sorry for my bad English.
Kurt-Liuhf commented 5 years ago

Hi, @leexamine

After you execute cmake .. -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 14 2015 Win64", you can find a project "thundersvm.sln" under build directory. You can double click it to open it with Visual Studio. Then you should build the solution inside Visual Studio. You can refer to this this link. After you build the project, you should be able to use the python interface. Thanks.

leexamine commented 5 years ago

Thanks a lot @Kurt-Liuhf
Now it works!! I really appreciate it. You save my master degree thesis :-) Have a nice weekend.

BramVanroy commented 4 years ago

Hi, @leexamine

After you execute cmake .. -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 14 2015 Win64", you can find a project "thundersvm.sln" under build directory. You can double click it to open it with Visual Studio. Then you should build the solution inside Visual Studio. You can refer to this this link. After you build the project, you should be able to use the python interface. Thanks.

I think this should be part of the documentation. It's an important required step and not intuitive for those who are not knowledgeable of this stuff.

zeyiwen commented 4 years ago

Thanks. I have updated the documentation. You could also directly contribute to ThunderSVM to further improve the library.