Building Alembic on Ubuntu : Could NOT find Boost

Hi,

I am trying to build the Alembic project which uses the FindBoost module to check if boost python is installed.

The code responsible for doing that is in the alembic/cmake/AlembicBoost.cmake file which does the following :

#-******************************************************************************
# Find static and multi-threaded versions only (1.42.0+)
#-******************************************************************************

SET(Boost_USE_STATIC_LIBS ${USE_STATIC_BOOST})
SET(Boost_NO_BOOST_CMAKE ON)

# disables linking to -mt variants on osx
IF (USE_PYALEMBIC AND APPLE)
    SET(Boost_USE_MULTITHREADED OFF)
ENDIF()

IF (USE_PYALEMBIC)
    FIND_PACKAGE(Boost 1.42.0 COMPONENTS program_options python)
ELSE()
    FIND_PACKAGE(Boost 1.42.0 COMPONENTS program_options)
ENDIF()

I want to compile python libraries so I use the USE_PYALEMBIC flag.

However, this is the error message when I run cmake :

alembic/build $ cmake -DLIBPYTHON_VER
SION=2.7 -DUSE_PYALEMBIC=ON -DALEMBIC_PYILMBASE_INCLUDE_DIRECTORY=/usr/local/include/OpenEXR -DALEMBIC_PY
ILMBASE_PYIMATH_LIB=/usr/local/lib/libPyImath_Python3_8-2_5.so -DILMBASE_INCLUDE_DIR=/usr/local/include/O
penEXR -DBOOST_INCLUDEDIR=/usr/include -DBOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu -DUSE_STATIC_BOOST=OF
F ..
-- CMAKE SYSTEM NAME: Linux
-- The install dir is /usr/local
-- Using BOOST_INCLUDEDIR: /usr/include
-- Using BOOST_LIBRARYDIR: /usr/lib/x86_64-linux-gnu
-- Could NOT find Boost (missing: python) (found suitable version "1.71.0", minimum required is "1.42.0")
CMake Error at cmake/AlembicBoost.cmake:98 (MESSAGE):
  Boost not found.
Call Stack (most recent call first):
  CMakeLists.txt:226 (INCLUDE)


-- Configuring incomplete, errors occurred!
See also "alembic/build/CMakeFiles/CMakeOutput.log".
See also "alembic/build/CMakeFiles/CMakeError.log".

So boost 1.71.0 is found but it doesn’t correspond to the minimum version 1.42.0, does it really make sense?

In fact this is the libraries that are installed on my system :

  • OS: Pop!_OS 20.04 Linux pop-os 5.4.0-7642-generic
  • cmake: version 3.16.3
  • libboost-all-dev: 1.71.0.0ubuntu2
  • libboost-python-dev: 1.71.0.0ubuntu2
  • libboost-python1.71-dev: 1.71.0-6ubuntu6
  • libboost-python1.67-dev: 1.67.0-17ubuntu8

Can someone help me with this?

Thanks

(found suitable version "1.71.0", minimum required is "1.42.0") is not the issue, the issue is (missing: python). That’s because there is no such component in Boost 1.71.0.

From https://cmake.org/cmake/help/v3.16/module/FindBoost.html

Note that Boost Python components require a Python version suffix (Boost 1.67 and later), e.g. python36 or python27 for the versions built against Python 3.6 and 2.7, respectively.

Unless you are comfortable with changing alembic/cmake/AlembicBoost.cmake, your best option seems to be using a version of Boost that is older than 1.67.

The Alembic project currently uses Boost 1.55 on CI:

1 Like

Hi,

Thank you very much for your answer, next time I have a build problem I’ll look at the CI scripts! :wink:

I managed to compile it using Boost 1.55.

For more information, there is the original GitHub issue : https://github.com/alembic/alembic/issues/318

1 Like