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

Boost header(s) files not found #687

Closed
1 of 5 tasks
MonkeyBreaker opened this issue Apr 7, 2020 · 10 comments
Closed
1 of 5 tasks

Boost header(s) files not found #687

MonkeyBreaker opened this issue Apr 7, 2020 · 10 comments
Assignees
Labels
Area: C/C++ investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows

Comments

@MonkeyBreaker
Copy link

Describe the bug

After updating BOOST_ROOT according to #661 to list(APPEND BOOST_ROOT $ENV{BOOST_ROOT_1_72_0}). CMake finds the this folder:

 - Boost_INCLUDE_DIRS: C:/hostedtoolcache/windows/Boost/1.72.0

The problem is our compilation fails because it cannot find some headers files:

* boost/pending/disjoint_sets.hpp
* boost/function_output_iterator.hpp
* boost/range.hpp

I looked into C:/hostedtoolcache/windows/Boost/1.72.0/boost but the files are not present (starting at line 165 of our pipeline, youll see all the files present in boost folder).

I also tried with 1_69_0 same result.

Do I need to do something special to have access to the previous header files ?

Area for Triage:

Question, Bug, or Feature?:

Bug and question.

Virtual environments affected

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Expected behavior
Build passes succesfully.

Actual behavior
Build fails with boost header files not found.

@miketimofeev miketimofeev added Area: C/C++ investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows and removed Area: Scripting and command line needs triage labels Apr 7, 2020
@al-cheb
Copy link
Contributor

al-cheb commented Apr 7, 2020

Hello, @MonkeyBreaker
These headers are located in {BOOST_ROOT_1_72_0}\include\boost.

@MonkeyBreaker
Copy link
Author

MonkeyBreaker commented Apr 7, 2020

Okay, thank you !

But why after calling find_package(Boost) the variable Boost_INCLUDE_DIRS is set to C:/hostedtoolcache/windows/Boost/1.72.0 ? It should point to the folder containing the headers files, no ? If I understood correctly the documentation.

I would expect it to be: C:/hostedtoolcache/windows/Boost/1.72.0/include

@al-cheb
Copy link
Contributor

al-cheb commented Apr 7, 2020

We use non default path for boost thus, not be found by CMake, you can tell CMake where to look for:

SET (BOOST_ROOT "$ENV{BOOST_ROOT_1_72_0}")
SET (BOOST_INCLUDEDIR "$ENV{BOOST_ROOT_1_72_0}\boost\include")
SET (BOOST_LIBRARYDIR "$ENV{BOOST_ROOT_1_72_0}\lib")

@MonkeyBreaker
Copy link
Author

We could also add them to the .yaml file directly as variables ?
Or would they be overwritten if we call find_package(Boost) ?

@al-cheb
Copy link
Contributor

al-cheb commented Apr 13, 2020

@MonkeyBreaker, any updates?

@MonkeyBreaker
Copy link
Author

I'll look this week for a solution to add the variables into the .yaml file.
As a workaround, we download boost header into a specific location, It's not very efficient, but it works.

As I said before, I'll look for a better solution this week, and post here any updates.

@MonkeyBreaker
Copy link
Author

MonkeyBreaker commented Apr 17, 2020

Hi,

Well after digging this morning on the issue, I did not find any solution with only touching the .yaml file. I'm not an expert on this field, maybe someone else could come with a solution, but I'm won't explore further.

The solution in our case that would not impact other users for the library is to do as follow:

if(DEFINED ENV{BOOST_ROOT_1_72_0})
    file(TO_CMAKE_PATH $ENV{BOOST_ROOT_1_72_0} CMAKE_BOOST_ROOT)
    list(APPEND BOOST_ROOT "$ENV{CMAKE_BOOST_ROOT}")
    list(APPEND BOOST_INCLUDEDIR "$ENV{CMAKE_BOOST_ROOT}/boost/include")
    list(APPEND BOOST_LIBRARYDIR "$ENV{CMAKE_BOOST_ROOT}/lib")
endif()

find_package(Boost ...)

I only have a last remark, could it be possible that you create a "generic" variable to the latest version of boost in the system ? Something around BOOST_ROOT_LATEST, in my opinion, if you update to a newer release in the future, I won't need to update my files to use the latest version in the pipeline.

Have a nice day,
Julián

@al-cheb
Copy link
Contributor

al-cheb commented Apr 20, 2020

Hello, @MonkeyBreaker
Thank you to provide additional info. For my mind it's easier to define a custom BOOST_ROOT_LATEST environment variable in the yaml file.

Documentation: https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables

- name: env
  run: echo "::set-env name=BOOST_ROOT_LATEST::$env:BOOST_ROOT_1_72_0"
- name: echo
  run: $env:BOOST_ROOT_LATEST

@MonkeyBreaker
Copy link
Author

Hello @al-cheb,

I like your solution, if you update on your side, we only need to touch the yaml file.

For me we can close this issue, but I don't know if it's already in the documentation, maybe add more information about the boost include directories, what do you think ?

Otherwise, thank you for your help,
Julián

@maxim-lobanov
Copy link
Contributor

@MonkeyBreaker thank you for your suggestion!
We are planning to add some troubleshooting page for our images to describe such cases. We will add this point there as soon as it is ready.

I am closing this issue for now. Feel free to ping if you have any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C/C++ investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows
Projects
None yet
Development

No branches or pull requests

4 participants