Skip to content

Commit

Permalink
Merge pull request #179 from shijiashuai/auto-release
Browse files Browse the repository at this point in the history
update travis #176
  • Loading branch information
shijiashuai committed Nov 17, 2019
2 parents d38af58 + 13fd32a commit 022de7c
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
dataset/*
!dataset/*.sh
!dataset/test_dataset.txt
!scripts/*.sh
html
latex
logs
Expand Down
78 changes: 67 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,67 @@
branches:
only: master
language: cpp
compiler:
- gcc
before_script:
- sudo apt-get install libeigen3-dev
- mkdir build
- cd build
- cmake -DUSE_CUDA=OFF -DUSE_EIGEN=ON -DBUILD_TESTS=ON ..
script: cmake --build . --target runtest
jobs:
include:
- name: ubuntu-cuda8.0
env:
- CUDA=8.0.61-1
- CUDA_SHORT=8.0
- UBUNTU_VERSION=ubuntu1604
- BUILD_TAG=-cuda8.0
dist: xenial
language: python
before_deploy:
- ./scripts/build_gpu_wheel.sh
- name: ubuntu-cuda9.2
env:
- CUDA=9.2.148-1
- CUDA_SHORT=9.2
- UBUNTU_VERSION=ubuntu1604
- BUILD_TAG=-cuda9.2
dist: xenial
language: python
before_deploy:
- ./scripts/build_gpu_wheel.sh
- name: ubuntu-cuda10.1
env:
- CUDA=10.1.105-1
- CUDA_SHORT=10.1
- UBUNTU_VERSION=ubuntu1804
- BUILD_TAG=-cuda10.1
dist: bionic
language: python
before_deploy:
- ./scripts/build_gpu_wheel.sh
- name: windows-cuda10.1
os: windows
language: bash
env:
- MSBUILD_PATH="/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin"
- PATH=/c/Python36:/c/Python36/Scripts:$PATH
- BUILD_TAG=-cuda10.1
before_deploy:
- ./scripts/build_gpu_wheel.sh
- name: ubuntu-cpu
env:
- BUILD_TAG=-cpu
dist: bionic
language: python
before_deploy:
- ./scripts/build_cpu_wheel.sh
- name: windows-cpu
os: windows
language: bash
env:
- MSBUILD_PATH="/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin"
- PATH=/c/Python36:/c/Python36/Scripts:$PATH
- BUILD_TAG=-cpu
before_deploy:
- ./scripts/build_cpu_wheel.sh
script:
- ./scripts/build_cputest.sh
deploy:
provider: releases
api_key: ${GITHUB_API_TOKEN}
file: "python/dist/*"
file_glob: true
skip_cleanup: true
on:
tags: true
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
55 changes: 33 additions & 22 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,45 @@
import setuptools
from shutil import copyfile
from sys import platform
import os


from wheel.bdist_wheel import bdist_wheel as _bdist_wheel


class bdist_wheel(_bdist_wheel):
def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False

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'))
else :
raise EnvironmentError("OS not supported!")
lib_path = path.abspath(path.join(dirname, '../build/lib/libthundersvm.dylib'))
else:
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="0.3.3",
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_content_type="text/plain",
url="https://github.com/zeyiwen/thundersvm",
package_data = {"thundersvm": [path.basename(lib_path)]},
install_requires=['numpy','scipy','scikit-learn'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
],
python_requires=">=3"
)
copyfile(lib_path, path.join(dirname, "thundersvm", path.basename(lib_path)))
setuptools.setup(name="thundersvm" + os.environ['BUILD_TAG'],
version="0.3.3",
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_content_type="text/plain",
url="https://github.com/zeyiwen/thundersvm",
package_data={"thundersvm": [path.basename(lib_path)]},
setup_requires=['wheel'],
install_requires=['numpy', 'scipy', 'scikit-learn'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
],
python_requires=">=3",
cmdclass={'bdist_wheel': bdist_wheel},
)
25 changes: 25 additions & 0 deletions scripts/build_cpu_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -x

mkdir build
cd build

case ${TRAVIS_OS_NAME} in
linux)
cmake -DUSE_CUDA=OFF -DUSE_EIGEN=ON ..
;;
osx)
;;
windows)
export PATH=${MSBUILD_PATH}:$PATH
cmake -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -DUSE_CUDA=OFF -DUSE_EIGEN=ON -G "Visual Studio 14 2015 Win64" ..
choco install python --version=3.6.3
python -m pip install --upgrade pip
pip install wheel
;;
esac

cmake --build .
cd ../python
python setup.py bdist_wheel
20 changes: 20 additions & 0 deletions scripts/build_cputest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -x

mkdir build_cputest
cd build_cputest

case ${TRAVIS_OS_NAME} in
linux)
cmake -DBUILD_TESTS=ON -DUSE_CUDA=OFF -DUSE_EIGEN=ON ..
;;
osx)
;;
windows)
export PATH=${MSBUILD_PATH}:$PATH
cmake -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -DUSE_CUDA=OFF -DUSE_EIGEN=ON -DBUILD_TESTS=ON -G "Visual Studio 14 2015 Win64" ..
;;
esac

cmake --build . --target runtest
38 changes: 38 additions & 0 deletions scripts/build_gpu_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -x

mkdir build
cd build

case ${TRAVIS_OS_NAME} in
linux)
INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb
wget -q http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER}
sudo dpkg -i ${INSTALLER}
wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub
sudo apt-key add 7fa2af80.pub
sudo apt update -qq
sudo apt install -y cuda-core-${CUDA_SHORT/./-} cuda-cudart-dev-${CUDA_SHORT/./-} cuda-cusparse-dev-${CUDA_SHORT/./-}
sudo apt clean
export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
export PATH=${CUDA_HOME}/bin:${PATH}
cmake ..
;;
osx)
;;
windows)
wget -q http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe
./cuda_10.1.243_426.00_win10.exe -s nvcc_10.1 cusparse_dev_10.1
export PATH=${MSBUILD_PATH}:$PATH
cmake -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -DCUDA_TOOLKIT_ROOT_DIR="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1" -G "Visual Studio 14 2015 Win64" ..
choco install python --version=3.6.3
python -m pip install --upgrade pip
pip install wheel
;;
esac

cmake --build .
cd ../python
python setup.py bdist_wheel

0 comments on commit 022de7c

Please sign in to comment.