Welcome, Guest
Username: Password: Remember me

TOPIC: unable to load the dynamic library _api.so when using TelApy

unable to load the dynamic library _api.so when using TelApy 5 years 7 months ago #33390

Hi, all
I am using telemac v8p0r0 and I want to use the APIs from TelApy. I have installed the metis-5.1.0 and its dynamic version, both libmetis.a and libmetis.so are built.
Moreover, I have successfully compiled Dynamic compilation for TelApy.
However, when I test the example telemac2d.ipynb in the folder of /v8p0r0/scripts/python27/TelApy/notebooks/api, there get some errors about _api.so and METIS_PartMeshDual:

Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import TelApy.api.t2d
>>> import os
>>> HOMETEL = os.environ.get('HOMETEL')
>>> os.chdir(HOMETEL + '/examples/telemac2d/breach')
>>> from TelApy.api.t2d import Telemac2d
>>> from mpi4py import MPI
>>> my_case = Telemac2d('t2d_breach.cas', lang=1, comm=MPI.COMM_WORLD)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/lairuixun/telemac-mascaret/v8p0r0/scripts/python27/TelApy/api/t2d.py", line 56, in __init__
dicofile, lang, stdout, comm, recompile)
File "/home/lairuixun/telemac-mascaret/v8p0r0/scripts/python27/TelApy/api/api_module.py", line 137, in __init__
'\n'+str(execpt))
Exception: Error: unable to load the dynamic library _api.so
You can check the environment variable PYTHONPATH
/home/lairuixun/telemac-mascaret/v8p0r0/builds/ubugfopenmp/wrap_api/lib/libpartel.so: undefined symbol: METIS_PartMeshDual


File Attachment:

File Name: pysource.v8.sh.txt
File Size: 3 KB


File Attachment:

File Name: systel.v8.cfg
File Size: 2 KB
The administrator has disabled public write access.

unable to load the dynamic library _api.so when using TelApy 5 years 7 months ago #33396

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

This looks like the error you would get if metis was actually compiled in static but linked as if it was in dynamic.

What command did you used to compile metis ?

Can you give me the return of the command ldd on _api.so (in builds/<usetelcfg>/wrap_api/lib)
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.

unable to load the dynamic library _api.so when using TelApy 5 years 7 months ago #33398

Hi, yugi. Thanks for your kindly reply.
I followed the instruction on the web that compiled the dynamic version of metis by:
$ cmake -D CMAKE_INSTALL_PREFIX=/home/lairuixun/telemac-mascaret/v8p0r0/optionals/metis-5.1.0/build -DSHARED=TRUE
$ make
$ make install
A libmetis.so was built with size of 507.6 k.
I also checked the return of the command ldd on _api.so in which many undefined symbols including METIS_PartMeshDual(libpartel.so) were founded. The same situation was founded on libpartel.so. However, I don't know how to solve it.

I attached the return of the command on _api.so and libpartel.so, as well as the compiled process of dynamic version of metis-5.1.0.

Thanks!

File Attachment:

File Name: lddon_api.o.txt
File Size: 4 KB



File Attachment:

File Name: lddonlibpartel.so.txt
File Size: 3 KB



File Attachment:

File Name: compiled_metis.txt
File Size: 11 KB


File Attachment:

File Name: compiled_v8p0r0.txt
File Size: 181 KB
The administrator has disabled public write access.

unable to load the dynamic library _api.so when using TelApy 5 years 7 months ago #33406

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
The only thing I can think of is that the LD_LIBRARY_PATH is not set properly.
Even though it looks good in your pysource and telemac compilation works.
Try echo $LD_LIBRARY_PATH and check that the path to metis is in there.

Also try rerunning compileTELEMAC.py --clean.
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
The following user(s) said Thank You: Htun Pyae Sone
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.