Installation fails on Raspberry Pi 4 8GB with aarch64 Bullseye
State: closed | Pull request: no
Labels: name: stale

Hi I am trying to install NeMo on aarch64 RasberryPi 4 64bit Bulleye. I wonder if anyone have a feasible way to install NeMo and make it run on Raspberry Pi 4?

I try the method **Pip from source**, and I run the `./reinstall.sh`, I found it fails while installing the pynini. Then I follow methods on https://pypi.org/project/pynini/ to install the pynini on my Pi step by step, I have installed the required openfst and  then when I run the `pip install pynini`, I got such error
```
error: invalid cast from type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to type ‘PyObject*’ {aka ‘_object*’}
```

The full error log during installation is shown as below
```
extensions/_pywrapfst.cpp:11529:40: error: invalid cast from type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to type ‘PyObject*’ {aka ‘_object*’}
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |                                        ^~~~~~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:1400:43: note: in definition of macro ‘likely’
 1400 |   #define likely(x)   __builtin_expect(!!(x), 1)
      |                                           ^
/usr/include/python3.9/object.h:130:42: note: in expansion of macro ‘_PyObject_CAST_CONST’
  130 | #define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type)
      |                                          ^~~~~~~~~~~~~~~~~~~~
/usr/include/python3.9/floatobject.h:24:32: note: in expansion of macro ‘Py_IS_TYPE’
   24 | #define PyFloat_CheckExact(op) Py_IS_TYPE(op, &PyFloat_Type)
      |                                ^~~~~~~~~~
extensions/_pywrapfst.cpp:3196:10: note: in expansion of macro ‘PyFloat_CheckExact’
 3196 | ((likely(PyFloat_CheckExact(obj))) ?  PyFloat_AS_DOUBLE(obj) :\
      |          ^~~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:11529:15: note: in expansion of macro ‘__Pyx_PyObject_AsDouble’
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |               ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.9/Python.h:101,
                 from extensions/_pywrapfst.cpp:46:
extensions/_pywrapfst.cpp:11529:40: error: invalid cast from type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to type ‘PyObject*’ {aka ‘_object*’}
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |                                        ^~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.9/floatobject.h:51:51: note: in definition of macro ‘PyFloat_AS_DOUBLE’
   51 | #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
      |                                                   ^~
extensions/_pywrapfst.cpp:11529:15: note: in expansion of macro ‘__Pyx_PyObject_AsDouble’
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |               ^~~~~~~~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:11529:40: error: invalid cast from type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to type ‘PyObject*’ {aka ‘_object*’}
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |                                        ^~~~~~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:1400:43: note: in definition of macro ‘likely’
 1400 |   #define likely(x)   __builtin_expect(!!(x), 1)
      |                                           ^
/usr/include/python3.9/object.h:130:42: note: in expansion of macro ‘_PyObject_CAST_CONST’
  130 | #define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type)
      |                                          ^~~~~~~~~~~~~~~~~~~~
/usr/include/python3.9/longobject.h:16:31: note: in expansion of macro ‘Py_IS_TYPE’
   16 | #define PyLong_CheckExact(op) Py_IS_TYPE(op, &PyLong_Type)
      |                               ^~~~~~~~~~
extensions/_pywrapfst.cpp:3197:9: note: in expansion of macro ‘PyLong_CheckExact’
 3197 |  likely(PyLong_CheckExact(obj)) ?\
      |         ^~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:11529:15: note: in expansion of macro ‘__Pyx_PyObject_AsDouble’
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |               ^~~~~~~~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:11529:40: error: invalid cast from type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to type ‘PyObject*’ {aka ‘_object*’}
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |                                        ^~~~~~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:3198:18: note: in definition of macro ‘__Pyx_PyObject_AsDouble’
 3198 |  PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
      |                  ^~~
extensions/_pywrapfst.cpp:11529:40: error: invalid cast from type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to type ‘PyObject*’ {aka ‘_object*’}
11529 |   __pyx_t_2 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
      |                                        ^~~~~~~~~~~~~~~~~~~~~
extensions/_pywrapfst.cpp:3198:50: note: in definition of macro ‘__Pyx_PyObject_AsDouble’
 3198 |  PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
```
My GCC version is `gcc (Debian 10.2.1-6) 10.2.1 20210110`, and my `python version is 3.9.2`, I am trying to install `openfst 1.8.2` and install `pynini 2.1.5`