Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in building with setup.py #331

Open
sakshambh opened this issue Jun 25, 2022 · 9 comments
Open

Error in building with setup.py #331

sakshambh opened this issue Jun 25, 2022 · 9 comments

Comments

@sakshambh
Copy link

image
Kindly help me with issue
image

@Ieremie
Copy link

Ieremie commented Aug 2, 2022

You need to install the dependecies

@BjoernBinaer
Copy link

BjoernBinaer commented Aug 12, 2022

This may not be an error caused by missing dependencies. I get the same error messages as @sakshambh, but this is due to a linker bug in the used mmg version (see MmgTools/mmg#85). I get the same error messages and switching to version 5.5.1 or any newer one of mmg does not work directly due to some changes in the method declaration of the following functions:

[...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp: In member function ‘virtual void PyMesh::MMG::Delaunay::run()’:
[...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:45:61: error: too few arguments to function ‘int MMG2D_Set_meshSize(MMG5_pMesh, int, int, int, int)’
   45 |     if (MMG2D_Set_meshSize(mmgMesh,num_points,0,num_segments) != 1) {
      |                                                             ^
In file included from [...]/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from [...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
[...]/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:323:8: note: declared here
  323 |   int  MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int nquad, int na);
      |        ^~~~~~~~~~~~~~~~~~
[...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:86:58: error: too few arguments to function ‘int MMG2D_Get_meshSize(MMG5_pMesh, int*, int*, int*, int*)’
   86 |                 &num_vertices, &num_triangles, &num_edges) !=1) {
      |                                                          ^
In file included from [...]/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from [...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
[...]/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:872:8: note: declared here
  872 |   int  MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* nquad, int* na);
      |        ^~~~~~~~~~~~~~~~~~
[...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp: In member function ‘virtual void PyMesh::MMG::Delaunay::refine(const MatrixFr&)’:
[...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:156:72: error: too few arguments to function ‘int MMG2D_Set_meshSize(MMG5_pMesh, int, int, int, int)’
  156 |     if (MMG2D_Set_meshSize(mmgMesh,num_input_vertices,num_input_faces,0) != 1) {
      |                                                                        ^
In file included from [...]/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from [...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
[...]/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:323:8: note: declared here
  323 |   int  MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int nquad, int na);
      |        ^~~~~~~~~~~~~~~~~~
[...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:216:58: error: too few arguments to function ‘int MMG2D_Get_meshSize(MMG5_pMesh, int*, int*, int*, int*)’
  216 |                 &num_vertices, &num_triangles, &num_edges) !=1) {
      |                                                          ^
In file included from [...]/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from [...]/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
[...]/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:872:8: note: declared here
  872 |   int  MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* nquad, int* na);
      |        ^~~~~~~~~~~~~~~~~~

@mmarras
Copy link

mmarras commented Nov 4, 2022

Similar issue here:

[ 87%] Built target lib_Wires
/home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp: In member function ‘virtual void PyMesh::MMG::Delaunay::run()’:
/home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:45:27: error: too few arguments to function ‘int MMG2D_Set_meshSize(MMG5_pMesh, int, int, int, int)’
   45 |     if (MMG2D_Set_meshSize(mmgMesh,num_points,0,num_segments) != 1) {
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from /home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
/home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:324:8: note: declared here
  324 |   int  MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int nquad, int na);
      |        ^~~~~~~~~~~~~~~~~~
/home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:85:27: error: too few arguments to function ‘int MMG2D_Get_meshSize(MMG5_pMesh, int*, int*, int*, int*)’
   85 |     if (MMG2D_Get_meshSize(mmgMesh,
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~
   86 |                 &num_vertices, &num_triangles, &num_edges) !=1) {
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from /home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
/home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:873:8: note: declared here
  873 |   int  MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* nquad, int* na);
      |        ^~~~~~~~~~~~~~~~~~
/home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp: In member function ‘virtual void PyMesh::MMG::Delaunay::refine(const MatrixFr&)’:
/home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:156:27: error: too few arguments to function ‘int MMG2D_Set_meshSize(MMG5_pMesh, int, int, int, int)’
  156 |     if (MMG2D_Set_meshSize(mmgMesh,num_input_vertices,num_input_faces,0) != 1) {
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from /home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
/home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:324:8: note: declared here
  324 |   int  MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int nquad, int na);
      |        ^~~~~~~~~~~~~~~~~~
/home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:215:27: error: too few arguments to function ‘int MMG2D_Get_meshSize(MMG5_pMesh, int*, int*, int*, int*)’
  215 |     if (MMG2D_Get_meshSize(mmgMesh,
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~
  216 |                 &num_vertices, &num_triangles, &num_edges) !=1) {
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/libmmg.h:38,
                 from /home/ubuntu/python/PyMesh/tools/Triangulation/MMG/Delaunay.cpp:8:
/home/ubuntu/python/PyMesh/python/pymesh/third_party/include/mmg/mmg2d/libmmg2d.h:873:8: note: declared here
  873 |   int  MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* nquad, int* na);
      |        ^~~~~~~~~~~~~~~~~~
gmake[2]: *** [tools/Triangulation/CMakeFiles/lib_Triangulation.dir/build.make:188: tools/Triangulation/CMakeFiles/lib_Triangulation.dir/MMG/Delaunay.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1875: tools/Triangulation/CMakeFiles/lib_Triangulation.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
Traceback (most recent call last):
  File "/home/ubuntu/python/PyMesh/./setup.py", line 106, in <module>
    setup(
  File "/home/ubuntu/miniconda3/envs/aniform/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/home/ubuntu/miniconda3/envs/aniform/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/ubuntu/miniconda3/envs/aniform/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/ubuntu/miniconda3/envs/aniform/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "/home/ubuntu/miniconda3/envs/aniform/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/home/ubuntu/miniconda3/envs/aniform/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.run()
  File "/home/ubuntu/python/PyMesh/./setup.py", line 103, in run
    self.build_pymesh()
  File "/home/ubuntu/python/PyMesh/./setup.py", line 75, in build_pymesh
    self._build(
  File "/home/ubuntu/python/PyMesh/./setup.py", line 97, in _build
    check_call(c.split())
  File "/home/ubuntu/miniconda3/envs/aniform/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j', '4']' returned non-zero exit status 2.

@mmarras
Copy link

mmarras commented Nov 5, 2022

Workaround for compiling mmg, modify line 93 of PyMesh/third_party/mmg/CMakeLists.txt to

SET(CMAKE_C_FLAGS " -Wno-char-subscripts -fcommon ${CMAKE_C_FLAGS}")

to force -fcommon flag for the compiler.

@mmarras
Copy link

mmarras commented Nov 6, 2022

Just saw this is likely duplicate of #255

@A6u7H
Copy link

A6u7H commented Nov 28, 2022

Hey!
First, change mmg version in third_party/mmg. This version of mmg has the correct method signature for MMG2D_Set_meshSize
Second, for solving issues with multiple definition you should add SET(CMAKE_C_FLAGS " -fcommon ${CMAKE_C_FLAGS}") in third_party/mmg/CMakeLists.txt
Third, run ./setup.py build

@liubq7
Copy link

liubq7 commented May 18, 2023

Hey! First, change mmg version in third_party/mmg. This version of mmg has the correct method signature for MMG2D_Set_meshSize Second, for solving issues with multiple definition you should add SET(CMAKE_C_FLAGS " -fcommon ${CMAKE_C_FLAGS}") in third_party/mmg/CMakeLists.txt Third, run ./setup.py build

Hi, may I ask where should I change the mmg version?

@mmarras
Copy link

mmarras commented May 18, 2023

What precisely is unclear? It’s says right there where to put it

“change mmg version in third_party/mmg.”

You clone the repo and in the third_party folder you need to put all the files that the new version of mmg comprises of.

@liubq7
Copy link

liubq7 commented May 18, 2023

What precisely is unclear? It’s says right there where to put it

“change mmg version in third_party/mmg.”

You clone the repo and in the third_party folder you need to put all the files that the new version of mmg comprises of.

Thanks for the answer. I thought there was a version configuration file needs to be edited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants