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
Mac Lion dependencies #865
Comments
I'm well down the version/dependency/update/conflicting-directions-all-produce-errors rabbit hole, so please disregard. (I thought there were a lot of Mac users. I have Parallels and will install Debian.) Is there a forum? IRC channel? |
Forum: forum.micropython.org |
It looks like you have the ancient version of gcc that OSX provides with Xcode - I have it too, and it doesn't work for micropython. You need to use Apple's clang and follow the steps outlined in #782 - In my comment there I also suggest how to ensure that make uses clang - you need to edit
However, while I was able to compile the micropython unix port on 10.7.5 / Lion the last time I tried it, I don't use the unix port very much, so I just tried to pull the current source and compile again following those steps and it failed on the linker:
It is also possible that I munged up my source tree somehow, I may try again with a fresh pull. But it isn't the first time that the OSX compilers have found something to complain about. Edited to add: I just tried again with a fresh source tree and it fails with the same errors. Looks like clang isn't happy with some of the recent changes to |
Thanks, it is getting closer. I left a note on the forum -- dang, that Anyway, I don't have /opt in /usr/local and am working on where to put the -- Charlie On Sat, Sep 20, 2014 at 6:39 PM, blmorris notifications@github.com wrote:
|
On a sidenote: it's a bit of a shame there is no way to build for OSX without modifications and searching for the correct procedure in github issues |
@stinos - "On a sidenote: it's a bit of a shame there is no way to build for OSX without modifications and searching for the correct procedure in github issues" @ARMWorks - If you are trying to make your OSX environment as familiar as possible from a Linux point of view (I started on OSX seven years ago after using Linux the previous seven) then you are fighting an uphill battle without installing some package manager like macports, homebrew or fink. I have used fink, now mostly ports (www.macports.org), and while I haven't used homebrew I understand that it can coexist with macports on your machine. Macports installs packages to /opt/local (at least on my machine, it has been so long that I have no idea if this is the default.) At any rate, it was good enough to install ffi to support uPy a month ago… now I need to see if I can figure out why I can't compile now. And @stinos - thanks for the tip, I will look into -Bryan |
(more sidenote) macports should indeed be the way to go; I don't have a mac no more so I was thinking of maybe getting a trial on macincloud or similar but I'm not sure if it's worth it as I would probably be able to come up with a proper build but without knowing if it works for other developpers etc.. |
@blmorris I just added macports yesterday and am working through. It put I thought I read it needs to be somewhere else. This may be a waste of time and I should do all the micropython on Debian. -- Charlie On Sun, Sep 21, 2014 at 11:02 AM, blmorris notifications@github.com wrote:
|
"It put libffi in /opt/local/var/macports/software/libffi" |
Minor correction- what I said was the location of the source archive is actually where pre-compiled binary archives go; source archives go someplace else. |
@stinos - Thanks again! Problem was exactly as you said, the Makefile which was modified to compile for OSX did not include |
That's nice! So basically these are two realtively simple steps to get the build working - maybe you should add this info to the main Readme.md and submit a PR for it? I think this is going to be useful for future devs |
@stinos - Actually, not quite yet. I thought that I was using the mainline unix Makefile to compile last night; what I actually had was the OSX modified Makefile which had been helpfully updated by git with the recent mainline updates while keeping the OSX modifications intact. While git is a great tool, I get really confused trying to follow the logic sometimes… I realized my mistake only after pulling a fresh source tree this morning as a sanity check and getting this error:
So, purely by accident last night I ended up with a makefile that compiles micropython for OSX.
OSX modified unix Makefile:
I don't know nearly enough about Makefile syntax or logic to offer a fix that will work on both OSX and Linux; I also don't have an updated OSX system to test on. @ARMWorks - I hope that you can get this working and that I haven't gotten you even more mixed up than I am. |
@blmorris What does the command uname output under OSX? |
I have put up PR #871 which lets me compile both unix and stmhal on OSX 10.7.5 |
PR #871 has been merged, so the unix port in the mainline source tree should now build on OSX without any fiddling - assuming, of course, that all dependancies are in place. |
@blmorris if you don't mind cluttering this up a little, can you give me Here there is Portfile and files (patch and patch-diff) and here there is libffi-3.1_4.darwin_11.x86_64.tbz2 I don't see a make file. Maybe I'm supposed to use macports to build? I On Tue, Sep 23, 2014 at 7:24 AM, blmorris notifications@github.com wrote:
|
@ARMWorks - Not cluttering it up at all; given the title you gave to the thread I'd say your question finally gets us back on topic ;^)
And then you should be able to compile the latest source - but I want to know if you can't! ;^) |
And, if we can get this resolved (and understand what we did to get there) then I will start putting together a "Mac OSX tips and tricks" page on the wiki here. |
Great. Early Intel Mac Pro 8 core running OSX Lion. I got it from a guy two So, I think I will have time to try today. -- Charlie On Tue, Sep 23, 2014 at 12:17 PM, blmorris notifications@github.com wrote:
|
All goes well until I build. I'll log out/in or restart. I just execute unix RYAN$ make V=1 On Tue, Sep 23, 2014 at 2:21 PM, Charles Springer <
|
Checking around a bit I see some older postings in which Lion expects and now I get just this output from make (I did a git pull from the unix directory to update. First I deleted the make V=1 On Tue, Sep 23, 2014 at 8:29 PM, Charles Springer <
|
There is no need to run 'make' with macports - really, the correct command is 'sudo port install' and that should do everything, even deciding whether to download source or a pre compiled binary. Sent from my iPhone On Sep 23, 2014, at 11:50 PM, "C. Towne Springer" notifications@github.com wrote:
|
Try 'sudo port install pkg-config' Sent from my iPhone On Sep 23, 2014, at 11:29 PM, "C. Towne Springer" notifications@github.com wrote:
|
Sorry for the first reply, trying to reply before coffee. Looks like you are almost there- you are all set with libffi, now you are just missing pkg-config, which can also be installed with macports. |
I do port install pkgconfig and it says everything is fine and binaries are unix RYAN$ make clean On Wed, Sep 24, 2014 at 4:13 AM, blmorris notifications@github.com wrote:
|
I poked around but I can't tell what is happening. Is this failing on the On Wed, Sep 24, 2014 at 10:18 AM, Charles Springer <
|
This is what I get for the command that your build fails on:
And then keeps going to completion rather than quitting. There are some special tricks used to get the OSX build process to deal with the bss start and end symbols, there is some ongoing discussion on this topic in the forum. These tricks my not work on older versions of clang.
|
clang -v Aha! Errr. Now what? :-) On Wed, Sep 24, 2014 at 1:13 PM, blmorris notifications@github.com wrote:
|
Probably update Xcode; it's been a while since I have done so, I think you go straight to apple's web site and download. You may need to set up a developers account, or maybe just an Apple ID, but at any rate I'm pretty sure it's free. Sent from my iPhone On Sep 24, 2014, at 4:47 PM, "C. Towne Springer" notifications@github.com wrote:
|
Actually, it looks like I have the older version. This may not be the solution to our problem... Sent from my iPhone On Sep 24, 2014, at 4:47 PM, "C. Towne Springer" notifications@github.com wrote:
|
Yeah, my xcode is fresh from the oven. I see this was maybe dealt with in On Wed, Sep 24, 2014 at 1:55 PM, blmorris notifications@github.com wrote:
|
Oops. I think we have been there. The only thing with .bss and clang that On Wed, Sep 24, 2014 at 1:58 PM, Charles Springer <
|
It's been an ongoing issue, some of the low-level gc stuff tests some corner-cases of compiler behavior. |
I think that what's going on here is that the internal assembler used by clang doesn't recognize the .bss directive. |
Yes, the question is why the build continues with a warning on my system and fails with an error on the newer version of clang - and whether we can find a way to continue with a warning instead of that error. I don't imagine that the OSX assembler is suddenly decide that it is happy with the .bss directive ;-) |
@ARMWorks - Okay, this is ugly, but just try it: go to |
Woohoo! I commented out bss in two places. Compiles, links, runs. 5+3 even Thanks for the effort. Now I'll have to target STM32 and TI, etc. I can -- Charlie On Thu, Sep 25, 2014 at 10:06 AM, blmorris notifications@github.com wrote:
|
Sweet! I'll do a PR later this evening. I realized after my last comment that the immediate preceding and following lines are already #ifdef'd out for OSX, so it's nice and clean to wrap them all together. I just don't know why it wasn't done that way initially- maybe just an oversight, but we should be sure. Anyway, looks like we are close to proper OSX support. |
I suspect that this issue can be closed; with the current source tree Micro Python can be compiled on OSX without any special workarounds. |
Fix ReadTheDocs build due to c2rst.
I'm using Lion (Target is OSX first, then the uPython boads then Discovery Boards - I have done it all on Debian before.) and am missing something in setting up to compile micropython. Apple says Xcode for Lion includes the tools. Others say install with xcode-select --install which just says --install is not a valid option. If anyone has tried on Lion, suggestions appreciated or link to a how-to that works for Lion. Here is the output:
$make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
make: pkg-config: Command not found
make: pkg-config: Command not found
CC ../py/nlrx64.S
../py/nlrx64.S:118:Unknown pseudo-op: .bss
make: *** [build/py/nlrx64.o] Error 1
:unix RYAN$ make V=1
make: pkg-config: Command not found
make: pkg-config: Command not found
../py/py-version.sh > build/genhdr/py-version.h.tmp
if [ -f "build/genhdr/py-version.h" ] && cmp -s build/genhdr/py-version.h build/genhdr/py-version.h.tmp; then rm build/genhdr/py-version.h.tmp; else echo "Generating build/genhdr/py-version.h"; mv build/genhdr/py-version.h.tmp build/genhdr/py-version.h; fi
CC ../py/nlrx64.S
gcc -I. -I../py -Ibuild -Wall -Werror -ansi -std=gnu99 -DUNIX -DMICROPY_USE_READLINE=1 -DMICROPY_PY_TIME=1 -DMICROPY_PY_TERMIOS=1 -DMICROPY_PY_FFI=1 -Os -c -o build/py/nlrx64.o ../py/nlrx64.S
../py/nlrx64.S:118:Unknown pseudo-op: .bss
make: *** [build/py/nlrx64.o] Error 1
$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
$
The text was updated successfully, but these errors were encountered: