Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL 5.1 compile errors when using Intel Compiler 19.1

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL 5.1 compile errors when using Intel Compiler 19.1


Chronological Thread 
  • From: Andrew Cunningham <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL 5.1 compile errors when using Intel Compiler 19.1
  • Date: Wed, 9 Sep 2020 08:38:07 -0700
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:EmWu9xVKte5Gk0+lT9EfQbemZsbV8LGtZVwlr6E/grcLSJyIuqrYZRSFtadThVPEFb/W9+hDw7KP9fy5BypZu8rK4ClKWacPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3wOgVvO+v6BJPZgdip2OCu4Z3TZBhDiCagbb9oIxi6sATcutMLjYd8Jas9xRjErmZVcOlK2G1kIk6ekQzh7cmq5p5j9CpQu/Ml98FeVKjxYro1Q79FAjk4Km45/MLkuwXNQguJ/XscT34ZkgFUDAjf7RH1RYn+vy3nvedgwiaaPMn2TbcpWTS+6qpgVRHlhDsbOzM/7WrajNF7gqBGrxK7vxFwzIDUb4OVOvRwfa3TYM0USnZaU8lLSyBMGJmxY5cTA+cDO+tTsonzp0EJrRu7HQShGOXvxSJShnDo06wxzvosERzA3AwmHtIOtnvUrNXvO6cXTOu4y7XHzTrZYPNSwjry8pHEfQw8ofGKW7JwcMzRyUYvFwzfi1Wcs5DqPzSQ1ukUtWWQ8uVvW/61hWE9twFxviagxt0qioTRm44bxU7I+CFkzYs3O9C1S1N2b9GrHZZfqS2XM5V7T8EiTm12tys3zrwLtJqmcCUU1ZgqwxDRZ+Kaf4aG4x/tW+CcKip2inJifbKwnRey8U64x+39UMm0yldKoTBfntnCrHAA0QHY5MufSvZl4EutxTKC2xrQ5+xEO0w4i7fXJ4I7zrM/lZcet1nIEDXsl0XslqCWc10p+ui25OTjZbXrvpqcOJV1igH6K6gundC/DfkhPggAUGWW+v6w1LLk/U3+T7VKiuM5nrPFv5DdIMQXvq+5AwlL3YY/8xuzESuq3dACkXQELF9JYgyLg5X1N13UL/31Du+zg1G2nzdqw/DGMKfhApLILnXbirjuYLN9609ayAco199T/o5bCqwHIPL1W0/xstPYDh8jPAyx2eroFNJ91oYGVWKVHqCZKL/SsUOP5u83P+aMa5UauDLkJ/c45v7ulmM2mUIGfamyxpYXc3C5HvF+I0qDe3bsg9EBEX0LvgUkVuDqhkeCAnZuYW2vVfc8+i0jE9DhSpzSQ5ikxr2HxiayWJNMIXtXD0iFVnbueYLDUPgFbGeeI9RqjycfBoWnUJIr9Q2rsFr616Z/NbiTvTYJsIrqktlz/eza0x8osidlCtyUlGCLQWYzlWwBQ3o63bt0vFdmmWqFyrVyv/FICYlT++9RSVV9coXNyvRzTdH0QAPIONmTD023R82vRjA3QNV2yNAHZwNxGs6pkwvYjBatVrQanrjOCJ0v+b/HxFDwIdx8wjDIzvoPlV4jF+JJOXermeZU6g7VBojGk0yc3/Kheq0Y9CeI/3qFy2uIs0FRVUh7VqCTDiNXXVffsdmsvhCKdLSpE7lyalIdm/7HEbNDb5jStXsDXO3qYYSMaie6hmG2BBCHxrqJKoHtfjdFhXiPOA0/iwkWuE2+G00+CyOm+T+MCTVvERfofxqp/7Uu7ny8SUAwwkeBaEgzj+PkqC5QvuSVTrYo5pxBvS4grztuG1Pkj4DfTtGdoQxgeqpcaNZ761BChzrU

Hi Andreas,
I understand supporting every C++ compiler is not practical. But the Intel compiler is widely used in commercial software for various reasons
- Identical compiler on both Linux and Windows platforms - this is a big plus for testing and QA
- Very good support for FORTRAN
- Support for OpenMP 4.0+ (unlike Microsoft Compilers)
- Arguably better optimization

I also would argue that introducing arguably obscure C++17 language features in CGAL is risky and hard to test, as it requires , for completeness, to compile and test CGAL in C++14 mode and C++17 modes until such point as you make C++17 required.



On Wed, Sep 9, 2020 at 12:00 AM Andreas Fabri <> wrote:

Hi Andrew,

Thank you for your bug report/analysis/fix.

In the past we had supported the Intel compiler, but we had given it up
mainly because there were no users of this compiler.   We also had observed
some compiler bugs in the CGAL testsuite, with no support from Intel
for working around or fixing them.

We can give it another try if we find a sponsor.

Best regards,

Andreas

On 9/9/2020 12:08 AM, Andrew Cunningham wrote:
And just to round out one more compiler issue with ICC 19.1 I had to modify FPU.h as there is no __builtin_sqrt on Windows with ICC 19.1

// For SSE2, we need to call __builtin_sqrt() instead of libc's sqrt().
#if defined ( _MSC_VER ) && defined ( __INTEL_COMPILER )
#  define CGAL_BUG_SQRT(d) std::sqrt(d)
#else
#  define CGAL_BUG_SQRT(d) __builtin_sqrt(d)
#endif

On Tue, Sep 8, 2020 at 2:39 PM Andrew Cunningham <> wrote:
I have found the cause of the CGAL 5.1 compilation error with the Intel Compiler 19.1 and C++17.
This snippet of code is new to CGAL 5.1 and is used in a series of headers such as Point_3.h
__cpp_lib_is_swappable is #defined when C++17 is defined as the language standard.

  friend void swap(Self& a, Self& b)
#ifdef __cpp_lib_is_swappable
    noexcept(std::is_nothrow_swappable_v<Rep>)
#endif

INMHO, this code is using an obscure and advanced C++17 (C++20?) feature for no real gain. I would suggest reverting this change.




On Tue, Sep 8, 2020 at 1:23 PM Andrew Cunningham <> wrote:
This ussue only seems to happen with /std:c++17. If I change the language conformance to /std:c++14 the code compiles with ICC 19.1

On Tue, Sep 8, 2020 at 12:34 PM Andrew Cunningham <> wrote:
Hi,
Code that compiles without error when using GCAL 5.0.3 now fails with 5.1 with Visual Studio 2019+Intel Compiler 19.1.
Code compiles without error when using the native Microsoft compiler.
Since the same code compiled with 5.0.3 when using ICC 19.1, maybe whatever changed from 5.0.3-5.1 is the key.

Sample code

#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>

using Point_3           = CGAL::Simple_cartesian< float >::Point_3;
using Mesh              = CGAL::Surface_mesh< Point_3 >;
using vertex_descriptor = Mesh::Vertex_index;
using face_descriptor   = Mesh::Face_index;

Andrew



1>D:\CGAL-5.1\include\CGAL/Cartesian/Line_3.h(38): error : incomplete type is not allowed
1>      Point_3 first;
1>              ^
1>          detected during:
1>            instantiation of class "CGAL::LineC3<R_>::Rep [with R_=CGAL::Simple_cartesian<float>]" at line 46
1>            instantiation of class "CGAL::LineC3<R_> [with R_=CGAL::Simple_cartesian<float>]" at line 30 of "D:\CGAL-5.1\include\CGAL/Line_3.h"
1>            instantiation of class "CGAL::Line_3<R_> [with R_=CGAL::Simple_cartesian<float>]" at line 678 of "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\include\type_traits"
1>            instantiation of "const bool std::is_move_constructible_v [with _Ty=CGAL::VectorC3<CGAL::Simple_cartesian<float>>]" at line 61 of "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\include\type_traits"
1>            instantiation of class "std::conjunction<_First, _Rest...> [with _First=std::_Swappable_with_helper<std::add_lvalue_reference_t<CGAL::VectorC3<CGAL::Simple_cartesian<float>>>, std::add_lvalue_reference_t<CGAL::VectorC3<CGAL::Simple_cartesian<float>>>, void>, _Rest=<std::_Swappable_with_helper<std::add_lvalue_reference_t<CGAL::VectorC3<CGAL::Simple_cartesian<float>>>, std::add_lvalue_reference_t<CGAL::VectorC3<CGAL::Simple_cartesian<float>>>, void>>]" at line 66 of "C:\Program Files
1>                      (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\include\type_traits"
1>            [ 9 instantiation contexts not shown ]
1>            instantiation of class "CGAL::Point_3<R_> [with R_=CGAL::Simple_cartesian<float>]" at line 213 of "D:\CGAL-5.1\include\CGAL/Surface_mesh/Properties.h"
1>            instantiation of class "CGAL::Properties::Property_array<T> [with T=Point_3]" at line 515 of "D:\CGAL-5.1\include\CGAL/Surface_mesh/Properties.h"
1>            instantiation of class "CGAL::Properties::Property_map_base<I, T, CRTP_derived_class> [with I=CGAL::SM_Vertex_index, T=Point_3, CRTP_derived_class=CGAL::Surface_mesh<Point_3>::Property_map<CGAL::SM_Vertex_index, Point_3>]" at line 342 of "D:\CGAL-5.1\include\CGAL/Surface_mesh/Surface_mesh.h"
1>            instantiation of class "CGAL::Surface_mesh<P>::Property_map<I, T> [with P=Point_3, I=CGAL::SM_Vertex_index, T=Point_3]" at line 2098 of "D:\CGAL-5.1\include\CGAL/Surface_mesh/Surface_mesh.h"

1>

etc more like this.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss

-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




Archive powered by MHonArc 2.6.19+.

Top of Page