Agisoft Metashape

Agisoft Metashape => Bug Reports => Topic started by: ihabali on February 23, 2020, 10:12:28 PM

Title: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: ihabali on February 23, 2020, 10:12:28 PM
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?

Title: Re: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: Alexey Pasumansky on February 23, 2020, 11:15:14 PM
Hello ihabali,

Are you starting Metashape in the following way?
Code: [Select]
./metashape.sh
Title: Re: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: ihabali on February 24, 2020, 12:08:08 AM
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?
Title: Re: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: ihabali on February 24, 2020, 04:53:04 PM
Alexey or anyone, any ideas on how to resolve this issue?
Title: Re: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: ihabali on February 24, 2020, 09:28:50 PM
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

Title: Re: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: Alexey Pasumansky on February 26, 2020, 09:18:43 PM
Hello ihabali,

Removing the lib/libgmp.so.10 should solve the problem. Others could be kept.
Title: Re: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: ihabali on February 26, 2020, 09:44:30 PM
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.
Title: Re: metashape: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn
Post by: howcanoewang on June 19, 2022, 09:56:49 AM
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