Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix azure on windows #388

Merged
merged 19 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ project(gtda_bindings LANGUAGES CXX)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/gtda/externals/pybind11)
set(BINDINGS_DIR "gtda/externals/bindings")

# TO DELETE
set(Boost_DEBUG ON)

SET(Boost_USE_STATIC_LIBS OFF)
IF( WIN32 )
# The auto-linking feature has problems with USE_STATIC_LIBS off, so we use
# BOOST_ALL_NO_LIB to turn it off.
# Several boost libraries headers aren't configured correctly if
# USE_STATIC_LIBS is off, so we explicitly say they are dynamic with the
# remaining definitions.
ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_THREAD_DYN_LINK)
ENDIF()

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

find_package(OpenMP)

Expand Down
4 changes: 2 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
1 change: 1 addition & 0 deletions cmake/HelperBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# The custom path will be at `C:\\local\`
if(WIN32)
list(APPEND BOOST_ROOT "C:/local")
list(APPEND BOOST_ROOT $ENV{BOOST_ROOT_1_72_0})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is just experimentation, but isn't it dangerous to tie ourselves to this particular version (1.72.0)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we only have 2 versions of boost in the pipeline see.

It's necessary to chose one or the other. Or, another option would be to add a shell scripts which can download latest version of boost and put it in a specific folder.

At the moment I could resolve the initial issue, but now the compilation cannot find the boost header files ...
It's really hard to debug like that, if you have any suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point is about these lines being not tied to our Azure set-up. They should work outside of our CI, and hence with arbitrary versions, or am I missing something?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am looking at the log but I can only see a massive amount of warnings and no error in the compilation itself. Did I miss the error?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look for fatal

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, printing the content of boost folder on the pipeline shows that headers are missing (like range.hpp).

I'll ask directly the maintainers of the azure pipelines is there's an issue here or we're missing something.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiousity, was there a problem from azure or was it something else?

list(APPEND BOOST_ROOT "") # Add custom path to your boost installation
endif()

Expand Down
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ def run(self):
if cmake_version < '3.1.0':
raise RuntimeError("CMake >= 3.1.0 is required on Windows")

# TO DELETE
import os
for root, dirs, files in os.walk("C:/hostedtoolcache/windows/Boost/1.72.0/boost"):
for file in files:
if file.endswith(".hpp"):
print(os.path.join(root, file))
exit(-1)

self.install_dependencies()

for ext in self.extensions:
Expand Down