# Building Alembic on Ubuntu : Could NOT find Boost

**URL:** https://discourse.cmake.org/t/building-alembic-on-ubuntu-could-not-find-boost/1986
**Category:** Usage
**Tags:** os:linux
**Created:** [October 10, 2020, 5:34pm UTC](https://discourse.cmake.org/t/building-alembic-on-ubuntu-could-not-find-boost/1986 "2020-10-10T17:34:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![johhnry](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/ebca7d/32.png) [@johhnry](https://discourse.cmake.org/u/johhnry)
#### Post date: [October 10, 2020, 5:34pm UTC](https://discourse.cmake.org/t/building-alembic-on-ubuntu-could-not-find-boost/1986/1 "2020-10-10T17:34:25Z")

</div>

Hi,

I am trying to build the [Alembic project](https://github.com/alembic/alembic) which uses the [FindBoost module](https://cmake.org/cmake/help/latest/module/FindBoost.html) 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 :

```cmake
#- ******************************************************************************
# 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 :

```auto
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

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [October 11, 2020, 11:50am UTC](https://discourse.cmake.org/t/building-alembic-on-ubuntu-could-not-find-boost/1986/2 "2020-10-11T11:50:12Z")

</div>

`(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](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:

> <https://github.com/alembic/alembic/blob/d166c85a7182bc039d6989f3880ed8c6943569b7/.github/actions/build-manylinux/build_alembic.sh#L25-L29>

---

<div class="post-metadata">

### Author: ![johhnry](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/ebca7d/32.png) [@johhnry](https://discourse.cmake.org/u/johhnry)
#### Post date: [October 11, 2020, 9:56pm UTC](https://discourse.cmake.org/t/building-alembic-on-ubuntu-could-not-find-boost/1986/3 "2020-10-11T21:56:47Z")

</div>

Hi,

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

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](https://github.com/alembic/alembic/issues/318)
