Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.
This repository was archived by the owner on Mar 9, 2023. It is now read-only.

sudachipy/lattice.pyx:35:12: Assignment to const attribute 'connect_costs' #161

Description

@tien-le

Hi,
After building the latest codes from git (branch "develop"), I have the following issue:

$ python setup.py build_ext --inplace

running build_ext
skipping 'sudachipy/latticenode.c' Cython extension (up-to-date)
cythoning sudachipy/lattice.pyx to sudachipy/lattice.c

Error compiling Cython file:
------------------------------------------------------------
...
        cdef LatticeNode bos_node = LatticeNode()
        bos_params = grammar.get_bos_parameter()
        bos_node.set_parameter(bos_params[0], bos_params[1], bos_params[2])
        bos_node.is_connected_to_bos = True
        self.end_lists.append([bos_node])
        self.connect_costs = self.grammar._matrix_view
           ^
------------------------------------------------------------

sudachipy/lattice.pyx:35:12: Assignment to const attribute 'connect_costs'

Error compiling Cython file:
------------------------------------------------------------
...
    __pyx_result = Lattice.__new__(__pyx_type)
    if __pyx_state is not None:
        __pyx_unpickle_Lattice__set_state(<Lattice> __pyx_result, __pyx_state)
    return __pyx_result
cdef __pyx_unpickle_Lattice__set_state(Lattice __pyx_result, tuple __pyx_state):
    __pyx_result.capacity = __pyx_state[0]; __pyx_result.connect_costs = __pyx_state[1]; __pyx_result.end_lists = __pyx_state[2]; __pyx_result.eos_node = __pyx_state[3]; __pyx_result.eos_params = __pyx_state[4]; __pyx_result.grammar = __pyx_state[5]; __pyx_result.size = __pyx_state[6]
                                                       ^
------------------------------------------------------------

(tree fragment):10:56: Assignment to const attribute 'connect_costs'
building 'sudachipy.lattice' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/user/python/include/python3.6m -c sudachipy/lattice.c -o build/temp.linux-x86_64-3.6/sudachipy/lattice.o
sudachipy/lattice.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
 #error Do not use this file, it is the result of a failed Cython compilation.
  ^~~~~
error: command 'gcc' failed with exit status 1

Can you show me how to tackle the above issue, please?
Thanks advance for your help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions