Skip to content

System boost 1.70+ preferred over spack boost < 1.70 when using cmake #20169

@haampie

Description

@haampie

Steps to reproduce the issue

$ apt-get install libboost1.71-all-dev
$ spack install -v range-v3 %gcc@:9 +examples cxxstd=14 ^[email protected]
...

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.59.0") found components: date_time program_options 

Information on your system

  • Spack: 0.16.0-102-623caf85a9
  • Python: 3.8.6
  • Platform: linux-ubuntu20.04-zen2
  • Concretizer: clingo

Following https://cmake.org/cmake/help/latest/module/FindBoost.html#boost-cmake I've tried to fix this by adding this to boost/package.py:

    def setup_dependent_build_environment(self, env, dependent_spec):
        if '^cmake' in dependent_spec and '^boost@:1.69' in dependent_spec:
            env.set('Boost_NO_BOOST_CMAKE', 'ON')

but this does not work, you really need to specify cmake -DBoost_NO_BOOST_CMAKE=ON on the command line, which is currently awkward from the parent package.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions