Missing dependnecy in sfcgal 1.3.7 on focal

Bug #1947444 reported by Hiroshi Miura
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sfcgal (Ubuntu)
New
Undecided
Unassigned

Bug Description

sfcgal(libsfcgal1, libsfcgal-dev) v1.3.7 on focal (Ubuntu 20.04) causes a link error when used.

```
/usr/bin/ld: /lib/x86_64-linux-gnu/libSFCGAL.so.1: undefined reference to `operator<<(std::ostream&, __mpz_struct const*)'
/usr/bin/ld: /lib/x86_64-linux-gnu/libSFCGAL.so.1: undefined reference to `operator>>(std::istream&, __mpz_struct*)'
```

investigation
-------------

Here is output of ldd
miurahr@miurahr-ThinkPad-T14s-Gen-1:~/Projects/Geo/sfcgal-1.3.7/debian/libsfcgal1/usr/lib/x86_64-linux-gnu$ ldd libSFCGAL.so.1
 linux-vdso.so.1 (0x00007ffdeebf3000)
 libboost_serialization.so.1.71.0 => /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.71.0 (0x00007f162c238000)
 libmpfr.so.6 => /usr/lib/x86_64-linux-gnu/libmpfr.so.6 (0x00007f162c1b7000)
 libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f162c133000)
 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f162bf51000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f162be02000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f162bde7000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f162bbf3000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f162cc45000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f162bbd0000)

I found there is not a libgmpxx dependency.

details
-------

Upstream sfcgal 1.3.7 recommend dependency CGAL 4.3 and disables GMPXX.
Because Ubuntu distribute CGAL 5.0, so sfcgal source has been patched to link with CGAL 5.0 and try to enable GMPXX, but it is incomplete.

This is an upstream change to support CGAL 5.0.

https://gitlab.com/Oslandia/SFCGAL/-/commit/6caae06aff00afc2c60921dcea6cbc4cd2af2405

1. change to CMakeLists.txt to 'find_package(CGAL)' from 'find_package(CGAL 4.3)'
2. add to CMakeLists.txt a definition 'add_definitions( "-DCGAL_USE_GMPXX=1" )'
3. add to src/CMakeLists.txt a dependency 'target_link_libraries( SFCGAL gmpxx )'
4. remove config.h definition '#define CGAL_DO_NOT_USE_GMPXX 1'

 Ubuntu package does No.1 and No.2, but unfortunately did not No.3 and No.4.

Missing No.3 cause the link error.

I attached a patch to intend to add to 'debian/patches/'

Other consideration
-------------------

debian's sfcgal is not v1.3.7. this is only for the Ubuntu and its derivatives issue.

Affected project
----------------

GDAL is a project to link with SFCGAL and cmake build script got link error with SFCGAL with the bug.

https://github.com/miurahr/cmake4gdal/issues/13

Tags: patch
Revision history for this message
Hiroshi Miura (miurahr) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Add missing link dependency" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Bas Couwenberg (sebastic) wrote :

sfcgal is not actively maintained in Ubuntu, this issue is unlikely to get fixed.

sfcgal (1.3.7-4) has a patch to fix this issue when using sfcal-config, you should consider using that like postgis does.

Revision history for this message
William Wilson (jawn-smith) wrote :

This actually appears to have been fixed by a patch in sfcgal 1.3.7-4, which is in focal as of Dec 2019. If you are still experiencing this issue with the latest version of sfcgal in focal, are you able to share the code that is causing the issue?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.