Skip to content

Support newer BOOST & g++ when building CGAL-4.7 #120

@mlouielu

Description

@mlouielu

When building with newer BOOST and g++ against GCAL-4.7, several error messages shown:

  error: subprocess-exited-with-error
  
  × Building wheel for psbody-mesh (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [400 lines of output]
      [VERSION] read version is 0.4
      /tmp/pip-build-env-4pgkxbtd/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      /tmp/pip-build-env-4pgkxbtd/overlay/lib/python3.11/site-packages/setuptools/dist.py:804: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
      !!
      
              ********************************************************************************
              Please replace its usage with implicit namespaces (PEP 420).
      
              See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
              ********************************************************************************
      
      !!
        ep.load()(self, ep.name, value)
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-311/psbody
      copying psbody-mesh-namespace/__init__.py -> build/lib.linux-x86_64-cpython-311/psbody
      creating build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/version.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/utils.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/texture.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/sphere.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/search.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/processing.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/meshviewer.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/mesh.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/lines.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/landmarks.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/fonts.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/errors.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/colors.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/arcball.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      copying mesh/__init__.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh
      creating build/lib.linux-x86_64-cpython-311/psbody/mesh/topology
      copying mesh/topology/subdivision.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/topology
      copying mesh/topology/linear_mesh_transform.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/topology
      copying mesh/topology/decimation.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/topology
      copying mesh/topology/connectivity.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/topology
      copying mesh/topology/__init__.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/topology
      creating build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      copying mesh/geometry/vert_normals.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      copying mesh/geometry/triangle_area.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      copying mesh/geometry/tri_normals.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      copying mesh/geometry/rodrigues.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      copying mesh/geometry/cross_product.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      copying mesh/geometry/barycentric_coordinates_of_projection.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      copying mesh/geometry/__init__.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/geometry
      creating build/lib.linux-x86_64-cpython-311/psbody/mesh/serialization
      copying mesh/serialization/serialization.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/serialization
      copying mesh/serialization/__init__.py -> build/lib.linux-x86_64-cpython-311/psbody/mesh/serialization
      running build_ext
      [CGAL] deflating cgal from "mesh/thirdparty/CGAL-4.7.tar.gz" to "/tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311"
      building 'psbody.mesh.aabb_normals' extension
      creating build/temp.linux-x86_64-cpython-311/mesh/src
      g++-11 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNDEBUG=1 -DCGAL_NDEBUG=1 -DMESH_CGAL_AVOID_COMPILED_VERSION=1 -DCGAL_HAS_NO_THREADS=1 -DCGAL_NO_AUTOLINK_CGAL=1 -Imesh/src -I/tmp/pip-build-env-4pgkxbtd/normal/lib/python3.11/site-packages/numpy/_core/include -I/tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include -I/home/louie/.pyenv/versions/3.11.5/include/python3.11 -c mesh/src/aabb_normals.cpp -o build/temp.linux-x86_64-cpython-311/mesh/src/aabb_normals.o -O3 -fopenmp
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/double.h:30,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/number_type_basic.h:60,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/basic.h:44,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian_converter.h:34,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_node.h:25,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h:24,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/AABB_tree.h:26,
                       from mesh/src/AABB_n_tree.h:9,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/number_utils.h:206:22: error: ‘if_c’ in namespace ‘boost::mpl’ does not name a template type
        206 | typename boost::mpl::if_c<
            |                      ^~~~
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/number_utils.h:206:26: error: expected unqualified-id before ‘<’ token
        206 | typename boost::mpl::if_c<
            |                          ^
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Circle_2_Circle_2_intersection.h:29,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersection_2_3.h:30,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersection_2.h:32,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersections.h:45,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_node.h:26,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h:24,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/AABB_tree.h:26,
                       from mesh/src/AABB_n_tree.h:9,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Circle_2.h: In member function ‘typename CGAL::Circle_2<R_>::R::Boolean CGAL::Circle_2<R_>::is_degenerate() const’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Circle_2.h:167:21: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        167 |     return CGAL_NTS is_zero(squared_radius());
            |                     ^~~~~~~
            |                     Is_zero
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Conic_2.h:30,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/user_classes.h:38,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/squared_distance_2_1.h:31,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Circle_2_Circle_2_intersection.h:30,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersection_2_3.h:30,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersection_2.h:32,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersections.h:45,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_node.h:26,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h:24,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/AABB_tree.h:26,
                       from mesh/src/AABB_n_tree.h:9,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Conic_misc.h: In function ‘NT CGAL::best_value(NT*, int, NT, NT, NT, NT, NT, NT, NT)’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Conic_misc.h:71:52: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
         71 |         if (CGAL_NTS is_positive(det) && !CGAL_NTS is_zero(q))
            |                                                    ^~~~~~~
            |                                                    Is_zero
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersection_3_1.h:31,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersection_3.h:29,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/intersections.h:46,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_node.h:26,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h:24,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/AABB_tree.h:26,
                       from mesh/src/AABB_n_tree.h:9,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Intersections_3/intersection_3_1_impl.h: In function ‘typename CGAL::Intersection_traits<K, typename K::Plane_3, typename K::Sphere_3>::result_type CGAL::internal::intersection(const typename K::Plane_3&, const typename K::Sphere_3&, const K&)’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Intersections_3/intersection_3_1_impl.h:889:15: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        889 |   if(CGAL_NTS is_zero(cmp)) { // tangent
            |               ^~~~~~~
            |               Is_zero
      In file included from /usr/include/boost/none_t.hpp:17,
                       from /usr/include/boost/none.hpp:17,
                       from /usr/include/boost/optional/optional.hpp:53,
                       from /usr/include/boost/optional.hpp:15,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Object.h:37,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/kernel_basic.h:33,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/basic.h:46,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian_converter.h:34,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_node.h:25,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/internal/AABB_tree/AABB_traversal_traits.h:24,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/AABB_tree.h:26,
                       from mesh/src/AABB_n_tree.h:9,
                       from mesh/src/aabb_normals.cpp:10:
      /usr/include/boost/bind.hpp: At global scope:
      /usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
         36 | BOOST_PRAGMA_MESSAGE(
            | ^~~~~~~~~~~~~~~~~~~~
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Cartesian_base.h:33,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Simple_cartesian.h:28,
                       from mesh/src/AABB_n_tree.h:12,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Vector_2.h: In function ‘bool CGAL::operator==(const CGAL::VectorC2<R>&, const CGAL::Null_vector&)’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Vector_2.h:124:19: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        124 |   return CGAL_NTS is_zero(v.x()) && CGAL_NTS is_zero(v.y());
            |                   ^~~~~~~
            |                   Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Vector_2.h:124:46: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        124 |   return CGAL_NTS is_zero(v.x()) && CGAL_NTS is_zero(v.y());
            |                                              ^~~~~~~
            |                                              Is_zero
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:32,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Line_2.h:30,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Cartesian_base.h:35,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Simple_cartesian.h:28,
                       from mesh/src/AABB_n_tree.h:12,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/constructions/kernel_ftC2.h: In function ‘void CGAL::line_get_pointC2(const FT&, const FT&, const FT&, int, FT&, FT&)’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/constructions/kernel_ftC2.h:284:16: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        284 |   if (CGAL_NTS is_zero(b))
            |                ^~~~~~~
            |                Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/constructions/kernel_ftC2.h: In function ‘void CGAL::line_project_pointC2(const FT&, const FT&, const FT&, const FT&, const FT&, FT&, FT&)’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/constructions/kernel_ftC2.h:317:16: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        317 |   if (CGAL_NTS is_zero(la)) // horizontal line
            |                ^~~~~~~
            |                Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/constructions/kernel_ftC2.h:322:21: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        322 |   else if (CGAL_NTS is_zero(lb)) // vertical line
            |                     ^~~~~~~
            |                     Is_zero
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Line_2.h:30,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Cartesian_base.h:35,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Simple_cartesian.h:28,
                       from mesh/src/AABB_n_tree.h:12,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h: In function ‘typename CGAL::Compare<NT>::result_type CGAL::compare_slopesC2(const FT&, const FT&, const FT&, const FT&)’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:309:17: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        309 |    if (CGAL_NTS is_zero(l1a))  // l1 is horizontal
            |                 ^~~~~~~
            |                 Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:310:21: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        310 |     return CGAL_NTS is_zero(l2b) ? result_type(SMALLER)
            |                     ^~~~~~~
            |                     Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:312:17: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        312 |    if (CGAL_NTS is_zero(l2a)) // l2 is horizontal
            |                 ^~~~~~~
            |                 Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:313:21: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        313 |     return CGAL_NTS is_zero(l1b) ? result_type(LARGER)
            |                     ^~~~~~~
            |                     Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:315:17: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        315 |    if (CGAL_NTS is_zero(l1b)) return CGAL_NTS is_zero(l2b) ? EQUAL : LARGER;
            |                 ^~~~~~~
            |                 Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:315:47: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        315 |    if (CGAL_NTS is_zero(l1b)) return CGAL_NTS is_zero(l2b) ? EQUAL : LARGER;
            |                                               ^~~~~~~
            |                                               Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/predicates/kernel_ftC2.h:316:17: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        316 |    if (CGAL_NTS is_zero(l2b)) return SMALLER;
            |                 ^~~~~~~
            |                 Is_zero
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Cartesian_base.h:43,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Simple_cartesian.h:28,
                       from mesh/src/AABB_n_tree.h:12,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/ConicCPA2.h: In member function ‘void CGAL::ConicCPA2<PT, DA>::analyse()’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/ConicCPA2.h:206:31: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        206 |                 if (!CGAL_NTS is_zero (r())) {
            |                               ^~~~~~~
            |                               Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/ConicCPA2.h:230:38: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        230 |                 } else if (!CGAL_NTS is_zero (s())) {
            |                                      ^~~~~~~
            |                                      Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/ConicCPA2.h:256:51: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        256 |                     bool uv_zero    =    CGAL_NTS is_zero (u())
            |                                                   ^~~~~~~
            |                                                   Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/ConicCPA2.h:257:51: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        257 |                                       && CGAL_NTS is_zero (v());
            |                                                   ^~~~~~~
            |                                                   Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/ConicCPA2.h:258:59: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        258 |                     trivial         = uv_zero && CGAL_NTS is_zero (w());
            |                                                           ^~~~~~~
            |                                                           Is_zero

      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Cartesian_base.h:53,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Simple_cartesian.h:28,
                       from mesh/src/AABB_n_tree.h:12,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Plane_3.h: In member function ‘typename R::Boolean CGAL::PlaneC3<R_>::is_degenerate() const’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Plane_3.h:305:19: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        305 |   return CGAL_NTS is_zero(a()) && CGAL_NTS is_zero(b()) &&
            |                   ^~~~~~~
            |                   Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Plane_3.h:305:44: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        305 |   return CGAL_NTS is_zero(a()) && CGAL_NTS is_zero(b()) &&
            |                                            ^~~~~~~
            |                                            Is_zero
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Plane_3.h:306:19: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        306 |          CGAL_NTS is_zero(c());
            |                   ^~~~~~~
            |                   Is_zero
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Cartesian_base.h:59,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Simple_cartesian.h:28,
                       from mesh/src/AABB_n_tree.h:12,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Sphere_3.h: In member function ‘typename R::Boolean CGAL::SphereC3<R_>::is_degenerate() const’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Sphere_3.h:280:19: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
        280 |   return CGAL_NTS is_zero(squared_radius());
            |                   ^~~~~~~
            |                   Is_zero
      In file included from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/function_objects.h:28,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Cartesian/Cartesian_base.h:68,
                       from /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Simple_cartesian.h:28,
                       from mesh/src/AABB_n_tree.h:12,
                       from mesh/src/aabb_normals.cpp:10:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Kernel/function_objects.h: In member function ‘CGAL::CommonKernelFunctors::Is_degenerate_2<K>::result_type CGAL::CommonKernelFunctors::Is_degenerate_2<K>::operator()(const Line_2&) const’:
      /tmp/pip-req-build-oxjqcu5f/build/temp.linux-x86_64-cpython-311/CGAL-4.7/include/CGAL/Kernel/function_objects.h:2611:23: error: ‘is_zero’ is not a member of ‘CGAL’; did you mean ‘Is_zero’?
       2611 |     { return CGAL_NTS is_zero(l.a())  && CGAL_NTS is_zero(l.b()); }
            |                       ^~~~~~~
            |                       Is_zero

      mesh/src/aabb_normals.cpp: In function ‘PyObject* aabbtree_normals_nearest(PyObject*, PyObject*)’:
      mesh/src/aabb_normals.cpp:150:35: warning: narrowing conversion of ‘S’ from ‘size_t’ {aka ‘long unsigned int’} to ‘npy_intp’ {aka ‘long int’} [-Wnarrowing]
        150 |     npy_intp result1_dims[] = {1, S};
            |                                   ^
      mesh/src/aabb_normals.cpp:157:36: warning: narrowing conversion of ‘S’ from ‘size_t’ {aka ‘long unsigned int’} to ‘npy_intp’ {aka ‘long int’} [-Wnarrowing]
        157 |         npy_intp result2_dims[] = {S, 3};
            |                                    ^
      error: command '/usr/bin/g++-11' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psbody-mesh
Failed to build psbody-mesh
ERROR: Could not build wheels for psbody-mesh, which is required to install pyproject.toml-based

This can be fixed with:

# Locate the bundled CGAL directory
CGAL_DIR=$(find build -type d -name "CGAL-4.7" | head -n1)
[ -d "$CGAL_DIR" ] || { echo "CGAL-4.7 not unpacked; check the previous step."; exit 1; }

# --- PATCH 1: include missing Boost MPL headers so mpl::if_c is defined
# (fixes: ‘if_c’ in namespace ‘boost::mpl’ does not name a template type)
sed -i '1i #include <boost/mpl/if.hpp>\n#include <boost/mpl/bool.hpp>' \
  "$CGAL_DIR/include/CGAL/number_utils.h"

# --- PATCH 2: resolve CGAL_NTS is_zero / is_positive lookups with modern compilers
# Replace legacy "CGAL_NTS is_zero(...)" with "CGAL::is_zero(...)" (same for is_positive/negative)
grep -RIl "CGAL_NTS is_zero(" "$CGAL_DIR/include" | xargs -r sed -i 's/CGAL_NTS is_zero(/CGAL::is_zero(/g'
grep -RIl "CGAL_NTS is_positive(" "$CGAL_DIR/include" | xargs -r sed -i 's/CGAL_NTS is_positive(/CGAL::is_positive(/g'
grep -RIl "CGAL_NTS is_negative(" "$CGAL_DIR/include" | xargs -r sed -i 's/CGAL_NTS is_negative(/CGAL::is_negative(/g'

Along with #118, I packed it in https://github.com/mlouielu/mesh/tree/fix-py311-cgal-47.

To install it with the patches:

python -m pip install git+https://github.com/mlouielu/mesh@fix-py311-cgal-47

or

uv pip install git+https://github.com/mlouielu/mesh@fix-py311-cgal-47

This works tested on:

  • Python 3.11
  • boost 1.88.0-3
  • boost-libs 1.88.0-3
  • GCC/G++ 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions