Forum

Author Topic: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn  (Read 8507 times)

ihabali

  • Newbie
  • *
  • Posts: 13
    • View Profile
Hi,
Just attempted to run Metshape for the first time on my new AMD Cent OS 8 workstation and I'm getting this error : metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn_cnd_sub_n. Any ideas what's happening?


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Hello ihabali,

Are you starting Metashape in the following way?
Code: [Select]
./metashape.sh
Best regards,
Alexey Pasumansky,
Agisoft LLC

ihabali

  • Newbie
  • *
  • Posts: 13
    • View Profile
Hi Alexey,
Yes starting from the script.  I checked libhogweed with ldd and it resolves the link correctly to libgmp under /lib64 so I'm not sure I understand why it can't find the function.

Also in the script the following lines:
TCL_LIBRARY=$dirname/python/lib/tcl8.5
TK_LIBRARY=$dirname/python/lib/tk8.5
export TCL_LIBRARY
export TK_LIBRARY

LD_LIBRARY_PATH=$dirname:$dirname/python/lib:$LD_LIBRARY_PATH

They point to a non-existing pythong directory in "$dirname". Is that the way it's supposed to be?
« Last Edit: February 24, 2020, 12:15:12 AM by ihabali »

ihabali

  • Newbie
  • *
  • Posts: 13
    • View Profile
Alexey or anyone, any ideas on how to resolve this issue?

ihabali

  • Newbie
  • *
  • Posts: 13
    • View Profile
After a bit of trial and error tracking the libraries used with ldd, the only solution that worked was to delete the included libgmp which forces the application to use the system based libgmp. There were a couple of dependencies that were resolved by installing the libraries from the system repositories and creating some symlinks. Here's what I did at the end:
remove libgmp under ./lib
remove libgfortran under ./lib
remove libopenblas under ./lib

« Last Edit: February 24, 2020, 09:48:35 PM by ihabali »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Hello ihabali,

Removing the lib/libgmp.so.10 should solve the problem. Others could be kept.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ihabali

  • Newbie
  • *
  • Posts: 13
    • View Profile
Thanks Alexey. Leaving the other two libs in place was causing metashape to complain about some system time functions. After removing these two, metashape starts with no errors/warnings at all.

howcanoewang

  • Newbie
  • *
  • Posts: 10
    • View Profile
Hello ihabali,

Removing the lib/libgmp.so.10 should solve the problem. Others could be kept.

Dear Alexey,

Thank you for your solutions, it helped me to successfully run the bash script and saw the GUI. However, when I installed the python.whl and import Metashape in my local python environment, this problem still exists, may you help to check the reason?

The version I used is 1.8.3 pro and related whl.

Thanks.

Code: [Select]
crest@RTX3090AMD:~$ python3
Python 3.8.10 (default, Jun  2 2021, 10:49:15)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Metashape
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/crest/.local/lib/python3.8/site-packages/Metashape/__init__.py", line 3, in <module>
    from .Metashape import *
ImportError: /lib/x86_64-linux-gnu/libhogweed.so.5: undefined symbol: __gmpn_cnd_sub_n