CGAL 5.1 compile errors when using Intel Compiler 19.1

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

CGAL 5.1 compile errors when using Intel Compiler 19.1

AndrewC
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

Reply | Threaded
Open this post in threaded view
|

Re: CGAL 5.1 compile errors when using Intel Compiler 19.1

AndrewC
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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: CGAL 5.1 compile errors when using Intel Compiler 19.1

AndrewC
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 <[hidden email]> 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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: CGAL 5.1 compile errors when using Intel Compiler 19.1

AndrewC
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: CGAL 5.1 compile errors when using Intel Compiler 19.1

andreas.fabri

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: CGAL 5.1 compile errors when using Intel Compiler 19.1

AndrewC
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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


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