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

Could NOT find Boost (missing: Boost_INCLUDE_DIR headers) #571

Open
T-Maxxx opened this issue Dec 16, 2024 · 0 comments
Open

Could NOT find Boost (missing: Boost_INCLUDE_DIR headers) #571

T-Maxxx opened this issue Dec 16, 2024 · 0 comments

Comments

@T-Maxxx
Copy link

T-Maxxx commented Dec 16, 2024

Expected Behavior

Boost.DI is configured using CMake with custom built Boost.

Actual Behavior

Configuration failed due to Boost module headers not found error.

Steps to Reproduce the Problem

  1. Configure and build Boost 1.84 using CMake. I am using ExternalProject feature:
include(ExternalProject)
ExternalProject_Add(dep_boost
        URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz
        URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95
        CMAKE_ARGS
        -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
        -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
        -DCMAKE_BUILD_TYPE=Release
        -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
        -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
        -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
        -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
        -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
        -DICU_ROOT=${ICU_ROOT}
        -DBOOST_ENABLE_MPI=Off
        -DBOOST_ENABLE_PYTHON=Off
        -DBUILD_TESTING=Off
        -DBUILD_SHARED_LIBS=Off
)

Summary on parameters:

-- [boost] Configuring with:
-- [boost] /home/[REDACTED]/programs/cmake/bin/cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/home/[REDACTED]/programs/clang-13/bin/clang -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_COMPILER=/home/[REDACTED]/programs/clang-13/bin/clang++ -DCMAKE_CXX_FLAGS=-fPIC -stdlib=libc++ -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ -lc++abi -fuse-ld=lld -static-libgcc -DICU_ROOT=/usr/lib/x86_64-linux-gnu -S /home/[REDACTED]/dependencies/boost -B /home/[REDACTED]/boost_build -DCMAKE_INSTALL_PREFIX=/home/[REDACTED]/deps/boost-install
-- [boost] C compiler: /home/[REDACTED]/programs/clang-13/bin/clang
-- [boost] C flags: -fPIC
-- [boost] CXX compiler: /home/[REDACTED]/programs/clang-13/bin/clang++
-- [boost] CXX flags: -fPIC -stdlib=libc++
-- [boost] Link flags: -static-libstdc++ -lc++abi -fuse-ld=lld -static-libgcc
-- [boost] Additional flags: -DICU_ROOT=/usr/lib/x86_64-linux-gnu
  1. Somehow call CMake install target on built Boost and got it's files copied to specified install directory a bit earlier. Let's assume it's "/tmp/my-boost-1.84/"
  2. Add Boost.DI via ExternalProject feature and specify BOOST_ROOT option to let CMake find this custom built Boost:
include(ExternalProject)
ExternalProject_Add(dep-boost-ext-di
      URL https://github.com/boost-ext/di/archive/refs/heads/cpp14.tar.gz
      URL_HASH SHA256=18cbd55a8ac5e8b622a8f33a2a2090a0772de11ed1df7d8b8930bd017bd2eb8e
      CMAKE_ARGS
      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
      -DCMAKE_BUILD_TYPE=Release
      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
      -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
      -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
      -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
      -DBOOST_DI_OPT_BUILD_TESTS=Off
      -DBOOST_DI_OPT_BUILD_EXAMPLES=Off
      -DBOOST_DI_OPT_INSTALL=On
      -DBOOST_ROOT=/tmp/my-boost-1.84/
)

Get error

[ 12%] Performing configure step for 'dep-boost-ext-di'
CMake Warning at /home/[REDACTED]/programs/cmake/share/cmake-3.20/Modules/FindBoost.cmake:2186 (message):
  No header defined for headers; skipping header check (note: header-only
  libraries have no designated component)
Call Stack (most recent call first):
  CMakeLists.txt:23 (find_package)

CMake Error at /home/[REDACTED]/programs/cmake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR headers)

Specifications

  • Version: 1.3.0, cpp14 @ b0f94e2
  • Platform: Ubuntu 22.04, x86_64
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

1 participant