cmake find_package(Boost) failed to find boost_math_c99

59 Views Asked by At

I am trying to build software with Boost 1.84 on RedHat 8 using the following CMake command (which works for Boost 1.71)

FIND_PACKAGE(
  Boost CONFIG 1.84.0 REQUIRED 
  COMPONENTS 
    program_options 
    system 
    regex
    math_c99 
    math_c99f
    math_c99l
    date_time 
    chrono 
    filesystem 
    system 
    thread)

Output is

CMake Error at /tmp/tools/boost1.84/rhel85_gcc/lib/cmake/boost_math_c99-1.84.0/
boost_math_c99-config.cmake but it set boost_math_c99_FOUND to FALSE so package 
"boost_math_c99" is considered to be NOT FOUND. 

So I looked at the boost_math_c99-config.cmake file and notice that it tries to GLOB for files using the "libboost_math_c99-variant*.cmake" pattern but there are no such files in that folder. So checking a bit more and found that the following components contains a "variant" file:

  • program_options
  • chrono
  • date_time
  • filesystem
  • regex
  • system
  • thread

The following components do not contain a "variant" file:

  • math_c99
  • math_c99f
  • math_c99l

So I checked the Boost 1.84 built using VS2022 and the lib/cmake/boost_math_c99-1.84.0 folder contained two "variant" files named

  • libboost_mathc99-variant-vc143-mt-x64-1_84-shared.cmake
  • libboost_mathc99-variant-vc143-mt-gd-x64-1_84-shared.cmake

So I am thinking there is something off with the boost built on Redhat. Here are the build commands used on Redhat:

./bootstrap.sh --with-toolset=gcc --prefix=/tmp/boost_1.84
./b2 --build-dir=/tmp/boost_1.84_stage toolset=gcc variant=release link=shared threading=multi runtime-link=shared address-model=64 stage install

What am I doing wrong?

0

There are 0 best solutions below