propgcc running on OS X Lion
Yoda
Posts: 132
I was able to build from source on Lion and it appears to be working.
Next I plan to integrate with Eclipse and see how that goes. I assume it will be like any other integration of C/C++ environment with Eclipse? I would also assume the different boards will become runtime targets that can be selected as well?
Next I plan to integrate with Eclipse and see how that goes. I assume it will be like any other integration of C/C++ environment with Eclipse? I would also assume the different boards will become runtime targets that can be selected as well?
Comments
Hi Yoda, Congrats.
I've used Propeller-GCC manually with Eclipse CDT and NetBeans C/C++.
I've been able to configure Eclipse and Netbeans to "run" the application on Propeller. I haven't had much luck controlling the terminal with Eclipse other than kill -9 :< Presumably this is because we use ESC only or Ctrl-C to stop the terminal. NetBeans passes ESC to the program and has a "stop" button. I guess a stop button could be added to Eclipse or the terminal ESC command changed to something else.
The short answer for board types is:
The loader chooses the board type to boot. The application selects the library devices with a driver struct (fopen, fread, fwrite, fclose, etc...). The application can define other devices to be used independent of the C library.
In summary, we want to have GUI elements for Serial port select, Board type select, and device configurations. A "sketch" of GUI interface plans can be found in this propgcc wiki page.
I built, basically using the linux build instructions with some Mac-specific changes at the command line. It would be nice to build future release versions with Xcode.
Thanks!
If you can describe mac build instructions, we could put them on the Wiki.
One of our developers uses Xcode. Maybe he can chime in on that.
Like your C6. Makes me want to trade my C5.
Thanks.
--Steve
I'll write-up the steps that I take to build from source and post (to this thread?)...
The C5 was definitely the Vette that got me thinking about buying one!
dgately
Ah, never thought of OS X's build tools as being considered "XCode"...
From my view, XCode is actually just the IDE that uses the build tools inherent in OS X's Unix base (Darwin), but I can see how it appears as a unit. It does get installed as one big package! And, yes, XCode "the IDE" could be taught to build anything that can be built on the command line. That's how XCode is able to move to new build and source repository methods, quickly (clang, llvm, git, etc.).
Having said all that, I'm not an XCode 4.2 wiz by any means. I'll stay with the command line for now.
dgately
Prerequisite:
Mercurial, the free distributed source control management tool from: http://mercurial.selenic.com/downloads/. This is needed to download and maintain the propgcc sources. Mercurial is not available in OS X as a default and must be downloaded and installed as a package. Download Mercurial's ".mpkg" (meta-package) file and double-click on it to install.
Note: Executing the "hg clone" command on my 10.7.2 system failed with "AttributeError: 'module' object has no attribute 'setbinary'". If this happens, you'll need to edit the file: "/usr/local/bin/hg", according to instructions on this web page: http://groups.google.com/group/thg-dev/browse_thread/thread/dbbce627480a5a13
Steps (Mac OS X Lion 10.7 addendum to: PropGccBuild - propgcc - Describes how to build Propeller GCC. - GCC for the Parallax Propeller Microcontroller - Google Project Hosting):
1. Make a new directory for the propgcc sources, in a known location (your home directory is a good place).
$ mkdir propSrc <== create a new directory for your cloned propgcc sources
$ cd propSrc <== go into the new source directory
2. You'll need to add the following lines to your ".profile" file in your home directory. Use nano, vi, emacs or a GUI editor you like.
export PATH=${PATH}:/usr/local/propeller/bin
# Set up Python to help mercurial
export PYTHONPATH=${HOME}/lib/python
export PATH=${HOME}/bin:$PATH
Be sure to "source" .profile before continuing...
3. To download the propgcc sources, you'll need to use Mercurial's 'clone' command: "hg clone". If the command fails, see the above note for instructions on repairing the failure.
Build propgcc on OS X Lion
1. $ export GROUP="wheel" <== I just use the "wheel" group as I'm sure that I'll have access to it, later
2. $ sudo rm -rf /usr/local/propeller <== work as root user without being too dangerous (requires admin password)
3. $ sudo mkdir /usr/local/propeller
4. $ sudo chown ${USER}.${GROUP} /usr/local/propeller <== makes the new directory accessible to you
5. $ cd $HOME/propsource/propgcc <== in case you've moved to another directory since the hg clone
6. $ ./rebuild.sh
7. Go have a cup of espresso (you'll need the caffeine)
Example Build of the c3files program:
On OS X, the USB to Serial connection will show up like this: "/dev/cu.usbserial-0000nnaa", where "nn" will be a two-digit number and "aa" will be a two character alpha. With the USB cable plugged into the CPU and the C3, executing "ls /dev|grep cu.usbserial" will display the correct name. You'll need to re-export if you plug the cable into a different USB port.
2. $ cd $HOME/propsource/propgcc/demos/c3files/lmm
3. $ make
4. $ make run
Propeller Version 1 on /dev/cu.usbserial-000013FD
Writing 30756 bytes to Propeller RAM.
Verifying ... Upload OK!
[ Entering terminal mode. Type ESC or Control-C to exit. ]
Commands are help, cat, rm, ls, ll, echo, cd, pwd, mkdir and rmdir
>
I hope this is "Wiki-worthy". It works for me :-)
Thanks for the instructions. I've put them on the wiki here: http://code.google.com/p/propgcc/wiki/PropGccBuildMacOSX.
Please review and offer suggestions.
--Steve
I had to create a soft-link (symbolic link) in /usr/local/propeller/bin/ for bstc, to get compile/load to work. I used:
sudo ln -s /usr/local/propeller/bin/bstc /usr/local/propeller/bin/bstc.osx
dgately
I've just installed the Mercurial 2.0.0 without problems.
sudo chown ${USER} :${GROUP} /usr/local/propeller
...however when I tried this it informed me...
chown: :wheel: No such file or directory
...so I don't really know. I ran the "groups" command and I don't see a wheel group. Under System Preferences -> Accounts I tried to create a wheel group and it said that it exists. I decided to just run this as:
sudo chown ${USER} /usr/local/propeller
...and it seemed to run without an error at least.
Pretty sure that you wanted to say "cd $HOME/propSrc/propgcc" there in #5.
Wow, that's some build script. I might just have to make some more coffee to let this thing finish. At least it seems to be running.
Bummer, got the following error after a long run of that build batch...
make[4]: *** [ldlang.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-ld] Error 2
make: *** [all] Error 2
binutils make failed.
Hm... not sure what the state of my build is but I assume it's incomplete at this point.
Looks like more documentation to update.
The /usr/local/propeller path is no longer being used. Set it to /opt/parallax instead.
You can use jbuild.sh N to speed up the build. N = number of cores for make.
--Steve
Steve, If you can add me as a propgcc member, I can edit the Mac OS X build doc...
(you have my email address)
dgately
Albus,
I got the same result on one of my Macs... On the other Mac, no problem...
Appears to be something about linking with the libbbfd.a archive, created during the binutils build process. Something about that archive not having symbols for x86_64. My MacBook Pro has MacPorts installed and that may be the issue. My iMac is a more clean configuration and is able to build propgcc, directly.
To build on my MacBook Pro, I booted-up in 32-bit mode, which allowed a full build of propgcc (but needed to delete the previous build directory and run "make -distclean" in the binutils directory before rebuilding)...
You can try that...
dgately