Closed TruongKhang closed 5 years ago
can you try changing setup.py
based on this issue?
I've helped him yesterday @txdat. I also did some updates for the builiding and I think I will do one more update to actually pass compiler flags to python builder from CMAKE (because CMAKE knows platform-dependend flags better). For now he hotfixed it by fixing setup.py in his local copy.
i have same problem @@. Please tell me how to fix issue
specially thank @bachan. @hoangtubatu123 you should change file setup.py to this:
from __future__ import absolute_import, division, print_function`
from Cython.Distutils import build_ext
from distutils.core import setup
from distutils.extension import Extension
import os
os.environ['CC'] = 'g++'
os.environ['CXX'] = 'g++'
ext_modules = [
Extension(
name="CocCocTokenizer",
sources=["CocCocTokenizer.pyx"],
extra_compile_args=["-Wno-cpp", "-Wno-unused-function", "-O2", "-march=native", '-stdlib=libc++', '-std=c++11'],
extra_link_args=["-O2", "-march=native", '-stdlib=libc++'],
language="c++",
include_dirs=["."],
)
]
setup(
name="coccoc-tokenizer", ext_modules=ext_modules, cmdclass={"build_ext": build_ext}
)
Or I see @bachan has changed the building for python. You can try that first
My last patch will still not work on MacOS, so for now just @hoangtubatu123 just use workaround from @TruongKhang, please. :)
I will release the code to pass build options from cmake to python tonight or tomorrow. Then we will test with @TruongKhang's Mac (I don't have a Mac, don't like them haha)
yes. thanks you. Bug in mojave version
Workaround for me I'm using macOS mojave
I've just added the same workaround into build_python.sh, now you can build using:
$ cmake -DBUILD_PYTHON=1 ..
# make install
README.md is also updated.
I got this error. Please help me to fix this:
running install running build running build_ext skipping 'CocCocTokenizer.cpp' Cython extension (up-to-date) building 'CocCocTokenizer' extension gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lap00986/anaconda3/include -arch x86_64 -I/Users/lap00986/anaconda3/include -arch x86_64 -I. -I/Users/lap00986/Documents/product-matching/env/include -I/Users/lap00986/anaconda3/include/python3.7m -c CocCocTokenizer.cpp -o build/temp.macosx-10.7-x86_64-3.7/CocCocTokenizer.o -Wno-cpp -Wno-unused-function -O2 -march=native 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] CocCocTokenizer.cpp:610:10: fatal error: 'ios' file not found
include "ios"
1 warning and 1 error generated. error: command 'gcc' failed with exit status 1