-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation failure in clang/LLVM 19 due to incorrect member name base() in graph_traits_HalfedgeDS.h #8313
Comments
Hi, those I suggest the following patch: diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h
index 54b54c08ecb..cef4a913cad 100644
--- a/BGL/include/CGAL/boost/graph/iterator.h
+++ b/BGL/include/CGAL/boost/graph/iterator.h
@@ -214,11 +214,6 @@ public:
#ifndef DOXYGEN_RUNNING
- explicit operator bool() const
- {
- return (! (this->base() == nullptr));
- }
-
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);
return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding);
@@ -308,11 +303,6 @@ public:
#ifndef DOXYGEN_RUNNING
- explicit operator bool() const
- {
- return (! (this->base() == nullptr));
- }
-
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);
return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding);
@@ -400,11 +390,6 @@ public:
pointer operator -> ( ) { return &pos; }
const value_type* operator -> ( ) const { return &pos; }
- explicit operator bool() const
- {
- return (! (this->base() == nullptr));
- }
-
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);
return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding); Can you please try it, and let us know? |
I have confirmed the above patch fixes the issue on clang/LLVM 19.0.0. |
Here is the Dockerfile I used to confirm the patch works: # Use an Ubuntu base image
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
wget \
lsb-release \
software-properties-common \
gnupg \
libgmp-dev \
libmpfr-dev \
libboost-all-dev \
libeigen3-dev \
patch
# Install clang/LLVM 19.0.0
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 19
# Set clang/LLVM as default compiler
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-19 100
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-19 100
# Copy the patch file into the container
COPY cgal_patch.diff /usr/local/src/cgal_patch.diff
# Clone and build CGAL with the patch
RUN git clone https://github.com/CGAL/cgal.git /usr/local/src/cgal && \
cd /usr/local/src/cgal && \
git apply /usr/local/src/cgal_patch.diff && \
mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make && \
make install && \
echo "CGAL build and installation completed successfully."
# Verify installation
RUN ls /usr/local/lib && ls /usr/local/include/CGAL
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Set up a working directory
WORKDIR /workspace
# Command to keep the container running
CMD ["bash"] And the test file I compiled: #include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <iostream>
int main() {
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Surface_mesh<Kernel::Point_3> Mesh;
Mesh mesh;
std::cout << "CGAL and clang/LLVM 19.0.0 are set up correctly!" << std::endl;
return 0;
} Without the patch, the compilation with clang 19 failed with the error in the initial post. With the patch applied there is no error and the program successfully compiles. |
Confirmed fix to compilation issue in clang//llvm 19 (CGAL#8313)
Confirmed fix to compilation issue in clang//llvm 19 (CGAL#8313)
Confirmed fix to compilation issue in clang//llvm 19 (CGAL#8313)
…ssue-8313 Fix clang/llvm 19 compilation issue in iterator.h (issue #8313)
Confirmed fix to compilation issue in clang//llvm 19 (CGAL#8313)
Confirmed fix to compilation issue in clang//llvm 19 (CGAL#8313)
Confirmed fix to compilation issue in clang//llvm 19 (CGAL#8313)
Issue Details
I write an R package that links CGAL, and I was recently informed that the package was failing to install with LLVM 19 due to missing member functions.
Here are the installation logs:
(Here are the full logs: https://www.stats.ox.ac.uk/pub/bdr/clang19/raybevel.log)
I believe this should be
this::base_reference()
, as all the other similarly templated classes in the header call that member function.Example:
cgal/BGL/include/CGAL/boost/graph/iterator.h
Lines 496 to 510 in 29ed736
Source Code
The lines causing these errors is located in these locations:
cgal/BGL/include/CGAL/boost/graph/iterator.h
Lines 215 to 219 in 29ed736
cgal/BGL/include/CGAL/boost/graph/iterator.h
Lines 311 to 314 in 29ed736
cgal/BGL/include/CGAL/boost/graph/iterator.h
Lines 403 to 406 in 29ed736
Environment
The text was updated successfully, but these errors were encountered: