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

Compiling Python bindings from source fails #38

Open
ziadloo opened this issue Mar 11, 2024 · 1 comment
Open

Compiling Python bindings from source fails #38

ziadloo opened this issue Mar 11, 2024 · 1 comment

Comments

@ziadloo
Copy link

ziadloo commented Mar 11, 2024

After applying some shady fixes to the source (documented in issue #37), I tried to compile the Python binding. But that one fails as well.

Before anything, the state of my system:

❯ python --version
Python 3.12.2

❯ pybind11-config --version
2.11.1

These are the steps I've taken:

conda create -n gtn_env
conda activate gtn_env

cd bindings/python
conda install setuptools

python setup.py install

This leads to the following error:

running install
/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running bdist_egg
running egg_info
writing src/bindings/python/gtn.egg-info/PKG-INFO
writing dependency_links to src/bindings/python/gtn.egg-info/dependency_links.txt
writing top-level names to src/bindings/python/gtn.egg-info/top_level.txt
reading manifest file 'src/bindings/python/gtn.egg-info/SOURCES.txt'
writing manifest file 'src/bindings/python/gtn.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
CMake Warning (dev) at CMakeLists.txt:11 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Building Python bindings.
CMake Deprecation Warning at cmake/pybind11Tools.cmake:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  CMakeLists.txt:71 (include)


CMake Warning (dev) at cmake/FindPythonLibsNew.cmake:60 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  cmake/pybind11Tools.cmake:16 (find_package)
  CMakeLists.txt:71 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (0.1s)
CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "gtn".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done (0.0s)
-- Build files have been written to: /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312
[  2%] Performing update step for 'pybind11'
[  4%] Building CXX object CMakeFiles/gtn.dir/gtn/autograd.cpp.o
[  6%] Building CXX object CMakeFiles/gtn.dir/gtn/cpu/creations.cpp.o
[  8%] Building CXX object CMakeFiles/gtn.dir/gtn/cpu/compose.cpp.o
[ 10%] No patch step for 'pybind11'
[ 12%] No configure step for 'pybind11'
[ 14%] No build step for 'pybind11'
[ 17%] No install step for 'pybind11'
[ 19%] Completed 'pybind11'
[ 23%] Built target pybind11
[ 25%] Building CXX object CMakeFiles/gtn.dir/gtn/cpu/functions.cpp.o
[ 27%] Building CXX object CMakeFiles/gtn.dir/gtn/cpu/shortest.cpp.o
[ 29%] Building CXX object CMakeFiles/gtn.dir/gtn/creations.cpp.o
[ 31%] Building CXX object CMakeFiles/gtn.dir/gtn/device.cpp.o
[ 34%] Building CXX object CMakeFiles/gtn.dir/gtn/criterions.cpp.o
[ 36%] Building CXX object CMakeFiles/gtn.dir/gtn/functions.cpp.o
[ 38%] Building CXX object CMakeFiles/gtn.dir/gtn/graph.cpp.o
[ 40%] Building CXX object CMakeFiles/gtn.dir/gtn/parallel/parallel_map.cpp.o
[ 42%] Building CXX object CMakeFiles/gtn.dir/gtn/rand.cpp.o
[ 44%] Building CXX object CMakeFiles/gtn.dir/gtn/utils.cpp.o
[ 46%] Building CUDA object CMakeFiles/gtn.dir/gtn/cuda/creations.cu.o
[ 48%] Building CUDA object CMakeFiles/gtn.dir/gtn/cuda/compose.cu.o
[ 51%] Building CUDA object CMakeFiles/gtn.dir/gtn/cuda/cuda.cu.o
[ 53%] Building CXX object CMakeFiles/gtn.dir/gtn/cuda/functions.cpp.o
[ 55%] Building CUDA object CMakeFiles/gtn.dir/gtn/cuda/shortest.cu.o
[ 57%] Linking CXX static library libgtn.a
[ 57%] Built target gtn
[ 59%] Building CXX object bindings/python/CMakeFiles/functions.dir/gtn/functions.cpp.o
[ 61%] Building CXX object bindings/python/CMakeFiles/graph.dir/gtn/graph.cpp.o
[ 65%] Building CXX object bindings/python/CMakeFiles/utils.dir/gtn/utils.cpp.o
[ 65%] Building CXX object bindings/python/CMakeFiles/device.dir/gtn/device.cpp.o
In file included from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:16,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/attr.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/numpy.h:12,
                 from /home/mehran/tmp/gtn/bindings/python/src/bindings/python/gtn/graph.cpp:11:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h: In function ‘std::string pybind11::detail::error_string()’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h:482:26: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  482 |             frame = frame->f_back;
      |                          ^~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:42,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/common.h:186,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pytypes.h:12,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:13:
/home/mehran/.conda/envs/gtn_env/include/python3.12/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
In file included from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:16,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/attr.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/src/bindings/python/gtn/functions.cpp:8:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h: In function ‘std::string pybind11::detail::error_string()’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h:482:26: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  482 |             frame = frame->f_back;
      |                          ^~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:42,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/common.h:186,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pytypes.h:12,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:13:
/home/mehran/.conda/envs/gtn_env/include/python3.12/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
In file included from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:16,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/attr.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/src/bindings/python/gtn/device.cpp:2:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h: In function ‘std::string pybind11::detail::error_string()’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h:482:26: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  482 |             frame = frame->f_back;
      |                          ^~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:42,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/common.h:186,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pytypes.h:12,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:13:
/home/mehran/.conda/envs/gtn_env/include/python3.12/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
In file included from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:16,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/attr.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:13,
                 from /home/mehran/tmp/gtn/bindings/python/src/bindings/python/gtn/utils.cpp:8:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h: In function ‘std::string pybind11::detail::error_string()’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/type_caster_base.h:482:26: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  482 |             frame = frame->f_back;
      |                          ^~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:42,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/detail/common.h:186,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pytypes.h:12,
                 from /home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/cast.h:13:
/home/mehran/.conda/envs/gtn_env/include/python3.12/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
   22 | typedef struct _frame PyFrameObject;
      |                ^~~~~~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:38:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h: In function ‘pybind11::function pybind11::detail::get_type_override(const void*, const type_info*, const char*)’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:54: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_varnames’; did you mean ‘co_names’?
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                                                      ^~~~~~~~~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
   24 | #define _Py_CAST(type, expr) ((type)(expr))
      |                                      ^~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/cpython/tupleobject.h:28:38: note: in expansion of macro ‘_PyTuple_CAST’
   28 | #define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[(index)])
      |                                      ^~~~~~~~~~~~~
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:29: note: in expansion of macro ‘PyTuple_GET_ITEM’
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                             ^~~~~~~~~~~~~~~~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:38:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h: In function ‘pybind11::function pybind11::detail::get_type_override(const void*, const type_info*, const char*)’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:54: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_varnames’; did you mean ‘co_names’?
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                                                      ^~~~~~~~~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
   24 | #define _Py_CAST(type, expr) ((type)(expr))
      |                                      ^~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/cpython/tupleobject.h:28:38: note: in expansion of macro ‘_PyTuple_CAST’
   28 | #define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[(index)])
      |                                      ^~~~~~~~~~~~~
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:29: note: in expansion of macro ‘PyTuple_GET_ITEM’
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                             ^~~~~~~~~~~~~~~~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:38:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h: In function ‘pybind11::function pybind11::detail::get_type_override(const void*, const type_info*, const char*)’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:54: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_varnames’; did you mean ‘co_names’?
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                                                      ^~~~~~~~~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
   24 | #define _Py_CAST(type, expr) ((type)(expr))
      |                                      ^~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/cpython/tupleobject.h:28:38: note: in expansion of macro ‘_PyTuple_CAST’
   28 | #define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[(index)])
      |                                      ^~~~~~~~~~~~~
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:29: note: in expansion of macro ‘PyTuple_GET_ITEM’
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                             ^~~~~~~~~~~~~~~~
In file included from /home/mehran/.conda/envs/gtn_env/include/python3.12/Python.h:38:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h: In function ‘pybind11::function pybind11::detail::get_type_override(const void*, const type_info*, const char*)’:
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:54: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_varnames’; did you mean ‘co_names’?
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                                                      ^~~~~~~~~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
   24 | #define _Py_CAST(type, expr) ((type)(expr))
      |                                      ^~~~
/home/mehran/.conda/envs/gtn_env/include/python3.12/cpython/tupleobject.h:28:38: note: in expansion of macro ‘_PyTuple_CAST’
   28 | #define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[(index)])
      |                                      ^~~~~~~~~~~~~
/home/mehran/tmp/gtn/bindings/python/build/temp.linux-x86_64-cpython-312/pybind11/src/pybind11/include/pybind11/pybind11.h:2348:29: note: in expansion of macro ‘PyTuple_GET_ITEM’
 2348 |                     locals, PyTuple_GET_ITEM(f_code->co_varnames, 0)
      |                             ^~~~~~~~~~~~~~~~
make[2]: *** [bindings/python/CMakeFiles/utils.dir/build.make:76: bindings/python/CMakeFiles/utils.dir/gtn/utils.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:272: bindings/python/CMakeFiles/utils.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [bindings/python/CMakeFiles/device.dir/build.make:76: bindings/python/CMakeFiles/device.dir/gtn/device.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:218: bindings/python/CMakeFiles/device.dir/all] Error 2
make[2]: *** [bindings/python/CMakeFiles/graph.dir/build.make:76: bindings/python/CMakeFiles/graph.dir/gtn/graph.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:191: bindings/python/CMakeFiles/graph.dir/all] Error 2
make[2]: *** [bindings/python/CMakeFiles/functions.dir/build.make:76: bindings/python/CMakeFiles/functions.dir/gtn/functions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:245: bindings/python/CMakeFiles/functions.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Traceback (most recent call last):
  File "/home/mehran/tmp/gtn/bindings/python/setup.py", line 100, in <module>
    setup(
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/dist.py", line 989, in run_command
    super().run_command(command)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/command/install.py", line 84, in run
    self.do_egg_install()
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/command/install.py", line 132, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/dist.py", line 989, in run_command
    super().run_command(command)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/command/bdist_egg.py", line 167, in run
    cmd = self.call_command('install_lib', warn_dir=0)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/command/bdist_egg.py", line 153, in call_command
    self.run_command(cmdname)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/dist.py", line 989, in run_command
    super().run_command(command)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/command/install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/dist.py", line 989, in run_command
    super().run_command(command)
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/mehran/tmp/gtn/bindings/python/setup.py", line 53, in run
    self.build_extension(ext)
  File "/home/mehran/tmp/gtn/bindings/python/setup.py", line 95, in build_extension
    subprocess.check_call(
  File "/home/mehran/.conda/envs/gtn_env/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.
@ziadloo ziadloo changed the title Python bindings from source fails Compiling Python bindings from source fails Mar 11, 2024
@ziadloo
Copy link
Author

ziadloo commented Mar 11, 2024

Apparently, this is an incompatibility with Python version and the latest Python version that works is 3.10:

conda create -n gtn_env python=3.10.13

This way I managed to at least compile the Python binding. Next, let see if the library works.

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

1 participant