diffvg icon indicating copy to clipboard operation
diffvg copied to clipboard

CMake Error at diffvg_generated_diffvg.cpp.o.Release.cmake

Open kilhny opened this issue 1 year ago • 5 comments

CMake Error at diffvg_generated_diffvg.cpp.o.Release.cmake:280 (message): Error generating file /home/users/diffvg/build/temp.linux-x86_64-cpython-38/CMakeFiles/diffvg.dir//./diffvg_generated_diffvg.cpp.o gmake[2]: *** [CMakeFiles/diffvg.dir/build.make:77: CMakeFiles/diffvg.dir/diffvg_generated_diffvg.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:99: CMakeFiles/diffvg.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2 . . .

subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status 2.

kilhny avatar Nov 03 '24 12:11 kilhny

After replacing with gcc,gxx=8.5.0,run [rm -rf build/ mkdir build cd build cmake .. make ]the problem was solved,but if you can't find diffvg or pydiffvg, you can run the python setup.py install again

kilhny avatar Nov 05 '24 14:11 kilhny

same issue with gcc 11.4

-- Build files have been written to: /home/cedric/diffvg/build/temp.linux-x86_64-cpython-312
[ 14%] Building NVCC (Device) object CMakeFiles/diffvg.dir/diffvg_generated_scene.cpp.o
[ 28%] Building NVCC (Device) object CMakeFiles/diffvg.dir/diffvg_generated_diffvg.cpp.o
/home/cedric/diffvg/pybind11/include/pybind11/cast.h(446): error: pointer to incomplete class type "_frame" is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/cast.h(446): error: type name is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/cast.h(446): error: expected an expression

/home/cedric/diffvg/pybind11/include/pybind11/cast.h(448): error: pointer to incomplete class type "_frame" is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/cast.h(448): error: type name is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/cast.h(448): error: expected an expression

/home/cedric/diffvg/pybind11/include/pybind11/cast.h(449): error: pointer to incomplete class type "_frame" is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/pybind11.h(2105): error: class "_ts" has no member "frame"

/home/cedric/diffvg/pybind11/include/pybind11/pybind11.h(2106): error: pointer to incomplete class type "_frame" is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/pybind11.h(2107): error: pointer to incomplete class type "_frame" is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/pybind11.h(2110): error: pointer to incomplete class type "_frame" is not allowed

/home/cedric/diffvg/pybind11/include/pybind11/pybind11.h(2110): error: pointer to incomplete class type "_frame" is not allowed

12 errors detected in the compilation of "/home/cedric/diffvg/diffvg.cpp".
CMake Error at diffvg_generated_diffvg.cpp.o.Release.cmake:280 (message):
  Error generating file
  /home/cedric/diffvg/build/temp.linux-x86_64-cpython-312/CMakeFiles/diffvg.dir//./diffvg_generated_diffvg.cpp.o


gmake[2]: *** [CMakeFiles/diffvg.dir/build.make:77: CMakeFiles/diffvg.dir/diffvg_generated_diffvg.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/diffvg.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
Traceback (most recent call last):
  File "/home/cedric/diffvg/setup.py", line 92, in <module>
    setup(name = 'diffvg',
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 183, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
    dist.run_commands()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
    self.run_command(cmd)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/command/install.py", line 97, in run
    self.do_egg_install()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/command/install.py", line 149, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/command/bdist_egg.py", line 168, in run
    cmd = self.call_command('install_lib', warn_dir=False)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/command/bdist_egg.py", line 154, in call_command
    self.run_command(cmdname)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/command/install_lib.py", line 19, in run
    self.build()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/command/install_lib.py", line 110, in build
    self.run_command('build_ext')
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
  File "/home/cedric/diffvg/setup.py", line 31, in run
    super().run()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 98, in run
    _build_ext.run(self)
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
    self.build_extensions()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions
    self._build_extensions_serial()
  File "/home/cedric/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/cedric/diffvg/setup.py", line 66, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/home/cedric/anaconda3/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status

MartensCedric avatar Nov 12 '24 16:11 MartensCedric

As @kilhny mentions, you need gcc 8. However, gcc 8 has been discontinued for Ubuntu 22.04 and up. It would be great to enable compilation on Ubuntu 22 without going through the hoops of trying to install a discontinued gcc

MartensCedric avatar Nov 12 '24 17:11 MartensCedric

dongrading your gcc version to 9.5.0 and g++ version to 9.5.0 it seems it make it work

patelchaitany avatar Dec 29 '24 17:12 patelchaitany

Updating pybind worked for me https://github.com/pybind/pybind11/releases

loevlie avatar Apr 15 '25 00:04 loevlie