njsmith / pysrilm

An extremely simple Python wrapper for the SRI Language Modeling toolkit
BSD 2-Clause "Simplified" License
70 stars 20 forks source link

OSX installation error #8

Closed varunkumar-dev closed 8 years ago

varunkumar-dev commented 8 years ago

I am trying to install on Mac and getting following error.

skipping 'srilm.cpp' Cython extension (up-to-date) building 'srilm' extension cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/Users/varun/trunk/srilm-1.7.1/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c srilm.cpp -o build/temp.macosx-10.11-intel-2.7/srilm.o -fopenmp In file included from srilm.cpp:249: In file included from /Users/varun/trunk/srilm-1.7.1/include/File.h:23: /Users/varun/trunk/srilm-1.7.1/include/zio.h:105:8: error: conflicting types for 'zopen' FILE * zopen (const char name, const char mode); ^ /usr/include/stdio.h:463:7: note: previous declaration is here FILE zopen(const char , const char *, int); ^ srilm.cpp:1968:20: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] pyx_v_length = pyx_t_1; ~ ^~~~~ 1 warning and 1 error generated. error: command 'cc' failed with exit status 1

njsmith commented 8 years ago

The error message is saying that the two files /Users/varun/trunk/srilm-1.7.1/include/zio.h and /usr/include/stdio.h both try to define a function called zopen, and the two definitions are colliding with each other. The first of those files comes from SRILM itself; the second one comes from Apple and is a basic part of the C compiler infrastructure. I have no idea why Apple's stdio.h is defining zopen, but they'll never change that, so I guess you need to file a bug with SRILM asking them to rename their zopen for OS X compatibility.

Unfortunately I don't think there's anything pysrilm can do about this, so closing. Sorry and good luck!