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

Error in installing libgmsh4 after compiling FreeCAD #92

Closed ebrahimraeyat closed 3 years ago

ebrahimraeyat commented 3 years ago

Hi All. When I want to install dependencies in my laptop, It takes me this error:

The following packages have unmet dependencies: libgmsh4 : Depends: libocct-data-exchange-7.3 but it is not going to be installed Depends: libocct-foundation-7.3 but it is not going to be installed Depends: libocct-modeling-algorithms-7.3 but it is not going to be installed Depends: libocct-modeling-data-7.3 but it is not going to be installed Depends: libocct-ocaf-7.3 but it is not going to be installed E: Unable to correct problems, you have held broken packages. I have been installed FreeCAD from source code, and this error appeared. Thanks.

My machine:

OS: Ubuntu 20.04.2 LTS (KDE/plasma) Word size of FreeCAD: 64-bit Version: 0.20.24701 (Git) Build type: Unknown Branch: master Python version: 3.8.5 Qt version: 5.12.8 Coin version: 4.0.0 OCC version: 7.5.1 Locale: English/United States (en_US)

lcpt commented 3 years ago

HI @ebrahimraeyat

The problem is that the ubuntu gmsh package uses an old version of OpenCascade libraries (libooct 7.3) and FreeCAD uses a more recent version (7.5). That's why you get the messages about unmet dependencies.

The solution is to install gmsh directly from sources. You can try the bash script on the XC repository.

lcpt commented 3 years ago

I think I can close the issue. If you have further problems don't hesitate to reopen.

ebrahimraeyat commented 3 years ago

Thanks, @lcpt. I am trying to install gmsh, but it gets me an error. I am finding the solution and didn't want to disturb you:

`ebi@kubuntu20-Lenovo-Z51-70:~/xc/build_xc/build_gmsh$ make -j 3

Scanning dependencies of target shared [ 0%] Building CXX object CMakeFiles/shared.dir/Common/GmshGlobal.cpp.o [ 0%] Building CXX object CMakeFiles/shared.dir/Common/Options.cpp.o [ 0%] Building CXX object CMakeFiles/shared.dir/Common/CommandLine.cpp.o In file included from /usr/include/med_proto.h:33, from /usr/include/med.h:411, from /home/ebi/xc/build_xc/gmsh/Common/CommandLine.cpp:45: /usr/include/medfile.h:51:15: error: ‘MPI_Comm’ does not name a type 51 | const MPI_Comm comm, const MPI_Info info); | ^~~~ /usr/include/medfile.h:51:36: error: ‘MPI_Info’ does not name a type 51 | const MPI_Comm comm, const MPI_Info info); | ^~~~ make[2]: [CMakeFiles/shared.dir/build.make:128: CMakeFiles/shared.dir/Common/CommandLine.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [CMakeFiles/Makefile2:1547: CMakeFiles/shared.dir/all] Error 2 make: [Makefile:163: all] Error 2

ebi@kubuntu20-Lenovo-Z51-70:~/xc/build_xc/build_gmsh$`

I can't find a solution for it. Thanks.

lcpt commented 3 years ago

Hi @ebrahimraeyat

Maybe it's easier to download a precompiled version from the gmsh web page. Apparently there is a pip command that solves the problem.

download_gmsh

Could you try this?

lcpt commented 3 years ago

On the other hand; have you used ENABLE_MPI=0?

cmake -DENABLE_BUILD_DYNAMIC=1 -DENABLE_FLTK=1 -DENABLE_MPI=0 ../gmsh'

see line 31 in gmsh_code_install.sh

ebrahimraeyat commented 3 years ago

On the other hand; have you used ENABLE_MPI=0?

cmake -DENABLE_BUILD_DYNAMIC=1 -DENABLE_FLTK=1 -DENABLE_MPI=0 ../gmsh'

see line 31 in gmsh_code_install.sh

Yes. I ran the script.

lcpt commented 3 years ago

Hum, something is not working as intended.

Have you tried to install the binaries instead?

ebrahimraeyat commented 3 years ago

Yes, I installed it via pip3 install --upgrade gmsh

then link some files:

sudo ln -s /home/ebi/.local/lib/python3.8/site-packages/gmsh-4.8.3-Linux64-sdk/lib/libgmsh.so  /usr/lib/x86_64-linux-gnu/libgmsh.so

sudo ln -s /usr/lib/x86_64-linux-gnu/libgmsh.so /usr/lib/x86_64-linux-gnu/libgmsh.so.4.8

sudo ln -s /home/ebi/.local/lib/python3.8/site-packages/gmsh-4.8.3-Linux64-sdk/include/gmsh.h /usr/include/gmsh.h

the problem solved, but one test fail:

ERROR:root:test_shell_mitc9_02.py ERROR.

lcpt commented 3 years ago

Good news! This test will sometimes fail, there is something wrong with the ShellMITC9 element, but it's not a systematic error (most of the time it works). This makes that error difficult to fix. I think that there is some value that is not initialized or something like this. I don't use this element at all, so I've postponed fixing this error.

ebrahimraeyat commented 3 years ago

Thank you so much @lcpt.

lcpt commented 3 years ago

My pleasure!

lcpt commented 3 years ago

I think we can close this issue.