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

CMake cannot find Boost (Windows 10) #267

Open
Lotte1990 opened this issue Apr 30, 2020 · 3 comments
Open

CMake cannot find Boost (Windows 10) #267

Lotte1990 opened this issue Apr 30, 2020 · 3 comments

Comments

@Lotte1990
Copy link

I have the prebuilt binaries installed and set the environment variable BOOST_ROOT.

Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
The CXX compiler identification is MSVC 19.25.28614.0
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Found triSYCL include directory: D:/Test/triSYCL-master/include
Found OpenMP_CXX: -openmp (found version "2.0") 
Found OpenMP: TRUE (found version "2.0")  
CMake Warning (dev) at cmake/FindTriSYCL.cmake:227 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Environment variable Boost_ROOT is set to:

    C:\boost_1_58_0

  For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
  CMakeLists.txt:13 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

Looking for C++ include pthread.h
Looking for C++ include pthread.h - not found
Found Threads: TRUE  
CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Boost (missing: chrono log) (found suitable version
  "1.58.0", minimum required is "1.58")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.17/Modules/FindBoost.cmake:2145 (find_package_handle_standard_args)
  cmake/FindTriSYCL.cmake:227 (find_package)
  CMakeLists.txt:13 (include)


Configuring incomplete, errors occurred!
See also "D:/Test/triSYCL-master-build/CMakeFiles/CMakeOutput.log".
See also "D:/Test/triSYCL-master-build/CMakeFiles/CMakeError.log".

What am I doing wrong?

@Lotte1990
Copy link
Author

Ok, so I fixed this error by adding the following lines to my project's CMakeLists.txt.

externalproject_add(boost URL https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.zip CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "")
externalproject_get_property(boost SOURCE_DIR)
set(srcdir_boost ${SOURCE_DIR})
include_directories(${srcdir_boost})

I now get a new error, but I will open a new issue for that one. You can close this issue.

@MathiasMagnus
Copy link
Contributor

Boost is a particularly nasty library to depend on, hence I try to avoid it whenever possible. (The build process is a nightmare, but even if one consumes it from a package manager, it is the only library I know of that chose to have different CMake variable names for their find module and package config scripts.)

I would advise using a package manager to consume Boost rather than pulling it in as an external dependency. On Windows I would advise using Vcpkg. One can build latest Boost issuing the following:

vcpkg.exe install boost-chrono boost-log boost-filesystem boost-multi-array boost-test boost-circular-buffer

@MathiasMagnus
Copy link
Contributor

Given a try building using MSVC, I'm getting compilation errors (which is expected, as there is no CI for it). Consuming Boost passes (with hoardes of CMake warnings originating from FindBoost.cmake due to using a too new version of Boost), but I don't have the capacity to test using building Clang.

FWIW, MSVC chokes on the noinline attribute.

template <typename KernelName,
          typename Functor>
__attribute__((noinline)) void
instantiate_kernel(Functor f) noexcept {
  /* The outlining compiler is expected to do some massage here or
     around and to insert some calls to \c serialize_arg and so on */
  f();
}

resulting in

[build] C:\Users\mnagy\Source\Repos\triSYCL\include\triSYCL/detail/instantiate_kernel.hpp(50): error C2988: unrecognizable template declaration/definition

Until there is no CI in place, these errors are bound to happen. Unfortunately I do not have the capacity to implement Azure Devops CI pipelines. (It's got infinite CPU hours for CI/CD purposes of OSS libraries, it just takes someone to wire it up (and actual commitment from developers to fix regressions and not allow pipelines to fail). Supporting Windows through Clang only may be a smaller commitment, but that is a different subject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants