njsmith / pysrilm

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

-fopenmp, zopen error #9

Open lucasrodes opened 8 years ago

lucasrodes commented 8 years ago

Hi, I am using Mac OSX El Capitan and when executing python setup.py install I get the following error:

/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Volumes/Macintosh/Users/lucasrodes/Documents/Exercise_2/srilm/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c srilm.cpp -o build/temp.macosx-10.6-intel-2.7/srilm.o -fopenmp clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' error: command '/usr/bin/clang' failed with exit status 1

I read the other issues and I replaced in the setup.py file ['-fopenmp'] for [] but another error appeared:

/Volumes/Macintosh/Users/lucasrodes/Documents/Exercise_2/srilm/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); ^ 1 error generated. error: command '/usr/bin/clang' failed with exit status 1

Any ideas?

njsmith commented 8 years ago

That's a conflict between SRILM code (srilm/include/zio.h) and OS X system code (/usr/include/stdio.h) -- not much that pysrilm can do about it as far as I can see :-(. pysrilm doesn't even include either of those files itself. I guess you could try filing a bug upstream with the SRILM maintainers?

I just went googling and the first thing was you running into the same bug with a different srilm wrapper... https://github.com/desilinguist/swig-srilm/issues/6 which makes sense, since it's not a bug in the wrapper but rather a bug in SRILM itself. Good luck?

lucasrodes commented 8 years ago

Thanks for the quick response! I'll take a look. I am currently trying to make to work lots of bindings but none seem to work...

njsmith commented 8 years ago

I am currently trying to make to work lots of bindings but none seem to work...

Yes, because the problem is on SRILM, not in the bindings :-). You need to contact srilm-user@speech.sri.com as described at the bottom of the SRILM home page: http://www.speech.sri.com/projects/srilm/