xcfem / xc

finite element analysis package for civil engineering structures.
http://www.xcengineering.xyz/html_files/software.html
GNU General Public License v3.0
262 stars 54 forks source link

undefined symbol error in importing xc #99

Closed ebrahimraeyat closed 2 years ago

ebrahimraeyat commented 2 years ago

Hi @lcpt. finally I compiled xc on my ubuntu 20.04 in my wsl in windows 10. but one error:

ebrahim@DESKTOP-GT2QLMA:~/xc$ python
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xc_base
>>> import geom
>>> import xc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/ebrahim/xc/build_xc/xc/lib/libXcBib.so: undefined symbol: _ZN4gmsh5model3geo12addCurveLoopERKSt6vectorIiSaIiEEib
>>>

Thanks

lcpt commented 2 years ago

Hi, @ebrahimraeyat. Good work :+1:

I think there is a problem when linking to Gmsh. Could you run sh local_install.sh again, just to be sure that you're linking with the latest compiled libraries?

Cheers.

lcpt commented 2 years ago

It works?

ebrahimraeyat commented 2 years ago

No, I had been installed gmsh with pip and had been linked some library together according to this issue:

https://github.com/xcfem/xc/issues/92#issuecomment-823336313

then I compiled it via linked you sended. but one question:

Is xc_base still is required? beacause in xc_code_install.sh is compiling, but in repo said that it is not required. I examined either both of those, but nothing changed.

I don't have FreeCAD installation on this ubuntu. Thanks.

lcpt commented 2 years ago

Hi, @ebrahimraeyat

I think the headers you're using for gmsh doesn't correspond to the libraries. You can check this by inspecting the GMSH_API_VERSION lines in gmsh.h. In my machine they are as follows:

#define GMSH_API_VERSION_MAJOR 4
#define GMSH_API_VERSION_MINOR 8
#define GMSH_API_VERSION_PATCH 4

The version of the gmsh library version accompanies the file name. You can use locate gmsh.h to find all the header files (maybe you have two versions of the header...).

Have you uninstalled the gmsh package shipped with Ubuntu 20.04?

xc_utils is no longer required, all its code has been integrated into xc. xc_base is a python module that provides some basic classes (geometric primitives, ...). I didn't notice xc_code_install is outdated, thanks for the heads-up.

ebrahimraeyat commented 2 years ago

export of locate gmsh.h

ebrahim@DESKTOP-GT2QLMA:/mnt/c/Users/ebi$ locate gmsh.h
/home/ebrahim/.local/lib/python3.8/site-packages/gmsh-4.8.4-Linux64-sdk/include/gmsh.h
/home/ebrahim/.local/lib/python3.8/site-packages/gmsh-4.8.4-Linux64-sdk/include/gmsh.h_cwrap
/home/ebrahim/xc/gmsh/api/gmsh.h
/home/ebrahim/xc/gmsh/api/gmsh.h_cwrap
/home/ebrahim/xc/gmsh/contrib/Netgen/nglib_gmsh.h
/home/ebrahim/xc/gmsh/contrib/bamg/bamg-gmsh.hpp
/home/ebrahim/xc/gmsh/doc/gmsh.html
/usr/local/include/gmsh.h
/usr/local/include/gmsh.h_cwrap
/usr/share/doc/gmsh-doc/gmsh.html

the content of /usr/local/include/gmsh.h is:

#define GMSH_API_VERSION "4.9.0"
#define GMSH_API_VERSION_MAJOR 4
#define GMSH_API_VERSION_MINOR 9
#define GMSH_API_VERSION_PATCH 0

the content of /home/ebrahim/.local/lib/python3.8/site-packages/gmsh-4.8.4-Linux64-sdk/include/gmsh.h

#define GMSH_API_VERSION "4.8.0"
#define GMSH_API_VERSION_MAJOR 4
#define GMSH_API_VERSION_MINOR 8
#define GMSH_API_VERSION_PATCH 0

I think I must remove some of this gmsh. thanks.

lcpt commented 2 years ago

Yeah, you have a little mess there. You need to clean it up. :)

If I can help, just let me know.

ebrahimraeyat commented 2 years ago

finally I installed it successfully, but some test gives me this error:

(test_uls_checking_aisc_05.py:15708): Gdk-CRITICAL **: 08:11:24.670: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
test test_uls_checking_aisc_05.py: ok.
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

and also when I want to run my previous model, it gives the segmentation fault error, I think it is related to graphic show. I installed xming, but it is not corrected.

lcpt commented 2 years ago

So now it's running. Good news. I think it's better to close this issue, and open a new issue for each new problem. This way, they can serve as a reference for other users with similar problems.