Open petrasvestartas opened 9 hours ago
Same for us: We set CGAL_DISABLE_GMP
to ON
and define CGAL_NO_GMP
but get the following building error with CGAL 6.0.1, Boost 1.86.0 and LLVM 18:
llvm/bin/../include/c++/v1/__type_traits/is_constructible.h:22:79: error: incomplete type 'boost::multiprecision::backends::gmp_int' used in type trait expression
22 | struct _LIBCPP_TEMPLATE_VIS is_constructible : public integral_constant<bool, __is_constructible(_Tp, _Args...)> {};
| ^
boost/libs/multiprecision/include/boost/multiprecision/detail/number_base.hpp:162:20: note: in instantiation of template class 'std::is_constructible<boost::multiprecision::backends::gmp_int, boost::multiprecision::backends::gmp_int>' requested here
162 | && (std::is_constructible<typename Num::backend_type, typename detail::canonical<T, typename Num::backend_type>::type>::value
| ^
boost/libs/multiprecision/include/boost/multiprecision/detail/default_ops.hpp:3953:1: note: in instantiation of template class 'boost::multiprecision::is_compatible_arithmetic_type<boost::multiprecision::number<boost::multiprecision::backends::gmp_int>, boost::multiprecision::number<boost::multiprecision::backends::gmp_int>>' requested here
3953 | BINARY_OP_FUNCTOR(gcd, number_kind_integer)
| ^
boost/libs/multiprecision/include/boost/multiprecision/detail/default_ops.hpp:3599:12: note: expanded from macro 'BINARY_OP_FUNCTOR'
3599 | is_compatible_arithmetic_type<Arithmetic, number<Backend, et_on> >::value && (number_category<Backend>::value == category), \
| ^
cgal/include/CGAL/CORE/BigInt.h:151:10: note: while substituting deduced template arguments into function template 'gcd' [with Backend = boost::multiprecision::backends::gmp_int, Arithmetic = BigInt]
151 | return boost::multiprecision::gcd(a,b);
| ^
boost/libs/multiprecision/include/boost/multiprecision/fwd.hpp:106:17: note: forward declaration of 'boost::multiprecision::backends::gmp_int'
106 | struct gmp_int;
| ^
@petrasvestartas Are you using CGAL 6.0.x or 5.6.1?
FYI: For us this error appeared when trying to upgrade from 5.6.1 to 6.0.1. In 5.6.1 we didn't have problems with the same setup.
If I'm doing:
CGAL_DIR=~/CGAL/releases/CGAL-6.0.1 cmake -DCGAL_DISABLE_GMP=ON ~/CGAL/releases/CGAL-6.0.1/examples/Triangulation_2 && make info_insert_with_pair_iterator_2
it compiles and if I get not gmp linked:
$ ldd info_insert_with_pair_iterator_2
linux-vdso.so.1 (0x00007fff78bad000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007febaa800000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007febaa721000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007febaaa43000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007febaa540000)
/lib64/ld-linux-x86-64.so.2 (0x00007febaab0f000)
Could you both give it a try and let me know what you have?
We run CMake from Bazel.
We use the following configuration:
BUILD.bazel
MODULE.bazel
Is there anything which looks suspicious to you or where you need additional info?
@mering, is it what you use to "install" CGAL? The cmake option -DCGAL_DISABLE=ON
must be provided to all compilation units using CGAL. That is nothing is hardcoded in the installed version of CGAL (it is a simple copy)
@sloriot
I have just tried with 6.0.1 - same problem. 1 year ago, there was no problem, so I suspect that CGAL is not catching my OS: Ubuntu 24.04.1 LTS
These flags works on windows and mac, but not ubuntu:
set(CGAL_CMAKE_EXACT_NT_BACKEND BOOST_BACKEND CACHE STRING "")
set(CGAL_DISABLE_GMP ON CACHE BOOL "Disable GMP in CGAL")
set(CMAKE_DISABLE_FIND_PACKAGE_GMP ON CACHE BOOL "Disable find package GMP in CMake")
@sloriot If you have ubuntu, could try to run this bash file, it suppose it to work just by drag and drop in your terminal: https://github.com/petrasvestartas/wood/blob/main/install_ubuntu.sh
This .cpp break the compilation with gmp:
It uses:
#include <CGAL/Polygon_mesh_processing/repair.h>
#include <CGAL/Polygon_mesh_processing/measure.h>
#include <CGAL/Polygon_mesh_processing/orientation.h>
@mering, is it what you use to "install" CGAL? The cmake option
-DCGAL_DISABLE=ON
must be provided to all compilation units using CGAL. That is nothing is hardcoded in the installed version of CGAL (it is a simple copy)
@sloriot What do you mean by "install". This basically runs cmake
with the specified cache_entries
, and then uses ninja to build and install into a specific directory and copies the cgal library from there.
Issue Details
I set CMake flags but code still requires gmp, why? The CMAKE code below is enough for mac and windows but not ubuntu. Please help!
Source Code
https://github.com/petrasvestartas/wood/blob/main/install_ubuntu.sh
Environment