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

Compile error: ‘setTransfiniteAutomatic’ is not a member of ‘gmsh::model::mesh’ #98

Closed ebrahimraeyat closed 2 years ago

ebrahimraeyat commented 2 years ago

Hi @lcpt .

when I want to compile xc on my Ubuntu 20.04 this error appears:

[ 97%] Building CXX object CMakeFiles/XcBib.dir/preprocessor/set_mgmt/SetEntities.cc.o
/home/ebrahim/xc/build_xc/xc/src/preprocessor/set_mgmt/SetEntities.cc: In member function ‘void XC::SetEntities::gen_mesh_gmsh(const string&)’:
/home/ebrahim/xc/build_xc/xc/src/preprocessor/set_mgmt/SetEntities.cc:705:24: error: ‘setTransfiniteAutomatic’ is not a member of ‘gmsh::model::mesh’; did you mean ‘setTransfiniteSurface’?
  705 |     gmsh::model::mesh::setTransfiniteAutomatic();
      |                        ^~~~~~~~~~~~~~~~~~~~~~~
      |                        setTransfiniteSurface
/home/ebrahim/xc/build_xc/xc/src/preprocessor/set_mgmt/SetEntities.cc:716:15: warning: unused variable ‘numElements’ [-Wunused-variable]
  716 |     const int numElements= create_elements_from_gmsh(mapNodes);
      |               ^~~~~~~~~~~
[ 98%] Building CXX object CMakeFiles/XcBib.dir/preprocessor/set_mgmt/Set.cc.o
make[2]: *** [CMakeFiles/XcBib.dir/build.make:16339: CMakeFiles/XcBib.dir/preprocessor/set_mgmt/SetEntities.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:202: CMakeFiles/XcBib.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

also I installed gmsh from pip, but the error still exist. thanks.

lcpt commented 2 years ago

Hi, @ebrahimraeyat.

Yes, that's a known problem: the Ubuntu packaged version of gmsh is too old (sorry). You need to install gmsh 4.8.4 or newer. This is also a workaround to this problem.

I must instruct CMake to issue a warning about this.

ebrahimraeyat commented 2 years ago

Thanks. If I install gmsh with pip, must be there an issue?

lcpt commented 2 years ago

I think pip installs only the python modules. You need the C++ headers.