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

x86_64-linux-gnu-gcc: error: ../common/maskApi.c: No such file or directory (solution) #1

Open
WhaSukGO opened this issue Aug 1, 2023 · 5 comments

Comments

@WhaSukGO
Copy link

WhaSukGO commented Aug 1, 2023

Environment

Ubuntu 20.04 / Python 3.7

$ pip3 install halpecocotools

...

      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/Development/AlphaPose_jittor/ENV/lib/python3.7/site-packages/numpy/core/include -Icommon -I/Development/AlphaPose_jittor/ENV/include -I/usr/include/python3.7m -c ../common/maskApi.c -o build/temp.linux-x86_64-3.7/../common/maskApi.o
      x86_64-linux-gnu-gcc: error: ../common/maskApi.c: No such file or directory
      x86_64-linux-gnu-gcc: fatal error: no input files
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

While compiling AlphaPose, I failed to compile halpecocotools.

Fix

After updating setup.py, it compiles succesfully.

from setuptools import setup, Extension
import numpy as np

# To compile and install locally run "python setup.py build_ext --inplace"
# To install library to Python site-packages run "python setup.py build_ext install"

ext_modules = [
    Extension(
        'halpecocotools._mask',
        sources=['common/maskApi.c'], # update this line
        include_dirs = [np.get_include(), 'common'],
        extra_compile_args=[],
    )
]

setup(
    name='halpecocotools',
    packages = ['halpecocotools'],
    package_dir = {'halpecocotools': 'halpecocotools'},
    install_requires=[
        'setuptools>=18.0',
        'cython>=0.27.3',
        'matplotlib>=2.1.0',
    ],
    version='0.0.0',
    description="COCO API for Halpe-Fullbody dataset",
    url="https://github.com/HaoyiZhu/HalpeCOCOAPI",
    ext_modules= ext_modules
)
$ git clone https://github.com/HaoyiZhu/HalpeCOCOAPI.git
$ cd HalpeCOCOAPI/PythonAPI
$ python3 setup.py build develop
@blubs
Copy link

blubs commented Aug 11, 2023

Fixed it for me, thanks!

@Gilmar-Gomes
Copy link

Make a PR!

@Ambrosiussen
Copy link

Just a quick note.. Doing the above doesn't solve the problem for me. The following change however does: a603f16

@ricklove
Copy link

Workaround until this is merged and deployed (using @Ambrosiussen fork):

pip3 install git+https://github.com/Ambrosiussen/HalpeCOCOAPI.git#subdirectory=PythonAPI

@jamesnulliu
Copy link

worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants