Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

1.3.6 build error on Fedora 30 (CGAL 4.14, gcc 9.0.1) #188

Closed
devrimgunduz opened this issue May 1, 2019 · 19 comments
Closed

1.3.6 build error on Fedora 30 (CGAL 4.14, gcc 9.0.1) #188

devrimgunduz opened this issue May 1, 2019 · 19 comments

Comments

@devrimgunduz
Copy link

Hi,

I'm getting this while building SFCGAL on Fedora 30. Any hints how I can fix it?

Thanks!

`/var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/src/Coordinate.cpp: In member function 'CGAL::Lazy_kernel_generic_base<CGAL::Simple_cartesian<boost::multiprecision::numberboost::multiprecision::backends::gmp_rational >, CGAL::Simple_cartesian<CGAL::Interval_nt >, CGAL::Cartesian_converter<CGAL::Simple_cartesian<boost::multiprecision::numberboost::multiprecision::backends::gmp_rational >, CGAL::Simple_cartesian<CGAL::Interval_nt > >, CGAL::Epeck>::FT SFCGAL::RoundVisitor::_roundFT(const FT&) const':
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/src/Coordinate.cpp:276:72: error: no matching function for call to 'round(boost::enable_if_c<true, boost::multiprecision::detail::expression<boost::multiprecision::detail::multiply_immediates, boost::multiprecision::numberboost::multiprecision::backends::gmp_rational, long int, void, void> >::type)'
276 | SFCGAL::round( v.exact() * _scaleFactor ),
| ^
In file included from /var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/include/SFCGAL/Coordinate.h:31,
from /var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/src/Coordinate.cpp:21:
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/include/SFCGAL/numeric.h:50:15: note: candidate: 'double SFCGAL::round(const double&)'
50 | inline double round( const double& v )
| ^~~~~
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/include/SFCGAL/numeric.h:50:36: note: no known conversion for argument 1 from 'boost::enable_if_c<true, boost::multiprecision::detail::expression<boost::multiprecision::detail::multiply_immediates, boost::multiprecision::numberboost::multiprecision::backends::gmp_rational, long int, void, void> >::type' {aka 'boost::multiprecision::detail::expression<boost::multiprecision::detail::multiply_immediates, boost::multiprecision::numberboost::multiprecision::backends::gmp_rational, long int, void, void>'} to 'const double&'
50 | inline double round( const double& v )
| ~~~~~~~~~~~~~~^
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/include/SFCGAL/numeric.h:86:23: note: candidate: 'CGAL::Gmpz SFCGAL::round(const CGAL::Gmpq&)'
86 | SFCGAL_API CGAL::Gmpz round( const CGAL::Gmpq& v ) ;
| ^~~~~
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6/include/SFCGAL/numeric.h:86:48: note: no known conversion for argument 1 from 'boost::enable_if_c<true, boost::multiprecision::detail::expression<boost::multiprecision::detail::multiply_immediates, boost::multiprecision::numberboost::multiprecision::backends::gmp_rational, long int, void, void> >::type' {aka 'boost::multiprecision::detail::expression<boost::multiprecision::detail::multiply_immediates, boost::multiprecision::numberboost::multiprecision::backends::gmp_rational, long int, void, void>'} to 'const CGAL::Gmpq&'
86 | SFCGAL_API CGAL::Gmpz round( const CGAL::Gmpq& v ) ;
| ~~~~~~~~~~~~~~~~~~^
make[3]: *** [src/CMakeFiles/SFCGAL.dir/build.make:66: src/CMakeFiles/SFCGAL.dir/Coordinate.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/var/lib/pgsql/git/pgrpms/rpm/redhat/master/sfcgal/master/SFCGAL-1.3.6'
make[2]: *** [CMakeFiles/Makefile2:95: src/CMakeFiles/SFCGAL.dir/all] Error 2

`

@lrineau
Copy link

lrineau commented May 2, 2019

The code of SFCGAL uses several internal details of CGAL, and those details have changed. SFCGAL is not ready for CGAL-4.14, unfortunately.

@lrineau
Copy link

lrineau commented May 2, 2019

The first step to make the code compile is to use the flag -DCGAL_DO_NOT_USE_BOOST_MP. But that is not sufficient.

@sloriot There is a compilation error in files you added recently:

In file included from /home/lrineau/Git/SFCGAL/src/../CGAL_patches/CGAL/intersection_of_Polyhedra_3.h:46,
                 from /home/lrineau/Git/SFCGAL/src/algorithm/Intersection3D.cpp:24:
/home/lrineau/Git/SFCGAL/src/../CGAL_patches/CGAL/internal/corefinement/intersection_triangle_segment_3.h:30:10: fatal error: CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h: No such file or directory
 #include <CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@devrimgunduz
Copy link
Author

Hi,

This is breaking upgrages to Fedora 30, which is already released. Also, RHEL 8 is out very soon, and this will break more users.

I mean, we need CGAL 4.14 support soon :(

(FWIW, I am packaging RPMs for the PostgreSQL YUM/ZYPP repos)
Regards, Devrim

@fxcoudert
Copy link

This is breaking build of SFCGAL in Homebrew as well, now that we have shipped GCC 9: Homebrew/homebrew-core#38890

@fxcoudert fxcoudert mentioned this issue May 16, 2019
@fxcoudert
Copy link

fxcoudert commented May 16, 2019

Given no activity, and it's not the first time we've been blocked by SFCGAL from updating other software (#172) I will propose to Homebrew to remove it. It will, sadly, impact PostGIS functionality… but we currently have no other option.

It's a bit sad that CGAL and its C++ wrapper cannot work together so they're kept in sync.

@sloriot
Copy link
Contributor

sloriot commented May 19, 2019

Please try: #189

@sloriot
Copy link
Contributor

sloriot commented May 19, 2019

Together with -DCGAL_DO_NOT_USE_BOOST_MP or set CGAL_WITH_GMPXX:BOOL=ON when configuring SFCGAL.

@lrineau
Copy link

lrineau commented May 20, 2019

@sloriot commented on May 19, 2019, 10:48 AM GMT+2:

Together with -DCGAL_DO_NOT_USE_BOOST_MP or set CGAL_WITH_GMPXX:BOOL=ON when configuring SFCGAL.

I think SFCGAL headers could hardcode:

#define CGAL_DO_NOT_USE_BOOST_MP 1
#define CGAL_DO_NOT_USE_GMPXX 1

The second macro, CGAL_DO_NOT_USE_GMPXX has currently no effect in CGAL, but it will, once I have enabled GMPXX by default (for CGAL-5.0 probably).

@fxcoudert
Copy link

I've tried applying the patch at #189 and building with cmake -DCGAL_DO_NOT_USE_BOOST_MP=TRUE. It still gives the same error:

/tmp/sfcgal-20190521-49736-1lujjuk/SFCGAL-1.3.6/src/Coordinate.cpp:276:32: error: no matching function for call to 'round'
                               SFCGAL::round( v.exact() * _scaleFactor ),
                               ^~~~~~~~~~~~~
/tmp/sfcgal-20190521-49736-1lujjuk/SFCGAL-1.3.6/include/SFCGAL/numeric.h:50:15: note: candidate function not viable: no known conversion from 'typename enable_if<is_compatible_arithmetic_type<long, number<gmp_rational, et_on> >, detail::expression<detail::multiply_immediates, number<gmp_rational, et_on>, long> >::type' (aka 'boost::multiprecision::detail::expression<boost::multiprecision::detail::multiply_immediates, boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, boost::multiprecision::et_on>, long, void, void>') to 'const double' for 1st argument
inline double round( const double& v )
              ^
/tmp/sfcgal-20190521-49736-1lujjuk/SFCGAL-1.3.6/include/SFCGAL/numeric.h:86:23: note: candidate function not viable: no known conversion from 'typename enable_if<is_compatible_arithmetic_type<long, number<gmp_rational, et_on> >, detail::expression<detail::multiply_immediates, number<gmp_rational, et_on>, long> >::type' (aka 'boost::multiprecision::detail::expression<boost::multiprecision::detail::multiply_immediates, boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, boost::multiprecision::et_on>, long, void, void>') to 'const CGAL::Gmpq' for 1st argument
SFCGAL_API CGAL::Gmpz round( const CGAL::Gmpq& v ) ;
                      ^

@lrineau
Copy link

lrineau commented May 22, 2019

CGAL_DO_NOT_USE_BOOST_MP is not a CMake variable, but the name of a C++ preprocessor macro.

You can add #define CGAL_DO_NOT_USE_BOOST_MP 1 near the top of the .cpp files of SFCGAL, or add -DCGAL_DO_NOT_USE_BOOST_MP to the compilation flags of the compiler.

@fxcoudert
Copy link

a C++ preprocessor macro

OK, thanks. I guess that's the lever of tinkering we're not going to be able to accept for distribution. Multiple patches, plus adding compiler flags (which should be defined in SFCGAL's own headers or build process if they need it)… it's simply too much.

@sloriot
Copy link
Contributor

sloriot commented May 23, 2019

I'll update the PR to include that.

@devrimgunduz
Copy link
Author

Any updates? Fedora 30 users are also asking about this for some time.

@sloriot
Copy link
Contributor

sloriot commented May 27, 2019

I'm waiting for @mhugo to answer my question in #189. Maybe @vmora can help.

@sloriot
Copy link
Contributor

sloriot commented May 28, 2019

Thanks @vmora, PR update if you want to give it another try!

@mhugo
Copy link
Contributor

mhugo commented Jun 3, 2019

@fxcoudert @devrimgunduz I've merged the fix proposed by @sloriot (sorry for the delay, I was away for a few days). I'll post a new point release if you confirm the last SFCGAL master compiles for you.

@devrimgunduz
Copy link
Author

Hi @mhugo ,

This patch fixes the build issue. Thanks!

Waiting for the new point release.

Cheers, Devrim

@mhugo
Copy link
Contributor

mhugo commented Jun 3, 2019

@devrimgunduz Thanks for your test. A new release is out: https://github.com/Oslandia/SFCGAL/releases/tag/v1.3.7

@devrimgunduz
Copy link
Author

Thanks! Rolling out new packages.

Closing this issue.

Cheers, Devrim

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants