diff options
author | bartus | 2019-09-08 11:03:30 +0200 |
---|---|---|
committer | bartus | 2019-09-08 11:03:30 +0200 |
commit | eb76757bd8cfb6eef9f86049c4b59d850ed76eec (patch) | |
tree | 618032f78c99d4127d7ad63e54ce332caa786fc8 | |
parent | 2974e61d9baa3d1ce42c0150fba95ec6207ce4c7 (diff) | |
download | aur-eb76757bd8cfb6eef9f86049c4b59d850ed76eec.tar.gz |
ccache/Travis: use nvcc-ccache provided in ccache-ext.
-rw-r--r-- | .travis.yml | 14 | ||||
-rw-r--r-- | PKGBUILD | 4 |
2 files changed, 7 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml index 647d2ca55a1d..dd5194e77b6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,10 @@ arch: - bartus=https://github.com/bartoszek/AUR-repo/raw/master packages: - ccache - - moreutils + - ccache-ext +# cuda need to be installed before `makepkg` invocation in order to allow nvcc-ccache logic to work. - cuda + - moreutils before_install: # 1.Override `package-cleanup.hook` to preserve cache for travis. # 2.Enable ccache @@ -41,16 +43,6 @@ arch: sudo sed -i '$a CFLAGS="$CFLAGS -w"' /etc/makepkg.conf sudo sed -i '$a CXXFLAGS="$CXXFLAGS -w"' /etc/makepkg.conf script: -# Incorporate ccache in nvcc - - | - _gcc="$(readlink /opt/cuda/bin/gcc)" - _gpp="$(readlink /opt/cuda/bin/g++)" - sudo mv /opt/cuda/bin/nvcc /opt/cuda/bin/nvcc.bin - sudo rm /opt/cuda/bin/g{cc,++} - echo -e "#!/bin/sh -\n/usr/bin/ccache /opt/cuda/bin/nvcc.bin \"\$@\"" | sudo dd of=/opt/cuda/bin/nvcc status=none - echo -e "#!/bin/sh -\n/usr/bin/ccache $_gcc \"\$@\"" | sudo dd of=/opt/cuda/bin/gcc status=none - echo -e "#!/bin/sh -\n/usr/bin/ccache $_gpp \"\$@\"" | sudo dd of=/opt/cuda/bin/g++ status=none - sudo chmod +x /opt/cuda/bin/{nvcc,g{cc,++}} # Normalize TRAVIS variable - | [ "$TRAVIS" == "true" ] && TRAVIS=1 || TRAVIS=0 @@ -73,6 +73,10 @@ build() { if [ -v _cuda_capability ]; then _EXTRAOPTS+=(-DCYCLES_CUDA_BINARIES_ARCH=$(IFS=';'; echo "${_cuda_capability[*]}";)) fi + [ -f "/usr/lib/ccache/bin/nvcc-ccache" ] && _CMAKE_FLAGS+=( -DCUDA_NVCC_EXECUTABLE=/usr/lib/ccache/bin/nvcc-ccache ) + if _cuda_gcc=$(basename $(readlink /opt/cuda/bin/gcc)) ; then + [ -L "/usr/lib/ccache/bin/$_cuda_gcc" ] && _CMAKE_FLAGS+=( -DCUDA_HOST_COMPILER=/usr/lib/ccache/bin/$_cuda_gcc ) + fi fi ((DISABLE_NINJA)) && generator="Unix Makefiles" || generator="Ninja" |