-
Notifications
You must be signed in to change notification settings - Fork 53
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
Compilation fails under OS X 10.9 (Mavericks) #19
Comments
Tricky to debug for me since I don't have access to any OS X machines. Do you know if |
It is, in fact in multiple locations:
I am running make with |
Does this command help?
If so, those paths have somehow fallen out of the default include search path. |
It didn't, I get the same error. But if I add
The full error log seems to long to attach (warnings and notes are in there, too; if I'm wrong I can of course still put it here), so here it is on pastebin: http://pastebin.com/Vgv7euF4 |
Very strange. Those error messages look like they came from clang++, not g++. In fact, if I search for |
I think you're on to something. It prints
even if I preface the command with CXX=g++ |
I installed g++ with Macports, |
Sounds like it might be some |
Does the command succeed if you run the That is, in
|
It doesn't. I selected GNU's g++ with macports, but g++ still points to clang. If I use g++-mp-4.9 in your command, I get:
|
Somehow even your On the other hand, I don't think there's much I can do on the BLLIP parser side (short of making BLLIP parser compile under |
Wouldn't it be plausible to leave the issue open as a "known issue" and close it when somebody has found a satisfactory solution? |
I guess I'm fine with that. It should probably be reported as an upstream bug (I suspect it already has). By the way, have other Mac OS X 10.9 users been able to replicate this? |
I can confirm that I got exactly the same error as reported at the start of this thread (OS X 10.9.2). |
Thanks for the report, @emsrc. Have you tried installing |
I tried with the g++ from MacPorts that I have currently installed (g++-mp-4.7 (MacPorts gcc47 4.7.3_3) 4.7.3) using
This also gives me an error:
|
I've made a PR to share my Mac OS X setup. I use MacPorts over Homebrew because of libLBFGS and because I use HTCondor (which are in the former but not the latter). |
Awesome, thanks @jimwhite! Great to have a branch that works for OS X users. I'd like to update the main README (and eventually the build process) with information about what users need to do to run on OS X. Am I right that it's these steps?
In general, it seems like I should change the |
Yup. Basically just need to make sure we've got the compiler variables set and that they get down to all the subproject makefiles. I've streamlined the changes a bit and also chased down exactly what's going wrong. The -mno-avx fix is not the ideal solution but is good enough for now. |
And yeah, you could merge the PR into a new branch (maybe MACOSX or such) which we can maintain as a simple starter for folks until a suitable solution for the master is sorted out. |
Works for me. Thanks a lot, @jimwhite! |
Sorry for bumping (I found this thread in searching "clang stdio_filebuf"). |
Thanks for the tip, I'll look into it further when I'm back with my Maverick machine. I've been under the impression that there are other gcc-specific issues with this program, but if this stdlib fix will do the trick then that is definitely the way to go. I've got some other improvements to this PR that I'll be pushing in a few days in any case. |
Thanks for the information @cielavenir! @jimwhite, I'm curious to see if it helps on Maverick. At least on RHEL Linux, it doesn't seem to be enough to get |
I've polished up the PR and verified it works for both Mountain Lion and Mavericks on my MacBooks (both of which are Core i7) and still works on Linux. There are several key fixes in addition to using the MacPort of gcc. I've not tried out the clang/stdlib stuff and may not get to that after all because this setup is satisfactory for my purposes. |
Then perhaps that should be better because we should not depend on ext/stdio_filebuf anyway. I had a similar problem in my project and I used http://www.josuttis.com/cppcode/fdstream.html. |
@dmcc I suppose you are trying to link libc++ .o and libstdc++ .o, which is not possible. |
With #44 and other changes, I'm hoping that BLLIP compiles with Users with OS X who haven't installed |
|
Thanks for checking @L3viathan! If you run For the Python side, I'm afraid compiling from the Git checkout will require |
Brew-installed libiomp and ran it like you said, but it gave the same error. The Python version seemed to work (i.e. didn't throw errors) but it didn't build completely, as you said. |
Does the fix mentioned in apache/mxnet#749 (comment) help the |
That means I do
? |
@L3viathan, thanks for checking. @didzis, do you have any ideas? |
@L3viathan, if you want to build with clang (recommended) and have the @dmcc, one of the recent commits (e0e34cf) introduced |
@didzis It still doesn't work. I changed that flag, and afterwards when it didn't work also the other one ( During compilation, I noticed several |
@didzis Ah, I see. In e0e34cf#diff-b67911656ef5d18c4ae36cb6741b7965R83 I should have set |
@L3viathan I tested it on a clean machine. Either you have a different libomp version installed (please check for any libomp/libiomp versions you might have in That @dmcc That will help! Compiling with clang one must remember to correctly set |
@didzis Before compiling I deleted the directory and re-cloned it. In I don't really need bllip anymore, I'm just trying to help figure this out, since it was me who opened the issue originally. If it works for everyone else on OS X, I'm fine with that. |
@L3viathan Maybe you have a different error, it's not possible to infer the real error from |
@didzis Ah, sorry, it still doesn't find the library: |
@L3viathan You can try this |
Per discussion in #19 (doesn't fix the bug, but will make it easier to build on OS X without modifying the Makefile)
Hi dmcc and dizis - Did the bllip work for anyone using Clang in Yosemite? I can see the branch by Jim but was curious if you were successful with Clang. |
Hi @faisal33 , it does work compiled with Clang in Yosemite, I do use the Python API. |
This is what I get when I try to install BLLIP with python in my mac. This same error continues to occur even after I changed from Clang to gcc using both brew and macports. Command "/Users/faisalfayyaz/anaconda/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/sp/_jdn22fs7gd838jnh2rh65fr0000gn/T/pip-build-5T5Y8e/bllipparser/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/sp/_jdn22fs7gd838jnh2rh65fr0000gn/T/pip-E8ODa2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/sp/_jdn22fs7gd838jnh2rh65fr0000gn/T/pip-build-5T5Y8e/bllipparser |
There is some extra effort needed to get it working with Clang on OS X: |
Hey Thanks I will definitely give it a try on Anaconda and see how it goes. Thank You for your input |
@faisal33 Thanks! Please let us know what you find as I'm sure others have this question as well. |
@L3viathan have your tried xcode-select --install after getting the assert.h error? that solved my problem |
@zilunpeng I had the Xcode commandline tools installed already, so that didn't work. But for some reason (I assume something I did unrelated to this) compilation works for me now. |
My environment: The compiler seems to use
Still, if I remove the flags
Hope that helps |
When I set |
You don't have to set CC or CXX to g++ (it is clang anyway just with g++ headers) - clang is the default on OSX and bllip-parser will compile with clang if you install the libiomp5 library. With recent homebrew versions the package has been moved: you now have to The second option won't give you the To build and install python library you have to do some extra steps. |
Like what extra steps, @didzis ? I've been fighting against this bug here for a couple of hours now but didn't really make much progress. |
While I have had the same problem that is described here, the suggested steps only brought me so far. The compiler doesn't find <ext/stdio_filebuf.h>, which, I'm sure, is because of changes by Apple in 10.9. Here's the relevant part of the output:
The text was updated successfully, but these errors were encountered: