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

wordseg-ag: compilation fatal error: 'ext/stdio_filebuf.h' file not found #15

Open
mmmaat opened this issue Nov 2, 2017 · 4 comments
Open

Comments

@mmmaat
Copy link
Collaborator

mmmaat commented Nov 2, 2017

This issue is related to Adaptor Grammar compilation error on MacOS using the Apple Clang compiler.

A dirty solution for now is to use the GCC compiler instead. Indeed the ext/stdio_filebuf.h is a non-standard C header bundled with GCC, but not with Clang. On Mac it can be installed (gcc-7.1) from http://hpc.sourceforge.net.

Once done, in the cmake output you should have

-- The C compiler identification is GNU someversion
-- The CXX compiler identification is GNU someversion

instead of

-- The C compiler identification is AppleClang someversion
-- The CXX compiler identification is AppleClang someversion

I'm working on a portable solution based on boost::iostreams instead.

@mmmaat mmmaat changed the title compilation fatal error: 'ext/stdio_filebuf.h' file not found wordseg-ag: compilation fatal error: 'ext/stdio_filebuf.h' file not found Dec 6, 2017
@mmmaat
Copy link
Collaborator Author

mmmaat commented Dec 18, 2017

Finally I decided to remove pstream.h from AG. It was called from main.cc only to support the options -U -V -X -Y. They handle stream output to custom shell commands and are useless in the wordseg framework. This change do not impact the AG processing in any case. See commit 0f01c69.

@MQ-MJ
Copy link

MQ-MJ commented Mar 9, 2019

Hi everyone,

I just came across this because someone asked me if they could run adaptor grammars on OS-X. I tried to compile the py-cfg code on a Mac, and discovered exactly this problem.

@mmmaat is right that the adaptor grammar sampler itself will work just fine without the options that let you pipe the output into other commands.

But being able to pipe intermediate results into an evaluation command lets you monitor things like convergence during the run of a sampler.

For my own purposes, I've solved my problem by installing gcc on the Mac. But I can look at making this work on the Mac clang compiler if anyone cares.

It seems that pstreams would be an easy way to get this working across many platforms.

Best,

Mark Johnson

@mmmaat mmmaat reopened this Mar 9, 2019
@mmmaat
Copy link
Collaborator Author

mmmaat commented Mar 9, 2019

Hi Mark, as wordseg uses it's own logging system, I removed dependencies to pstream.h and simply used std::cout / std::cerr. The stream is then forwarded to the Python wrapper of AG (see here).

But the actual version of AG in wordseg still doesn't compile on MacOS (I can't remember why) and the documentation suggests users to run it within docker on Mac and Windows.

But if you want to make the code portable across platforms, you are very welcome to do it, either by implementing a pstreams solution or documenting the instalaltion of a compatible version of GCC under MacOS.

Thanks anyway,
Mathieu

@MQ-MJ
Copy link

MQ-MJ commented Mar 10, 2019 via email

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

No branches or pull requests

2 participants