yfeng95 / face3d

Python tools for 3D face: 3DMM, Mesh processing(transform, camera, light, render), 3D face representations.
2.65k stars 611 forks source link

Mac compile cython error with mesh_core_cython #24

Open Ai-is-light opened 5 years ago

Ai-is-light commented 5 years ago
 "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it by " \

^ mesh_core_cython.cpp:583:10: fatal error: 'ios' file not found

include "ios"

     ^~~~~

2 warnings and 1 error generated. error: command 'gcc' failed with exit status 1

GangHu1993 commented 5 years ago

Could you please give the solution.

christopher-beckham commented 5 years ago

CFLAGS='-stdlib=libc++' python setup.py build_ext -i

huailiang commented 3 years ago

it seems like MacOS 10.10+ cause this kind of problem, so i change 'Extension' in setup.py: ------------------------setup.py:----------------------------- from distutils.core import setup, Extension from Cython.Distutils import build_ext import numpy

setup( name='mesh_core_cython', cmdclass={'build_ext': build_ext}, ext_modules=[Extension("mesh_core_cython", sources=["mesh_core_cython.pyx", "mesh_core.cpp"], language='c++', extra_compile_args=['-stdlib=libc++', '-mmacosx-version-min=10.9','-std=c++11', '-D_hypot=hypot'], extra_link_args=['-stdlib=libc++', '-mmacosx-version-min=10.9','-std=c++11', '-D_hypot=hypot'], include_dirs=[numpy.get_include()])], ) ---------------------------------setup.py--------------------------------------- thx again!