Skip to content

Commit

Permalink
[Windows] use clcache when building on appveyor
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed Mar 6, 2018
1 parent 3918546 commit 0157b28
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
24 changes: 11 additions & 13 deletions appveyor.yml
@@ -1,13 +1,14 @@
version: "{build}"

cache:
- C:\Users\Appveyor\clcache

environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
VSVER: Visual Studio 14 2015 Win64
PYTHON: "C:\\Python27"
# disable multiple builds until each build takes more than 30 minutes
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# VSVER: Visual Studio 15 2017 Win64
PYTHON: "3.6"
APPVEYOR_SAVE_CACHE_ON_ERROR: true

platform:
- x64
Expand All @@ -16,25 +17,22 @@ configuration:
- Release

install:
- set MINICONDA=C:\Miniconda36-x64
- set PATH=%MINICONDA%;%MINICONDA%/Scripts;%MINICONDA%/Library/bin;%PATH%
- call scripts\appveyor-setup.bat
- git submodule -q update --init

before_build:
- md %APPVEYOR_BUILD_FOLDER%\build
- cd %APPVEYOR_BUILD_FOLDER%\build
- cmake -G"%VSVER%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_META_EXAMPLES=OFF -DENABLE_TESTING=ON ..

build:
verbosity: minimal

# TODO: fix cmake script in order that building examples
# triggers the build of shogun-static.vcxproj
build_script:
- msbuild src\shogun\libshogun.vcxproj
- msbuild src\shogun\shogun.vcxproj
- msbuild src\shogun\shogun-static.vcxproj
- msbuild shogun.sln
- call scripts\msvc-build.bat

test_script:
- cd %APPVEYOR_BUILD_FOLDER%\build
- ctest --output-on-failure -C %CONFIGURATION%

after_build:
- clcache -s
23 changes: 23 additions & 0 deletions scripts/appveyor-setup.bat
@@ -0,0 +1,23 @@
@echo on

conda update -y -q conda
conda config --set auto_update_conda false
conda info -a

conda config --set show_channel_urls True

@rem Help with SSL timeouts to S3
conda config --set remote_connect_timeout_secs 12

conda config --add channels https://repo.continuum.io/pkgs/free
conda config --add channels conda-forge
conda info -a

@rem Use clcache for faster builds
pip install -q git+https://github.com/frerich/clcache.git
clcache -s
set CC=clcache
set CXX=clcache
set CLCACHE_SERVER=1
set CLCACHE_HARDLINK=1
powershell.exe -Command "Start-Process clcache-server"
16 changes: 16 additions & 0 deletions scripts/msvc-build.bat
@@ -0,0 +1,16 @@
@echo on

conda create -n shogun -q -y python=%PYTHON% ^
setuptools numpy scipy eigen ^
cmake snappy zlib ctags ply jinja2
call activate shogun

mkdir %APPVEYOR_BUILD_FOLDER%\build
pushd %APPVEYOR_BUILD_FOLDER%\build

cmake -G "%VSVER%" ^
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DENABLE_TESTING=ON .. || exit /B

cmake --build . --target install --config %CONFIGURATION% || exit /B

0 comments on commit 0157b28

Please sign in to comment.