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

How to install the PythonWrapper on Raspberry PI after compiling the libCMSISDSP.a library? #232

Open
PhilWareFenTech opened this issue Jan 21, 2025 · 5 comments
Labels
bug Something isn't working question Further information is requested

Comments

@PhilWareFenTech
Copy link

Hi,

Trying to install CMSISDSP with pip install fails on my Raspberry PI 3, so thought I'd compile it myself.
I've run CMake and make and it generated the bin_dsp/libCMSISDSP.a library.

How do I create the python module I can then install to my python3 system?

Thanks,
Phil.

@christophe0606
Copy link
Contributor

@PhilWareFenTech I hope at some point to find the time to deliver a binary version for Raspberry and that uses the Neon optimizations.

At the root (CMSIS-DSP folder where you can see the setup.py file), type:

pip wheel . --no-deps -w dist

You should now have a dist folder containing the package that you can install with a pip install path_to_package

@christophe0606 christophe0606 added the question Further information is requested label Jan 22, 2025
@PhilWareFenTech
Copy link
Author

Thanks for your quick help.

There seems to be a lot of things wrong though.
I added the numpy version check with #prama message;
PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:41:9: note: ‘#pragma message: NPY_API_VERSION is 0x00000013’

So I'm using numpy-2.2

I've tried to pip install numpy-1.25, but it fails the same.
Interestingly it complains the version is still 0x13 - which is numpy v2.2, but my Pip List says it's 1.25, and I verified it with checking the python envirnoment site-packages.

It feels like I've broken something...

(cmsis_env) phil@raspberrypi:~/CMSIS-DSP $ pip wheel . --no-deps -w dist
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/phil/CMSIS-DSP
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: cmsisdsp
  Building wheel for cmsisdsp (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cmsisdsp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [268 lines of output]
      running bdist_wheel
      running build
      running build_py
      copying cmsisdsp/version.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/datatype.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/fixedpoint.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/mfcc.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/__init__.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      running egg_info
      writing cmsisdsp.egg-info/PKG-INFO
      writing dependency_links to cmsisdsp.egg-info/dependency_links.txt
      writing requirements to cmsisdsp.egg-info/requires.txt
      writing top-level names to cmsisdsp.egg-info/top_level.txt
      reading manifest file 'cmsisdsp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'cmsisdsp.egg-info/SOURCES.txt'
      running build_ext
      building 'cmsisdsp_transform' extension
      aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/phil/CMSIS-DSP/Source/TransformFunctions -I/home/phil/CMSIS-DSP/Include -I/home/phil/CMSIS-DSP/PrivateInclude -IPythonWrapper/cmsisdsp_pkg/src -I/tmp/pip-build-env-qqop240n/overlay/lib/python3.11/site-packages/numpy/_core/include -I/home/phil/CMSIS-DSP/cmsis_env/include -I/usr/include/python3.11 -c PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c -o build/temp.linux-aarch64-cpython-311/PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.o -Wno-attributes -Wno-unused-function -Wno-unused-variable -Wno-implicit-function-declaration -DCMSISDSP -D__GNUC_PYTHON__
      In file included from PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:32:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:41:9: note: ‘#pragma message: NPY_API_VERSION is 0x00000013’
         41 | #pragma message("NPY_API_VERSION is " STRINGIFY(NPY_API_VERSION))
            |         ^~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1309:5: error: unknown type name ‘arm_dct4_instance_f32’
       1309 |     arm_dct4_instance_f32 *instance;
            |     ^~~~~~~~~~~~~~~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘arm_dct4_instance_f32_new’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1339:46: error: ‘arm_dct4_instance_f32’ undeclared (first use in this function); did you mean ‘arm_dct4_instance_f32_new’?
       1339 |         self->instance = PyMem_Malloc(sizeof(arm_dct4_instance_f32));
            |                                              ^~~~~~~~~~~~~~~~~~~~~
            |                                              arm_dct4_instance_f32_new
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1339:46: note: each undeclared identifier is reported only once for each function it appears in
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1341:23: error: request for member ‘pTwiddle’ in something not a structure or union
       1341 |         self->instance->pTwiddle = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1342:23: error: request for member ‘pCosFactor’ in something not a structure or union
       1342 |         self->instance->pCosFactor = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1343:23: error: request for member ‘pRfft’ in something not a structure or union
       1343 |         self->instance->pRfft = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1344:23: error: request for member ‘pCfft’ in something not a structure or union
       1344 |         self->instance->pCfft = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘arm_dct4_instance_f32_init’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1364:75: error: request for member ‘N’ in something not a structure or union
       1364 | if (PyArg_ParseTupleAndKeywords(args, kwds, "|hhf", kwlist,&self->instance->N
            |                                                                           ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1365:17: error: request for member ‘Nby2’ in something not a structure or union
       1365 | ,&self->instance->Nby2
            |                 ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1366:17: error: request for member ‘normalize’ in something not a structure or union
       1366 | ,&self->instance->normalize
            |                 ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_f32_N’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘N’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1375:1: note: in expansion of macro ‘GETFIELD’
       1375 | GETFIELD(arm_dct4_instance_f32,N,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_f32_Nby2’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘Nby2’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1376:1: note: in expansion of macro ‘GETFIELD’
       1376 | GETFIELD(arm_dct4_instance_f32,Nby2,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_f32_normalize’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘normalize’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1377:1: note: in expansion of macro ‘GETFIELD’
       1377 | GETFIELD(arm_dct4_instance_f32,normalize,"f");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: At top level:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1395:5: error: unknown type name ‘arm_dct4_instance_q31’
       1395 |     arm_dct4_instance_q31 *instance;
            |     ^~~~~~~~~~~~~~~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘arm_dct4_instance_q31_new’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1425:46: error: ‘arm_dct4_instance_q31’ undeclared (first use in this function); did you mean ‘arm_dct4_instance_q31_new’?
       1425 |         self->instance = PyMem_Malloc(sizeof(arm_dct4_instance_q31));
            |                                              ^~~~~~~~~~~~~~~~~~~~~
            |                                              arm_dct4_instance_q31_new
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1427:23: error: request for member ‘pTwiddle’ in something not a structure or union
       1427 |         self->instance->pTwiddle = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1428:23: error: request for member ‘pCosFactor’ in something not a structure or union
       1428 |         self->instance->pCosFactor = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1429:23: error: request for member ‘pRfft’ in something not a structure or union
       1429 |         self->instance->pRfft = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1430:23: error: request for member ‘pCfft’ in something not a structure or union
       1430 |         self->instance->pCfft = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘arm_dct4_instance_q31_init’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1450:75: error: request for member ‘N’ in something not a structure or union
       1450 | if (PyArg_ParseTupleAndKeywords(args, kwds, "|hhi", kwlist,&self->instance->N
            |                                                                           ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1451:17: error: request for member ‘Nby2’ in something not a structure or union
       1451 | ,&self->instance->Nby2
            |                 ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1452:17: error: request for member ‘normalize’ in something not a structure or union
       1452 | ,&self->instance->normalize
            |                 ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q31_N’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘N’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1461:1: note: in expansion of macro ‘GETFIELD’
       1461 | GETFIELD(arm_dct4_instance_q31,N,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q31_Nby2’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘Nby2’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1462:1: note: in expansion of macro ‘GETFIELD’
       1462 | GETFIELD(arm_dct4_instance_q31,Nby2,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q31_normalize’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘normalize’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1463:1: note: in expansion of macro ‘GETFIELD’
       1463 | GETFIELD(arm_dct4_instance_q31,normalize,"i");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: At top level:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1481:5: error: unknown type name ‘arm_dct4_instance_q15’
       1481 |     arm_dct4_instance_q15 *instance;
            |     ^~~~~~~~~~~~~~~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘arm_dct4_instance_q15_new’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1511:46: error: ‘arm_dct4_instance_q15’ undeclared (first use in this function); did you mean ‘arm_dct4_instance_q15_new’?
       1511 |         self->instance = PyMem_Malloc(sizeof(arm_dct4_instance_q15));
            |                                              ^~~~~~~~~~~~~~~~~~~~~
            |                                              arm_dct4_instance_q15_new
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1513:23: error: request for member ‘pTwiddle’ in something not a structure or union
       1513 |         self->instance->pTwiddle = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1514:23: error: request for member ‘pCosFactor’ in something not a structure or union
       1514 |         self->instance->pCosFactor = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1515:23: error: request for member ‘pRfft’ in something not a structure or union
       1515 |         self->instance->pRfft = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1516:23: error: request for member ‘pCfft’ in something not a structure or union
       1516 |         self->instance->pCfft = NULL;
            |                       ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘arm_dct4_instance_q15_init’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1536:75: error: request for member ‘N’ in something not a structure or union
       1536 | if (PyArg_ParseTupleAndKeywords(args, kwds, "|hhh", kwlist,&self->instance->N
            |                                                                           ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1537:17: error: request for member ‘Nby2’ in something not a structure or union
       1537 | ,&self->instance->Nby2
            |                 ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1538:17: error: request for member ‘normalize’ in something not a structure or union
       1538 | ,&self->instance->normalize
            |                 ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q15_N’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘N’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1547:1: note: in expansion of macro ‘GETFIELD’
       1547 | GETFIELD(arm_dct4_instance_q15,N,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q15_Nby2’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘Nby2’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1548:1: note: in expansion of macro ‘GETFIELD’
       1548 | GETFIELD(arm_dct4_instance_q15,Nby2,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q15_normalize’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:110:47: error: request for member ‘normalize’ in something not a structure or union
        110 |     return(Py_BuildValue(FORMAT,self->instance->FIELD));                      \
            |                                               ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1549:1: note: in expansion of macro ‘GETFIELD’
       1549 | GETFIELD(arm_dct4_instance_q15,normalize,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘cmsis_arm_dct4_init_f32’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:2590:44: error: request for member ‘N’ in something not a structure or union
       2590 |     uint32_t outputLength = selfS->instance->N ;
            |                                            ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘cmsis_arm_dct4_f32’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:2621:44: error: request for member ‘N’ in something not a structure or union
       2621 |     uint32_t outputLength = selfS->instance->N ;
            |                                            ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘cmsis_arm_dct4_init_q31’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:2653:44: error: request for member ‘N’ in something not a structure or union
       2653 |     uint32_t outputLength = selfS->instance->N ;
            |                                            ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘cmsis_arm_dct4_q31’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:2684:44: error: request for member ‘N’ in something not a structure or union
       2684 |     uint32_t outputLength = selfS->instance->N ;
            |                                            ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘cmsis_arm_dct4_init_q15’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:2716:44: error: request for member ‘N’ in something not a structure or union
       2716 |     uint32_t outputLength = selfS->instance->N ;
            |                                            ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘cmsis_arm_dct4_q15’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:2747:44: error: request for member ‘N’ in something not a structure or union
       2747 |     uint32_t outputLength = selfS->instance->N ;
            |                                            ^~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q15_normalize’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1549:1: note: in expansion of macro ‘GETFIELD’
       1549 | GETFIELD(arm_dct4_instance_q15,normalize,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q15_Nby2’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1548:1: note: in expansion of macro ‘GETFIELD’
       1548 | GETFIELD(arm_dct4_instance_q15,Nby2,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q15_N’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1547:1: note: in expansion of macro ‘GETFIELD’
       1547 | GETFIELD(arm_dct4_instance_q15,N,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q31_normalize’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1463:1: note: in expansion of macro ‘GETFIELD’
       1463 | GETFIELD(arm_dct4_instance_q31,normalize,"i");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q31_Nby2’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1462:1: note: in expansion of macro ‘GETFIELD’
       1462 | GETFIELD(arm_dct4_instance_q31,Nby2,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_q31_N’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1461:1: note: in expansion of macro ‘GETFIELD’
       1461 | GETFIELD(arm_dct4_instance_q31,N,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_f32_normalize’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1377:1: note: in expansion of macro ‘GETFIELD’
       1377 | GETFIELD(arm_dct4_instance_f32,normalize,"f");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_f32_Nby2’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1376:1: note: in expansion of macro ‘GETFIELD’
       1376 | GETFIELD(arm_dct4_instance_f32,Nby2,"h");
            | ^~~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c: In function ‘Method_arm_dct4_instance_f32_N’:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:111:1: warning: control reaches end of non-void function [-Wreturn-type]
        111 | }
            | ^
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1375:1: note: in expansion of macro ‘GETFIELD’
       1375 | GETFIELD(arm_dct4_instance_f32,N,"h");
            | ^~~~~~~~
      error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cmsisdsp
Failed to build cmsisdsp
ERROR: Failed to build one or more wheels

@PhilWareFenTech
Copy link
Author

I've cleaned, re-created the PythonWrapper and made the lib.a file again, and run python install .

Although I've checked my numpy install version (1.25), and it checks in the setup.py script that it is 1.25, when the preprocessor runs on the cmsisdsp_module.h file, NPY_API_VERSION is still reporting 0x13 - which is v2.2

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/phil/CMSIS-DSP
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.23.5 in ./cmsis_env/lib/python3.11/site-packages (from cmsisdsp==1.9.9) (1.25.0)
Building wheels for collected packages: cmsisdsp
  Building wheel for cmsisdsp (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for cmsisdsp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [268 lines of output]
      running bdist_wheel
      running build
      running build_py
      copying cmsisdsp/version.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/datatype.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/fixedpoint.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/mfcc.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      copying cmsisdsp/__init__.py -> build/lib.linux-aarch64-cpython-311/cmsisdsp
      running egg_info
      writing cmsisdsp.egg-info/PKG-INFO
      writing dependency_links to cmsisdsp.egg-info/dependency_links.txt
      writing requirements to cmsisdsp.egg-info/requires.txt
      writing top-level names to cmsisdsp.egg-info/top_level.txt
      reading manifest file 'cmsisdsp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'cmsisdsp.egg-info/SOURCES.txt'
      running build_ext
      building 'cmsisdsp_transform' extension
      aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/phil/CMSIS-DSP/Source/TransformFunctions -I/home/phil/CMSIS-DSP/Include -I/home/phil/CMSIS-DSP/PrivateInclude -IPythonWrapper/cmsisdsp_pkg/src -I/tmp/pip-build-env-eol__0h3/overlay/lib/python3.11/site-packages/numpy/_core/include -I/home/phil/CMSIS-DSP/cmsis_env/include -I/usr/include/python3.11 -c PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c -o build/temp.linux-aarch64-cpython-311/PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.o -Wno-attributes -Wno-unused-function -Wno-unused-variable -Wno-implicit-function-declaration -DCMSISDSP -D__GNUC_PYTHON__
      In file included from PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:32:
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h:41:9: note: ‘#pragma message: NPY_API_VERSION is 0x00000013'
         41 | #pragma message("NPY_API_VERSION is " STRINGIFY(NPY_API_VERSION))
            |         ^~~~~~~
      PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_transform.c:1309:5: error: unknown type name ‘arm_dct4_instance_f32’
       1309 |     arm_dct4_instance_f32 *instance;
            |     ^~~~~~~~~~~~~~~~~~~~~

@christophe0606
Copy link
Contributor

I have not rebuilt this wrapper for a long time and it looks like there is a new problem unrelated to NumPy. A commit has removed some functions from CMSIS-DSP that had been deprecated for a few years (like DCT4).

But the Python wrapper has not yet been updated and it looks like it still refers to those function. As consequence it cannot be built.

@christophe0606
Copy link
Contributor

For NumPy "problem", I suggest you create a virtualenv. Install manually the v2.2 version. Build the package from this.

After, the resulting wheel should also work with older Numpy versions.

@christophe0606 christophe0606 added the bug Something isn't working label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants