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

CMakeLists.txt as written will not find Boost headers with old policy in recent Boost/CMake versions #1384

Closed
cr1901 opened this issue Oct 19, 2024 · 0 comments · Fixed by #1387

Comments

@cr1901
Copy link
Contributor

cr1901 commented Oct 19, 2024

I upgraded CMake and Boost today to 3.30.5 and 1.86.0 respectively. Attempting to build with my normal cmake command line results in errors of the following (Windows 10/msys2, assume this applies to other systems):

-- The CXX compiler identification is GNU 14.2.0
-- The C compiler identification is GNU 14.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Building without IPO
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAS_Wno-unused-parameter
-- Performing Test HAS_Wno-unused-parameter - Success
-- Performing Test HAS_Wno-missing-field-initializers
-- Performing Test HAS_Wno-missing-field-initializers - Success
-- Performing Test HAS_Wno-array-bounds
-- Performing Test HAS_Wno-array-bounds - Success
-- Performing Test HAS_Wno-format-truncation
-- Performing Test HAS_Wno-format-truncation - Success
-- Found Python3: C:/msys64/usr/bin/python3.12.exe (found suitable version "3.12.7", minimum required is "3.5") found components: Inter

preter
-- Found Python3: C:/msys64/mingw64/lib/libpython3.11.dll.a (found suitable version "3.11.10", minimum required is "3.5") found compone

nts: Development Development.Module Development.Embed
CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Warning at C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1414 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:1539 (_Boost_COMPONENT_DEPENDENCIES)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2151 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:204 (find_package)


CMake Error at C:/msys64/mingw64/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Boost (missing: system) (found version "1.86.0")
Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  C:/msys64/mingw64/share/cmake/Modules/FindBoost.cmake:2409 (find_package_handle_standard_args)
  CMakeLists.txt:204 (find_package)


-- Configuring incomplete, errors occurred!

It seems that:

  1. Since Boost 1.69 system is a header-only library.
  2. Cmake is transitioning to using Boost's upstream CMake config file instead of using a CMake-provided FindBoost.
  3. CMake's FindBoost doesn't know about version 1.86.0.

And the above three combine such that Boost 1.86.0 Just Plain Fails to compile when used with FindBoost.

In my case, compiling with -DCMAKE_POLICY_DEFAULT_CMP0167=NEW fixes the problem, and seemingly bypasses nextpnr's reliance on the old behavior. I'm not sure how upstream wants to handle this, so I'm just filing an issue with info as opposed to submitting an opinionated PR :P.

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

Successfully merging a pull request may close this issue.

1 participant