Public bug reported:

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

** Affects: sfcgal (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "Add missing link dependency"
   
https://bugs.launchpad.net/bugs/1947444/+attachment/5533411/+files/add-missing-libgmpxx-dependency.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1947444

Title:
  Missing dependnecy in sfcgal 1.3.7 on focal

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sfcgal/+bug/1947444/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to