Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] [PATCH] Compile errors using Intels compiler icc

Subject: CGAL users discussion list

List archive

[cgal-discuss] [PATCH] Compile errors using Intels compiler icc


Chronological Thread 
  • From: Jens Seidel <>
  • To:
  • Subject: [cgal-discuss] [PATCH] Compile errors using Intels compiler icc
  • Date: Fri, 27 Nov 2009 18:28:38 +0100

Hi,

I fail to use CGAL 3.5's header files with icc, the Intel compiler. I use
version 11.1 20091012 with the following options:
-fno-alias -strict-ansi -openmp -O3 -pg

The attached patch fixes it.

Please note that the GNU compiler has no problem with the code so I wonder
whether icc is right. I remembered
http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html#Name-lookup
"The C++ standard prescribes that all names that are not dependent on
template parameters are bound to their present definitions when parsing a
template function or class."
and tried adding "this->" for each problem which worked. There are probably
also other solutions such as a "using" directive.

Without the patch I get the following error:

/home/jens/Rhost/CGAL/CGAL-3.5/include/CGAL/HalfedgeDS_decorator.h|264|
error: identifier "find_prev" is undefined
|| Halfedge_handle hprev = find_prev( h);
|| ^
|| detected during:
|| instantiation of "p_HDS::Halfedge_handle
CGAL::HalfedgeDS_decorator<p_HDS>::join_face(p_HDS::Halfedge_handle) [with
p_HDS=CGAL::HalfedgeDS_default<R,
CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>,
std::allocator<int>>]" at line 1169 of
"/home/jens/Rhost/CGAL/CGAL-3.5/include/CGAL/Polyhedron_3.h"
|| instantiation of "T_HDS<PolyhedronTraits_3,
CGAL::I_Polyhedron_derived_items_3<PolyhedronItems_3>,
Alloc>::Halfedge_handle CGAL::Polyhedron_3<PolyhedronTraits_3,
PolyhedronItems_3, T_HDS, Alloc>::join_facet(T_HDS<PolyhedronTraits_3,
CGAL::I_Polyhedron_derived_items_3<PolyhedronItems_3>,
Alloc>::Halfedge_handle) [with PolyhedronTraits_3=R,
PolyhedronItems_3=CGAL::Polyhedron_items_3, T_HDS=CGAL::HalfedgeDS_default,
Alloc=std::allocator<int>]" at line 246 of <one of my own files>

Jens
diff -ru CGAL-3.5/include/CGAL/HalfedgeDS_decorator.h CGAL-3.5.fixed/include/CGAL/HalfedgeDS_decorator.h
--- CGAL-3.5/include/CGAL/HalfedgeDS_decorator.h	2009-07-24 14:42:18.000000000 +0200
+++ CGAL-3.5.fixed/include/CGAL/HalfedgeDS_decorator.h	2009-11-27 16:41:46.000000000 +0100
@@ -261,13 +261,13 @@
         // size of the face removed and the time to compute `h->prev()'.
         // Precondition: `Supports_removal' == `Tag_true'.
         Assert_compile_time_tag( Tag_true(), Supports_removal());
-        Halfedge_handle hprev = find_prev( h);
-        Halfedge_handle gprev = find_prev( h->opposite());
-        remove_tip( hprev);
-        remove_tip( gprev);
+        Halfedge_handle hprev = this->find_prev( h);
+        Halfedge_handle gprev = this->find_prev( h->opposite());
+        this->remove_tip( hprev);
+        this->remove_tip( gprev);
         hds->edges_erase( h);
-        if ( get_face( gprev) != Face_handle())
-            faces_erase( get_face( gprev));
+        if ( this->get_face( gprev) != Face_handle())
+            this->faces_erase( this->get_face( gprev));
         h = hprev;
         // 'half' of the halfedges have their correct faces.
         // Here we do the remaining halfedges.
@@ -275,12 +275,12 @@
         while ( h != gprev) {
             CGAL_assertion( ++termination_count != 0);
             h = h->next();
-            set_face( h, get_face( hprev));
+            this->set_face( h, this->get_face( hprev));
         }
-        if ( get_face( hprev) != Face_handle())
-            set_face_halfedge(  hprev);
-        set_vertex_halfedge( hprev);
-        set_vertex_halfedge( gprev);
+        if ( this->get_face( hprev) != Face_handle())
+            this->set_face_halfedge(  hprev);
+        this->set_vertex_halfedge( hprev);
+        this->set_vertex_halfedge( gprev);
         return hprev;
     }
 
@@ -311,12 +311,12 @@
         // removed and the time to compute `h->prev()'. Precondition:
         // `Supports_removal' == `Tag_true'.
         Assert_compile_time_tag( Tag_true(), Supports_removal());
-        Halfedge_handle hprev = find_prev( h->opposite());
-        Halfedge_handle gprev = find_prev( h);
-        remove_halfedge( hprev);
-        remove_halfedge( gprev);
+        Halfedge_handle hprev = this->find_prev( h->opposite());
+        Halfedge_handle gprev = this->find_prev( h);
+        this->remove_halfedge( hprev);
+        this->remove_halfedge( gprev);
         hds->edges_erase( h);
-        vertices_erase( get_vertex( gprev));
+        vertices_erase( this->get_vertex( gprev));
         // 'half' of the halfedges have their correct vertex.
         // Here we do the remaining halfedges.
         h = hprev;
@@ -324,13 +324,13 @@
         while ( h != gprev) {
             CGAL_assertion( ++termination_count != 0);
             h = h->next()->opposite();
-            set_vertex( h, get_vertex( hprev));
+            this->set_vertex( h, this->get_vertex( hprev));
         }
-        set_vertex_halfedge( hprev);
+        this->set_vertex_halfedge( hprev);
         if ( ! hprev->is_border())
-            set_face_halfedge(  hprev);
+            this->set_face_halfedge(  hprev);
         if ( ! gprev->is_border())
-            set_face_halfedge(  gprev);
+            this->set_face_halfedge(  gprev);
         return hprev;
     }
 
@@ -555,16 +555,16 @@
         CGAL_precondition( h != Halfedge_handle());
         CGAL_precondition( h->is_border());
         Face_handle f = faces_push_back( Face());
-        set_face_in_face_loop( h, f);
-        set_face_halfedge( h);
+        this->set_face_in_face_loop( h, f);
+        this->set_face_halfedge( h);
     }
 
     void fill_hole( Halfedge_handle h, const Face& f, Tag_true) {
         CGAL_precondition( h != Halfedge_handle());
         CGAL_precondition( h->is_border());
         Face_handle fh = faces_push_back( f);
-        set_face_in_face_loop( h, fh);
-        set_face_halfedge( h);
+        this->set_face_in_face_loop( h, fh);
+        this->set_face_halfedge( h);
     }
 
   public:
@@ -607,8 +607,8 @@
         CGAL_precondition( h->is_border());
         CGAL_precondition( g->is_border());
         Halfedge_handle hh = hds->edges_push_back( Halfedge(), Halfedge());
-        insert_tip( hh, h);
-        insert_tip( hh->opposite(), g);
+        this->insert_tip( hh, h);
+        this->insert_tip( hh->opposite(), g);
         fill_hole( g, f);
         return hh;
     }
 



Archive powered by MHonArc 2.6.16.

Top of Page