Skip to content

Commit

Permalink
support "pip install"
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahuanluo committed Apr 10, 2019
1 parent 5946a70 commit abe6257
Show file tree
Hide file tree
Showing 4 changed files with 528 additions and 17 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ The mission of ThunderSVM is to help users easily and efficiently apply SVMs to
If you want to use GPUs, you also need to install CUDA.

* [CUDA](https://developer.nvidia.com/cuda-downloads) 7.5 or above
### Quick Install
#### For Linux with CUDA 9.0
```bash
pip3 install thundersvm
```
##### Example
```python
from thundersvm import SVC
clf = SVC()
clf.fit(x, y)
```
### Download
```bash
git clone https://github.com/zeyiwen/thundersvm.git
Expand Down
32 changes: 15 additions & 17 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,29 @@
dirname = path.dirname(path.abspath(__file__))

if platform == "linux" or platform == "linux2":
lib_path = path.abspath(path.join(dirname, '../build/lib/libthundersvm.so'))
lib_path = path.abspath(path.join(dirname, '../build/lib/libthundersvm.so'))
elif platform == "win32":
lib_path = path.abspath(path.join(dirname, '../build/bin/Debug/thundersvm.dll'))
lib_path = path.abspath(path.join(dirname, '../build/bin/Debug/thundersvm.dll'))
elif platform == "darwin":
lib_path = path.abspath(path.join(dirname, '../build/lib/libthundersvm.dylib'))
lib_path = path.abspath(path.join(dirname, '../build/lib/libthundersvm.dylib'))
else :
print ("OS not supported!")
exit()

copyfile(lib_path, path.join(dirname, path.basename(lib_path)))
raise EnvironmentError("OS not supported!")

if not path.exists(path.join(dirname, "thundersvm", path.basename(lib_path))):
copyfile(lib_path, path.join(dirname, "thundersvm", path.basename(lib_path)))
setuptools.setup(name="thundersvm",
version="github-master",
version="0.0.2",
packages=["thundersvm"],
package_dir={"python": "thundersvm"},
description="A Fast SVM Library on GPUs and CPUs",
long_description="""The mission of ThunderSVM is to help users easily and efficiently
apply SVMs to solve problems. ThunderSVM exploits GPUs and multi-core CPUs to achieve
high efficiency""",
long_description="The mission of ThunderSVM is to help users easily and efficiently apply SVMs to solve problems. ThunderSVM exploits GPUs and multi-core CPUs to achieve high efficiency",
long_description_content_type="text/plain",
url="https://github.com/zeyiwen/thundersvm",
py_modules=["svm", "thundersvmScikit"],
data_files = [('', [path.basename(lib_path)])],
package_data = {"thundersvm": [path.basename(lib_path)]},
install_requires=['numpy','scipy','scikit-learn'],
classifiers=(
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
),
)
],
python_requires=">=3"
)
12 changes: 12 additions & 0 deletions python/thundersvm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python3
# -*-coding:utf-8-*-
"""
* Copyright (C) 2018 OwnThink.
*
* Name : __init__.py
* Author : Locke <luojiahuan001@gmail.com>
* Version : 0.0.1
* Description :
"""
name = "thundersvm"
from .thundersvmScikit import *

0 comments on commit abe6257

Please sign in to comment.