Closed Baby-Anran closed 1 year ago
I guess you need to update gcc
Hi @Baby-Anran,
look at the error. It's regarding the for loop. The variable declaration within the for loop is not supported. Just move unsigned char i
to it's own line before the for loop and it should be good. You can open a pull request with this change if it worked
Edit: as Daniel pointed out, updating gcc would also be a good solution. Updating python would also be helpful if you want to use the latest releases of asammdf.
An update is probably not required -- the compiler is obviously running in C90 mode.
As a quick fix I would suggest:
Change setup.py
from:
def _get_ext_modules():
modules = [
Extension(
"asammdf.blocks.cutils",
["src/asammdf/blocks/cutils.c"],
include_dirs=[get_include()],
)
]
return modules
to:
def _get_ext_modules():
modules = [
Extension(
"asammdf.blocks.cutils",
["src/asammdf/blocks/cutils.c"],
include_dirs=[get_include()],
extra_compile_args=['-std=c99']
)
]
return modules
Works with gcc and clang, ignored (and not required) by MSVC.
@Baby-Anran does the development branch code work now?
Python version
('python=3.7.0 (default, Aug 9 2022, 12:49:01) \n' '[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]') 'os=Linux-3.10.0-1160.53.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core' 'numpy=1.21.6'
Code
Traceback
Description
My docker container is based on centos7, and has been installed python 3.7, in which I failed to
pip install asammdf==6.4.4
.