Skip to content

Commit

Permalink
Fix azure on windows (#388)
Browse files Browse the repository at this point in the history
* Update ccache

* Update variable used to indicate boost headers location

Official answer from boost devs: https://discourse.cmake.org/t/findboost-difference-between-boost-include-dir-and-boost-include-dirs/855

* Add install boost step in Azure CI, which downloads boost

Signed-off-by: julian <[email protected]>
  • Loading branch information
reds-heig authored Apr 7, 2020
1 parent 805e912 commit e2aaea9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .azure-ci/install_boost.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python

import os
from pathlib import Path
import urllib.request
import shutil
import zipfile


url = "https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.zip"
boost_folder = r"C:\local"

Path(boost_folder).mkdir(parents=True, exist_ok=True)
zip_file = os.path.join(boost_folder, "1_72_0.zip")

with urllib.request.urlopen(url) as response, \
open(zip_file, 'wb') as out_file:
shutil.copyfileobj(response, out_file)

with zipfile.ZipFile(zip_file, 'r') as zip_ref:
zip_ref.extractall(boost_folder)

os.remove(zip_file)
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/gtda/externals/pybind11)
set(BINDINGS_DIR "gtda/externals/bindings")

include(cmake/HelperBoost.cmake)
include_directories(${Boost_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIRS})

find_package(OpenMP)

Expand Down
8 changes: 6 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- task: Cache@2
inputs:
key: '"ccache-wheels-v2020.03.23" | $(Agent.OS) | "$(python.version)"'
key: '"ccache-wheels-v2020.04.07" | $(Agent.OS) | "$(python.version)"'
path: $(CCACHE_DIR)
displayName: ccache

Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
- task: Cache@2
inputs:
key: '"ccache-v2020.03.23" | $(Agent.OS) | "$(python.version)"'
key: '"ccache-v2020.04.07" | $(Agent.OS) | "$(python.version)"'
path: $(CCACHE_DIR)
displayName: ccache

Expand Down Expand Up @@ -246,6 +246,10 @@ jobs:
condition: eq(variables['nightly_check'], 'true')
displayName: 'Change name to giotto-tda-nightly'
- script: |
python .azure-ci/install_boost.py || exit /b
displayName: 'Install boost'
- script: |
python -m pip install --upgrade pip setuptools
python -m pip install -e ".[dev]"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
URL = 'https://github.com/giotto-ai/giotto-tda'
LICENSE = 'GNU AGPLv3'
DOWNLOAD_URL = 'https://github.com/giotto-ai/giotto-tda/tarball/v0.2.0'
VERSION = __version__ # noqa
VERSION = __version__ # noqa
CLASSIFIERS = ['Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved',
Expand Down

0 comments on commit e2aaea9

Please sign in to comment.