mzsanford / cld

Language Detection based on Chromium's Compact Language Detector library
http://mzsanford.com/blog/introducing-libcld
BSD 3-Clause "New" or "Revised" License
104 stars 24 forks source link

Error when installing python bindings #12

Closed tamoyal closed 12 years ago

tamoyal commented 12 years ago

I was able to build successfully with source ./build.sh I verified by running ./example and getting this output

----[ Text (detected: ENGLISH) ]----
confiscation of goods is assigned as the penalty part most of the courts consist of members and when it is necessary to bring public cases before a jury of members two courts combine for the purpose the most important cases of all are brought jurors or
----[ Text (detected: HINDI) ]----
नेपाल एसिया मंज अख मुलुक राजधानी काठमाडौं नेपाल अधिराज्य पेरेग्वाय दक्षिण अमेरिका महाद्वीपे मध् यक्षेत्रे एक देश अस् ति फणीश्वर नाथ रेणु फिजी छु दक्षिण प्रशान् त महासागर मंज अख देश बहामास छु केरेबियन मंज अख मुलुख राजधानी नसौ सम् बद्घ विषय बुरुंडी अफ्रीका महाद्वीपे मध् यक्षेत्रे देश अस् ति सम् बद्घ विषय

However when I try to install the python bindings with: python -u ports/python/setup.py build I get this error:

Traceback (most recent call last): File "ports/python/setup.py", line 12, in <module> **pkgconfig('cld')) TypeError: __init__() keywords must be strings

I am using Python 2.7.1 and OS X 10.7.3

tamoyal commented 12 years ago

It turns out that this is just a bad error message. I didn't have pkg-config so installing that solved this part of the problem: brew install pkg-config but I also had to symlink the cld.pc file to an area where pkg-config knew where to look with something like: sudo ln -s /path/to/cld/source/directory/cld.pc /usr/lib/pkgconfig/cld.pc

Now I am getting a different error -


$ python -u setup.py build
running build
running build_ext
building 'cld' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/usr/local/include/cld -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pycldmodule.cc -o build/temp.macosx-10.7-intel-2.7/pycldmodule.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
pycldmodule.cc:9:57: error: encodings/compact_lang_det/compact_lang_det.h: No such file or directory
pycldmodule.cc:10:53: error: encodings/compact_lang_det/ext_lang_enc.h: No such file or directory
pycldmodule.cc:11:30: error: base/string_util.h: No such file or directory
In file included from pycldmodule.cc:12:
cld_encodings.h:10:42: error: encodings/proto/encodings.pb.h: No such file or directory
In file included from pycldmodule.cc:12:
cld_encodings.h:14: error: ‘Encoding’ does not name a type
cld_encodings.h:18: error: ‘ISO_8859_1’ was not declared in this scope
cld_encodings.h:19: error: ‘ISO_8859_2’ was not declared in this scope
cld_encodings.h:20: error: ‘ISO_8859_3’ was not declared in this scope
cld_encodings.h:21: error: ‘ISO_8859_4’ was not declared in this scope
cld_encodings.h:22: error: ‘ISO_8859_5’ was not declared in this scope
cld_encodings.h:23: error: ‘ISO_8859_6’ was not declared in this scope
cld_encodings.h:24: error: ‘ISO_8859_7’ was not declared in this scope
cld_encodings.h:25: error: ‘ISO_8859_8’ was not declared in this scope
cld_encodings.h:26: error: ‘ISO_8859_9’ was not declared in this scope
cld_encodings.h:27: error: ‘ISO_8859_10’ was not declared in this scope
cld_encodings.h:28: error: ‘JAPANESE_EUC_JP’ was not declared in this scope
cld_encodings.h:29: error: ‘JAPANESE_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:30: error: ‘JAPANESE_JIS’ was not declared in this scope
cld_encodings.h:31: error: ‘CHINESE_BIG5’ was not declared in this scope
cld_encodings.h:32: error: ‘CHINESE_GB’ was not declared in this scope
cld_encodings.h:33: error: ‘CHINESE_EUC_CN’ was not declared in this scope
cld_encodings.h:34: error: ‘KOREAN_EUC_KR’ was not declared in this scope
cld_encodings.h:35: error: ‘UNICODE’ was not declared in this scope
cld_encodings.h:36: error: ‘CHINESE_EUC_DEC’ was not declared in this scope
cld_encodings.h:37: error: ‘CHINESE_CNS’ was not declared in this scope
cld_encodings.h:38: error: ‘CHINESE_BIG5_CP950’ was not declared in this scope
cld_encodings.h:39: error: ‘JAPANESE_CP932’ was not declared in this scope
cld_encodings.h:40: error: ‘UTF8’ was not declared in this scope
cld_encodings.h:41: error: ‘UNKNOWN_ENCODING’ was not declared in this scope
cld_encodings.h:42: error: ‘ASCII_7BIT’ was not declared in this scope
cld_encodings.h:43: error: ‘RUSSIAN_KOI8_R’ was not declared in this scope
cld_encodings.h:44: error: ‘RUSSIAN_CP1251’ was not declared in this scope
cld_encodings.h:45: error: ‘MSFT_CP1252’ was not declared in this scope
cld_encodings.h:46: error: ‘RUSSIAN_KOI8_RU’ was not declared in this scope
cld_encodings.h:47: error: ‘MSFT_CP1250’ was not declared in this scope
cld_encodings.h:48: error: ‘ISO_8859_15’ was not declared in this scope
cld_encodings.h:49: error: ‘MSFT_CP1254’ was not declared in this scope
cld_encodings.h:50: error: ‘MSFT_CP1257’ was not declared in this scope
cld_encodings.h:51: error: ‘ISO_8859_11’ was not declared in this scope
cld_encodings.h:52: error: ‘MSFT_CP874’ was not declared in this scope
cld_encodings.h:53: error: ‘MSFT_CP1256’ was not declared in this scope
cld_encodings.h:54: error: ‘MSFT_CP1255’ was not declared in this scope
cld_encodings.h:55: error: ‘ISO_8859_8_I’ was not declared in this scope
cld_encodings.h:56: error: ‘HEBREW_VISUAL’ was not declared in this scope
cld_encodings.h:57: error: ‘CZECH_CP852’ was not declared in this scope
cld_encodings.h:58: error: ‘CZECH_CSN_369103’ was not declared in this scope
cld_encodings.h:59: error: ‘MSFT_CP1253’ was not declared in this scope
cld_encodings.h:60: error: ‘RUSSIAN_CP866’ was not declared in this scope
cld_encodings.h:61: error: ‘ISO_8859_13’ was not declared in this scope
cld_encodings.h:62: error: ‘ISO_2022_KR’ was not declared in this scope
cld_encodings.h:63: error: ‘GBK’ was not declared in this scope
cld_encodings.h:64: error: ‘GB18030’ was not declared in this scope
cld_encodings.h:65: error: ‘BIG5_HKSCS’ was not declared in this scope
cld_encodings.h:66: error: ‘ISO_2022_CN’ was not declared in this scope
cld_encodings.h:67: error: ‘TSCII’ was not declared in this scope
cld_encodings.h:68: error: ‘TAMIL_MONO’ was not declared in this scope
cld_encodings.h:69: error: ‘TAMIL_BI’ was not declared in this scope
cld_encodings.h:70: error: ‘JAGRAN’ was not declared in this scope
cld_encodings.h:71: error: ‘MACINTOSH_ROMAN’ was not declared in this scope
cld_encodings.h:72: error: ‘UTF7’ was not declared in this scope
cld_encodings.h:73: error: ‘BHASKAR’ was not declared in this scope
cld_encodings.h:74: error: ‘HTCHANAKYA’ was not declared in this scope
cld_encodings.h:75: error: ‘UTF16BE’ was not declared in this scope
cld_encodings.h:76: error: ‘UTF16LE’ was not declared in this scope
cld_encodings.h:77: error: ‘UTF32BE’ was not declared in this scope
cld_encodings.h:78: error: ‘UTF32LE’ was not declared in this scope
cld_encodings.h:79: error: ‘BINARYENC’ was not declared in this scope
cld_encodings.h:80: error: ‘HZ_GB_2312’ was not declared in this scope
cld_encodings.h:81: error: ‘UTF8UTF8’ was not declared in this scope
cld_encodings.h:82: error: ‘TAM_ELANGO’ was not declared in this scope
cld_encodings.h:83: error: ‘TAM_LTTMBARANI’ was not declared in this scope
cld_encodings.h:84: error: ‘TAM_SHREE’ was not declared in this scope
cld_encodings.h:85: error: ‘TAM_TBOOMIS’ was not declared in this scope
cld_encodings.h:86: error: ‘TAM_TMNEWS’ was not declared in this scope
cld_encodings.h:87: error: ‘TAM_WEBTAMIL’ was not declared in this scope
cld_encodings.h:88: error: ‘KDDI_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:89: error: ‘DOCOMO_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:90: error: ‘SOFTBANK_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:91: error: ‘KDDI_ISO_2022_JP’ was not declared in this scope
cld_encodings.h:92: error: ‘SOFTBANK_ISO_2022_JP’ was not declared in this scope
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:95: error: expected constructor, destructor, or type conversion before ‘(’ token
pycldmodule.cc:16: error: ‘Encoding’ has not been declared
pycldmodule.cc: In function ‘bool EncodingFromName(const char*, int*)’:
pycldmodule.cc:17: error: ‘NUM_ENCODINGS’ was not declared in this scope
pycldmodule.cc:18: error: ‘base’ has not been declared
pycldmodule.cc:19: error: ‘const struct cld_encoding’ has no member named ‘encoding’
pycldmodule.cc:23: error: ‘UNKNOWN_ENCODING’ was not declared in this scope
pycldmodule.cc: In function ‘PyObject* detect(PyObject*, PyObject*, PyObject*)’:
pycldmodule.cc:70: error: ‘Language’ was not declared in this scope
pycldmodule.cc:70: error: expected `;' before ‘hintLanguageEnum’
pycldmodule.cc:73: error: ‘hintLanguageEnum’ was not declared in this scope
pycldmodule.cc:73: error: ‘UNKNOWN_LANGUAGE’ was not declared in this scope
pycldmodule.cc:74: error: ‘hintLanguageEnum’ was not declared in this scope
pycldmodule.cc:74: error: ‘LanguageFromCode’ was not declared in this scope
pycldmodule.cc:80: error: ‘Encoding’ was not declared in this scope
pycldmodule.cc:80: error: expected `;' before ‘hintEncodingEnum’
pycldmodule.cc:83: error: ‘hintEncodingEnum’ was not declared in this scope
pycldmodule.cc:83: error: ‘UNKNOWN_ENCODING’ was not declared in this scope
pycldmodule.cc:84: error: ‘hintEncodingEnum’ was not declared in this scope
pycldmodule.cc:90: error: expected `;' before ‘language3’
pycldmodule.cc:94: error: expected `;' before ‘sumLang’
pycldmodule.cc:96: error: ‘sumLang’ was not declared in this scope
pycldmodule.cc:96: error: ‘CompactLangDet’ has not been declared
pycldmodule.cc:103: error: ‘hintEncodingEnum’ was not declared in this scope
pycldmodule.cc:104: error: ‘hintLanguageEnum’ was not declared in this scope
pycldmodule.cc:105: error: ‘language3’ was not declared in this scope
pycldmodule.cc:114: error: expected `;' before ‘lang’
pycldmodule.cc:115: error: ‘lang’ was not declared in this scope
pycldmodule.cc:115: error: ‘UNKNOWN_LANGUAGE’ was not declared in this scope
pycldmodule.cc:120: error: ‘lang’ was not declared in this scope
pycldmodule.cc:120: error: ‘ExtLanguageName’ was not declared in this scope
pycldmodule.cc:121: error: ‘ExtLanguageCode’ was not declared in this scope
pycldmodule.cc:129: error: ‘sumLang’ was not declared in this scope
pycldmodule.cc:129: error: ‘ExtLanguageName’ was not declared in this scope
pycldmodule.cc:130: error: ‘ExtLanguageCode’ was not declared in this scope
pycldmodule.cc: In function ‘void initcld()’:
pycldmodule.cc:152: error: ‘NUM_ENCODINGS’ was not declared in this scope
pycldmodule.cc:160: error: ‘NUM_LANGUAGES’ was not declared in this scope
pycldmodule.cc:163: error: ‘Language’ was not declared in this scope
pycldmodule.cc:163: error: ‘LanguageName’ was not declared in this scope
pycldmodule.cc:164: error: expected `)' before ‘langIDX’
pycldmodule.cc:164: error: ‘LanguageCode’ was not declared in this scope
pycldmodule.cc:171: error: ‘EXT_NUM_LANGUAGES’ was not declared in this scope
pycldmodule.cc:171: error: ‘EXT_LANGUAGE_BASE’ was not declared in this scope
pycldmodule.cc:175: error: ‘Language’ was not declared in this scope
pycldmodule.cc:175: error: ‘ExtLanguageName’ was not declared in this scope
pycldmodule.cc:176: error: expected `)' before ‘langIDX’
pycldmodule.cc:176: error: ‘ExtLanguageCode’ was not declared in this scope
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
pycldmodule.cc:9:57: error: encodings/compact_lang_det/compact_lang_det.h: No such file or directory
pycldmodule.cc:10:53: error: encodings/compact_lang_det/ext_lang_enc.h: No such file or directory
pycldmodule.cc:11:30: error: base/string_util.h: No such file or directory
In file included from pycldmodule.cc:12:
cld_encodings.h:10:42: error: encodings/proto/encodings.pb.h: No such file or directory
In file included from pycldmodule.cc:12:
cld_encodings.h:14: error: ‘Encoding’ does not name a type
cld_encodings.h:18: error: ‘ISO_8859_1’ was not declared in this scope
cld_encodings.h:19: error: ‘ISO_8859_2’ was not declared in this scope
cld_encodings.h:20: error: ‘ISO_8859_3’ was not declared in this scope
cld_encodings.h:21: error: ‘ISO_8859_4’ was not declared in this scope
cld_encodings.h:22: error: ‘ISO_8859_5’ was not declared in this scope
cld_encodings.h:23: error: ‘ISO_8859_6’ was not declared in this scope
cld_encodings.h:24: error: ‘ISO_8859_7’ was not declared in this scope
cld_encodings.h:25: error: ‘ISO_8859_8’ was not declared in this scope
cld_encodings.h:26: error: ‘ISO_8859_9’ was not declared in this scope
cld_encodings.h:27: error: ‘ISO_8859_10’ was not declared in this scope
cld_encodings.h:28: error: ‘JAPANESE_EUC_JP’ was not declared in this scope
cld_encodings.h:29: error: ‘JAPANESE_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:30: error: ‘JAPANESE_JIS’ was not declared in this scope
cld_encodings.h:31: error: ‘CHINESE_BIG5’ was not declared in this scope
cld_encodings.h:32: error: ‘CHINESE_GB’ was not declared in this scope
cld_encodings.h:33: error: ‘CHINESE_EUC_CN’ was not declared in this scope
cld_encodings.h:34: error: ‘KOREAN_EUC_KR’ was not declared in this scope
cld_encodings.h:35: error: ‘UNICODE’ was not declared in this scope
cld_encodings.h:36: error: ‘CHINESE_EUC_DEC’ was not declared in this scope
cld_encodings.h:37: error: ‘CHINESE_CNS’ was not declared in this scope
cld_encodings.h:38: error: ‘CHINESE_BIG5_CP950’ was not declared in this scope
cld_encodings.h:39: error: ‘JAPANESE_CP932’ was not declared in this scope
cld_encodings.h:40: error: ‘UTF8’ was not declared in this scope
cld_encodings.h:41: error: ‘UNKNOWN_ENCODING’ was not declared in this scope
cld_encodings.h:42: error: ‘ASCII_7BIT’ was not declared in this scope
cld_encodings.h:43: error: ‘RUSSIAN_KOI8_R’ was not declared in this scope
cld_encodings.h:44: error: ‘RUSSIAN_CP1251’ was not declared in this scope
cld_encodings.h:45: error: ‘MSFT_CP1252’ was not declared in this scope
cld_encodings.h:46: error: ‘RUSSIAN_KOI8_RU’ was not declared in this scope
cld_encodings.h:47: error: ‘MSFT_CP1250’ was not declared in this scope
cld_encodings.h:48: error: ‘ISO_8859_15’ was not declared in this scope
cld_encodings.h:49: error: ‘MSFT_CP1254’ was not declared in this scope
cld_encodings.h:50: error: ‘MSFT_CP1257’ was not declared in this scope
cld_encodings.h:51: error: ‘ISO_8859_11’ was not declared in this scope
cld_encodings.h:52: error: ‘MSFT_CP874’ was not declared in this scope
cld_encodings.h:53: error: ‘MSFT_CP1256’ was not declared in this scope
cld_encodings.h:54: error: ‘MSFT_CP1255’ was not declared in this scope
cld_encodings.h:55: error: ‘ISO_8859_8_I’ was not declared in this scope
cld_encodings.h:56: error: ‘HEBREW_VISUAL’ was not declared in this scope
cld_encodings.h:57: error: ‘CZECH_CP852’ was not declared in this scope
cld_encodings.h:58: error: ‘CZECH_CSN_369103’ was not declared in this scope
cld_encodings.h:59: error: ‘MSFT_CP1253’ was not declared in this scope
cld_encodings.h:60: error: ‘RUSSIAN_CP866’ was not declared in this scope
cld_encodings.h:61: error: ‘ISO_8859_13’ was not declared in this scope
cld_encodings.h:62: error: ‘ISO_2022_KR’ was not declared in this scope
cld_encodings.h:63: error: ‘GBK’ was not declared in this scope
cld_encodings.h:64: error: ‘GB18030’ was not declared in this scope
cld_encodings.h:65: error: ‘BIG5_HKSCS’ was not declared in this scope
cld_encodings.h:66: error: ‘ISO_2022_CN’ was not declared in this scope
cld_encodings.h:67: error: ‘TSCII’ was not declared in this scope
cld_encodings.h:68: error: ‘TAMIL_MONO’ was not declared in this scope
cld_encodings.h:69: error: ‘TAMIL_BI’ was not declared in this scope
cld_encodings.h:70: error: ‘JAGRAN’ was not declared in this scope
cld_encodings.h:71: error: ‘MACINTOSH_ROMAN’ was not declared in this scope
cld_encodings.h:72: error: ‘UTF7’ was not declared in this scope
cld_encodings.h:73: error: ‘BHASKAR’ was not declared in this scope
cld_encodings.h:74: error: ‘HTCHANAKYA’ was not declared in this scope
cld_encodings.h:75: error: ‘UTF16BE’ was not declared in this scope
cld_encodings.h:76: error: ‘UTF16LE’ was not declared in this scope
cld_encodings.h:77: error: ‘UTF32BE’ was not declared in this scope
cld_encodings.h:78: error: ‘UTF32LE’ was not declared in this scope
cld_encodings.h:79: error: ‘BINARYENC’ was not declared in this scope
cld_encodings.h:80: error: ‘HZ_GB_2312’ was not declared in this scope
cld_encodings.h:81: error: ‘UTF8UTF8’ was not declared in this scope
cld_encodings.h:82: error: ‘TAM_ELANGO’ was not declared in this scope
cld_encodings.h:83: error: ‘TAM_LTTMBARANI’ was not declared in this scope
cld_encodings.h:84: error: ‘TAM_SHREE’ was not declared in this scope
cld_encodings.h:85: error: ‘TAM_TBOOMIS’ was not declared in this scope
cld_encodings.h:86: error: ‘TAM_TMNEWS’ was not declared in this scope
cld_encodings.h:87: error: ‘TAM_WEBTAMIL’ was not declared in this scope
cld_encodings.h:88: error: ‘KDDI_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:89: error: ‘DOCOMO_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:90: error: ‘SOFTBANK_SHIFT_JIS’ was not declared in this scope
cld_encodings.h:91: error: ‘KDDI_ISO_2022_JP’ was not declared in this scope
cld_encodings.h:92: error: ‘SOFTBANK_ISO_2022_JP’ was not declared in this scope
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:93: error: too many initializers for ‘const cld_encoding’
cld_encodings.h:95: error: expected constructor, destructor, or type conversion before ‘(’ token
pycldmodule.cc:16: error: ‘Encoding’ has not been declared
pycldmodule.cc: In function ‘bool EncodingFromName(const char*, int*)’:
pycldmodule.cc:17: error: ‘NUM_ENCODINGS’ was not declared in this scope
pycldmodule.cc:18: error: ‘base’ has not been declared
pycldmodule.cc:19: error: ‘const struct cld_encoding’ has no member named ‘encoding’
pycldmodule.cc:23: error: ‘UNKNOWN_ENCODING’ was not declared in this scope
pycldmodule.cc: In function ‘PyObject* detect(PyObject*, PyObject*, PyObject*)’:
pycldmodule.cc:70: error: ‘Language’ was not declared in this scope
pycldmodule.cc:70: error: expected `;' before ‘hintLanguageEnum’
pycldmodule.cc:73: error: ‘hintLanguageEnum’ was not declared in this scope
pycldmodule.cc:73: error: ‘UNKNOWN_LANGUAGE’ was not declared in this scope
pycldmodule.cc:74: error: ‘hintLanguageEnum’ was not declared in this scope
pycldmodule.cc:74: error: ‘LanguageFromCode’ was not declared in this scope
pycldmodule.cc:80: error: ‘Encoding’ was not declared in this scope
pycldmodule.cc:80: error: expected `;' before ‘hintEncodingEnum’
pycldmodule.cc:83: error: ‘hintEncodingEnum’ was not declared in this scope
pycldmodule.cc:83: error: ‘UNKNOWN_ENCODING’ was not declared in this scope
pycldmodule.cc:84: error: ‘hintEncodingEnum’ was not declared in this scope
pycldmodule.cc:90: error: expected `;' before ‘language3’
pycldmodule.cc:94: error: expected `;' before ‘sumLang’
pycldmodule.cc:96: error: ‘sumLang’ was not declared in this scope
pycldmodule.cc:96: error: ‘CompactLangDet’ has not been declared
pycldmodule.cc:103: error: ‘hintEncodingEnum’ was not declared in this scope
pycldmodule.cc:104: error: ‘hintLanguageEnum’ was not declared in this scope
pycldmodule.cc:105: error: ‘language3’ was not declared in this scope
pycldmodule.cc:114: error: expected `;' before ‘lang’
pycldmodule.cc:115: error: ‘lang’ was not declared in this scope
pycldmodule.cc:115: error: ‘UNKNOWN_LANGUAGE’ was not declared in this scope
pycldmodule.cc:120: error: ‘lang’ was not declared in this scope
pycldmodule.cc:120: error: ‘ExtLanguageName’ was not declared in this scope
pycldmodule.cc:121: error: ‘ExtLanguageCode’ was not declared in this scope
pycldmodule.cc:129: error: ‘sumLang’ was not declared in this scope
pycldmodule.cc:129: error: ‘ExtLanguageName’ was not declared in this scope
pycldmodule.cc:130: error: ‘ExtLanguageCode’ was not declared in this scope
pycldmodule.cc: In function ‘void initcld()’:
pycldmodule.cc:152: error: ‘NUM_ENCODINGS’ was not declared in this scope
pycldmodule.cc:160: error: ‘NUM_LANGUAGES’ was not declared in this scope
pycldmodule.cc:163: error: ‘Language’ was not declared in this scope
pycldmodule.cc:163: error: ‘LanguageName’ was not declared in this scope
pycldmodule.cc:164: error: expected `)' before ‘langIDX’
pycldmodule.cc:164: error: ‘LanguageCode’ was not declared in this scope
pycldmodule.cc:171: error: ‘EXT_NUM_LANGUAGES’ was not declared in this scope
pycldmodule.cc:171: error: ‘EXT_LANGUAGE_BASE’ was not declared in this scope
pycldmodule.cc:175: error: ‘Language’ was not declared in this scope
pycldmodule.cc:175: error: ‘ExtLanguageName’ was not declared in this scope
pycldmodule.cc:176: error: expected `)' before ‘langIDX’
pycldmodule.cc:176: error: ‘ExtLanguageCode’ was not declared in this scope
lipo: can't open input file: /var/folders/z9/66j8wqbd11n_ks7m_x3fq95h0000gn/T//ccRGs61l.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1

I haven't had a chance to dig into this yet but any insight would be greatly appreciated. It seems like there's just some missing configuration in the installation instructions. Thanks!

dwnoble commented 12 years ago

Got this working on OS X 10.7.2:

After cloning the repo, move it to /usr/local/include/cld/ $ git clone https://github.com/mzsanford/cld.git $ sudo mv cld/ /usr/local/include/

Now move to that directory and build the project $ cd /usr/local/include/cld/ $ export ARCHFLAGS="-arch x86_64" $ sudo ./build.sh

Next copy the libcld.a to /usr/local/lib/cld/ $ sudo cp libcld.a /usr/local/lib/cld/

Then build the python module... $ cd ports/python $ sudo python -u setup.py build

Install and run tests $ sudo python -u setup.py install $ python -u test.py

And you should be good to go

mzsanford commented 12 years ago

Thanks @dwnoble, my Python is very crappy so I didn't know what to test for. I'll use the steps everybody provided to try and get the install working better and the docs in order.

mzsanford commented 12 years ago

I believe I have the Python installation instruction working correctly now. The main issue was that the C++ library needed to be installed first and that was causing some confusion. Can you confirm is the instructions in the blog postwork for you?

toddwilson commented 11 years ago

On Centos 6.2 and likely RHEL, pkg-config doesn't know to look in /usr/local/lib/pkgconfig, so run this before building the python binding:

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"
Casyfill commented 10 years ago

oh, I have the same problem here, even with the solution by dwnoble - same thing

alibozorgkhan commented 9 years ago

I had the same problem (after following the instructions step by step). I fixed the issue by reinstalling libcld:

brew uninstall libcld
brew install libcld

FYI, my OS version is 10.9.5 and I'm using Python 2.7.5.