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

mesh_core_cython.cpp:609:10: fatal error: 'ios' file not found #57

Closed
Watebear opened this issue Apr 19, 2019 · 8 comments
Closed

mesh_core_cython.cpp:609:10: fatal error: 'ios' file not found #57

Watebear opened this issue Apr 19, 2019 · 8 comments
Labels

Comments

@Watebear
Copy link

When I use the command "python3 setup.py build_ext -I" , the error was threw as follows:

warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on
the command line to use the libc++ standard library instead
[-Wstdlibcxx-not-found]
In file included from mesh_core_cython.cpp:607:
In file included from /anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:
/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning:
"Using deprecated NumPy API, disable it with " "#define
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with "
^
mesh_core_cython.cpp:609:10: fatal error: 'ios' file not found
#include "ios"
^~~~~
2 warnings and 1 error generated.

There is little methods to solve this question. Help me, please.

@cleardusk
Copy link
Owner

Sorry, I can not reproduce your error. Please check your dependencies first.

@liguohao96
Copy link
Contributor

If you are using mac, try add extra_compile_args=['-std=c++11', '-D_hypot=hypot', '-stdlib=libc++'] in args of 'Extension' in setup.py.

'-std=c++11', '-D_hypot=hypot' is not required, but they could avoid another problem.

@asd25898636
Copy link

@liguohao96 hi there, after i add extra_compile_args=['-std=c++11', '-D_hypot=hypot', '-stdlib=libc++'] in args of 'Extension' in setup.py.
it says:
------------------- log-------------------------
skipping 'mesh_core_cython.cpp' Cython extension (up-to-date)
building 'mesh_core_cython' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/qifeng/anaconda3/envs/py36/include -arch x86_64 -I/Users/qifeng/anaconda3/envs/py36/include -arch x86_64 -I/Users/qifeng/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include -I/Users/qifeng/anaconda3/envs/py36/include/python3.6m -c mesh_core_cython.cpp -o build/temp.macosx-10.7-x86_64-3.6/mesh_core_cython.o -D_hypot=hypot -stdlib=libc++
In file included from mesh_core_cython.cpp:607:
In file included from /Users/qifeng/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/qifeng/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /Users/qifeng/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:
/Users/qifeng/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning:
"Using deprecated NumPy API, disable it with " "#define
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with "
^
1 warning generated.
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/qifeng/anaconda3/envs/py36/include -arch x86_64 -I/Users/qifeng/anaconda3/envs/py36/include -arch x86_64 -I/Users/qifeng/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include -I/Users/qifeng/anaconda3/envs/py36/include/python3.6m -c mesh_core.cpp -o build/temp.macosx-10.7-x86_64-3.6/mesh_core.o -D_hypot=hypot -stdlib=libc++
g++ -bundle -undefined dynamic_lookup -L/Users/qifeng/anaconda3/envs/py36/lib -arch x86_64 -L/Users/qifeng/anaconda3/envs/py36/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/mesh_core_cython.o build/temp.macosx-10.7-x86_64-3.6/mesh_core.o -o /Users/qifeng/Documents/work/3DDFA/utils/cython/mesh_core_cython.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

@liguohao96
Copy link
Contributor

@asd25898636 it seems that Apple replaced libstdc++ with libc++, try using libc++?

@asd25898636
Copy link

asd25898636 commented May 16, 2019

@liguohao96 thx alot! i've solved it~ but 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!

@cleardusk
Copy link
Owner

Solved, thanks for @liguohao96 .

@Jian-danai
Copy link

Then how to solve it in Linux

@Andyzzz
Copy link

Andyzzz commented May 13, 2020

Thanks a lot

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

No branches or pull requests

6 participants