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
micropython won't compile on OSX Mavericks #782
Comments
The -Map option is being add in unix/Makefile here: You could try changing:
to read:
or even
The map and cref are really just convenience things. |
As suggested by @dhylands, removing -Map=$@.map and --cref will allow you to compile.... But the resulting version is broken. Recent makefile changes didn't update the part clang needs to provide GC informations. This makefile ( https://gist.github.com/Anton-2/66c327548f5179edd47f#file-micropython-clang-makefile ) should work. If you want a map file, use clang syntax : -map,$@.map instead of -Map=$@.map I'll do a proper PR once I've checked that all is well with the next version of clang. |
Thanks, @Anton-2, but that gave me the same error I got after following the the advice given by @dhylands
|
Looks like you've got something mixed up in your environnement. CPP ../py/qstrdefs.h should just pre-process this file, not compile it ( using gcc -E ). It is later used by a python program to generate a real header file. Could you please run
so we can see what is really done ? Also, make sure that no previous attempt to use the "real" gcc remains in your path. Micropython should compile fine with standard clang based system compiler on osx, with the makefile I gave you. |
Aah. It must have been some environment variables and things from when I tried to make it use gcc. I opened up a new fresh terminal and it got past that. Looks like that worked. Thanks! |
If anyone is trying to compile the unix port on OSX and is running into trouble, I just wanted to add a few details to this thread (running 10.7.5, but encountering some of the same issues.) If you have a version of gcc installed in addition to clang, you may need to make the following change to
This will break compilation for stmhal, so it needs to by changed back to compile for the pyboard.
Using macports I was able to update to |
I have just got MicroPython to compile on Mavericks. PS I don't know why I already have |
New to Macports and all this OSX. I don't even have /opt in /usr/local I'm trying to figure out where to put libffi and how to get macports to put it there :-) This is like starting with Linux all over again! |
Ok, I got it to work. For reference, this is what you need on Mavericks (10.9.4) to get micropython to compile, assuming you have libffi installed (from macports or homebrew etc):
|
@toyg - glad you got it working, I just posted something similar at #865 but with a different set of edits to /unix/Makefile. Your change eliminates the map file, as mentioned upthread by @Anton-2 (though I don't know enough to tell if it is really needed). One note that I would add - your step 3 |
I have libffi installed via homebrew, but it keeps complaining about libffi not being found. I eventually fixed that with
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig
.Now it gets stuck when it tries to compile, probably because it is using clang and not gcc. I got the following error:
I installed gcc with homebrew, but it is still using clang. I then commented the compiler option out in the makefile so that clang compiles and then I eventually ended up with:
And that's where I got stuck. I don't know how to solve that and I don't know how to force it to use gcc and not clang either. (assuming that that's probably part of the problem)
The text was updated successfully, but these errors were encountered: