diff --git a/.gitignore b/.gitignore index 8be0f0ba8..a65d8ace6 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ build_xc build.*/ extdep/install extdep/download +/cmake-build-*/ *.pyc diff --git a/.travis.yml b/.travis.yml index a8a2ff771..d81574bbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,20 @@ matrix: include: - os: linux dist: trusty + sudo: required + env: CUDA=ON - os: osx osx_image: xcode8.3 + env: CUDA=OFF cache: - ccache: true directories: - $HOME/.hunter +before_install: + - if [[ "$CUDA" = ON ]]; then source scripts/install-cuda-trusty.sh; fi script: - - cmake -DHUNTER_JOBS_NUMBER=4 -DETHASHCUDA=Off -DETHSTRATUM=On -DETHASHCL=On -H. -Bbuild + - cmake -DHUNTER_JOBS_NUMBER=4 -DETHASHCUDA=$CUDA -DETHSTRATUM=ON -DETHASHCL=ON -H. -Bbuild - cmake --build build - - build/ethminer/ethminer --list-devices -G \ No newline at end of file + - build/ethminer/ethminer --list-devices -G + - build/ethminer/ethminer --list-devices -U + - if [ "$TRAVIS_OS_NAME" = linux ]; then ldd build/ethminer/ethminer; fi + - if [ "$TRAVIS_OS_NAME" = osx ]; then otool -L build/ethminer/ethminer; fi diff --git a/scripts/install-cuda-trusty.sh b/scripts/install-cuda-trusty.sh new file mode 100755 index 000000000..d63a223cb --- /dev/null +++ b/scripts/install-cuda-trusty.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Install the core CUDA toolkit for a ubuntu-trusty (14.04) system. Requires the +# CUDA environment variable to be set to the required version. +# +# Since this script updates environment variables, to execute correctly you must +# 'source' this script, rather than executing it in a sub-process. +# +# Taken from https://github.com/tmcdonell/travis-scripts. + +export CUDA=8.0.61-1 +travis_retry wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_${CUDA}_amd64.deb +travis_retry sudo dpkg -i cuda-repo-ubuntu1404_${CUDA}_amd64.deb +travis_retry sudo apt-get update -qq +export CUDA_APT=${CUDA:0:3} +export CUDA_APT=${CUDA_APT/./-} +travis_retry sudo apt-get install -y cuda-drivers cuda-core-${CUDA_APT} cuda-cudart-dev-${CUDA_APT} cuda-cufft-dev-${CUDA_APT} +travis_retry sudo apt-get clean +export CUDA_HOME=/usr/local/cuda-${CUDA:0:3} +export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} +export PATH=${CUDA_HOME}/bin:${PATH}