chaoyuaw / pytorch-coviar

Compressed Video Action Recognition
https://www.cs.utexas.edu/~cywu/projects/coviar/
GNU Lesser General Public License v2.1
500 stars 126 forks source link

error: command 'aarch64-linux-gnu-gcc' failed with exit status 1 #51

Closed luyao777 closed 5 years ago

luyao777 commented 5 years ago

Hi, there are some problems when I tried sudo bash install.sh in data_loader:

coviar_data_loader.c:586:15: error: variable ‘coviarmodule’ has initializer but incomplete e type static struct PyModuleDef coviarmodule = {

coviar_data_loader.c:587:5: error: ‘PyModuleDef_HEAD_INIT’ undeclared here (not in a function) PyModuleDef_HEAD_INIT,

error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

And I have tried the method mentioned in #33 But it still doesn't work

Do you have any suggestions? Thanks! :blush:

luyao777 commented 5 years ago

According to the Stackoverflow Answer

you are trying to build with using python2.7 and some of the definitions (PyModuleDef_HEAD_INIT) belongs to >= python3. And there may be a copy paste error on static struct PyModuleDef hellomodule definition. "," is missing after each parameter. – seartun

I modified the install.sh in data_loader:

rm -rf build
python3 setup.py build_ext
python3 setup.py install --user

It worked! :tada: :tada:

Dreamer312 commented 2 years ago

您好呢老哥,我编译的时候也遇到了问题,我是从git上下载的ffmpeg,编译,然后默认安装到了 /usr/local/lib, 然后我改了setup extra_link_args=['-lavutil', '-lavcodec', '-lavformat', '-lswscale', '-L/usr/local/lib/'] 不过似乎不能编译,还是我哪里搞错了,没有太懂他说的setup应该怎么改路径