User Tools

Site Tools


installing_gputils_and_sdcc_on_osx

This is an old revision of the document!


GPUTILS & SDCC on Mac OS X

While you probably need a PC to burn the MBHP-Loader into the PIC, you can stick to your beloved Macintosh while coding your C-Applications!

And more than that: you are able to use Apple's powerful Xcode as IDE and don't leave that except for sending the .syx file! You can even debug your MIOS C-Applications - although this is in an early development state, please contribute code! audiocommander.

The first step in this process is to install SDCC. If you have already SDCC running and calling “sdcc -v” in terminal gives you the info you're running 2.5. or higher, you have the most complicated step already completed!


How to install a library from the terminal

If you've never installed *nix libs or codes, don't worry: Either you can fetch a binary (that's easy if available for your system, just copy it to usr/local/bin) or you have to fetch the source and compile by yourself. In most cases this should be also ok, but if there are missing libraries it can be a bit tricky…

The “normal” way to install and compile packages you loaded (eg from sourceforge) is this:

Open the Terminal and type “cd” (change directory). Now drag the folder containing the unpacked source directory onto the terminal window to save yourself from typing the path. Close this step with pressing enter. You should now be in the right directory (hopefully!)

Now you have to type three commands:

  • ./config
  • make
  • make install

sometimes you have to call these with “sudo”, esp. “sudo make install”.

If you have problems compiling and installing SDCC, you might lack a library.

Here is what you should have installed (in this particularly order)


1. GPUTILS

Ben has released various precompiled GPUTILS and SDCC installers for Intel and PPC Macs. Thanks for that!
Check out the rest of his site, he has some useful infos about MicroChip Dev on OSX

If you want to compile for the PIC18f4685, you need a later version of GPUTILS than 0.13.4, at the moment you need to compile GPUTILS for yourself then. But it runs smoothly on OS X (tried on 10.5).

Following the instructions from here we get:

cd ~
svn co https://gputils.svn.sourceforge.net/svnroot/gputils gputils
cd gputils/trunk/gputils
./configure
make
sudo make install
cd ~
rm -r gputils

I've written these instruction to store a temporary copy of the gputils source code in your home directory, then remove this code after the installation.

2. SDCC

SDCC is available here: http://sdcc.sourceforge.net/index.php#Download

There are precompiled binaries for OSX that should work.

If you can't find an existing working version, I've built a binary installer that worked for me (note that this is not the most up-to-date version!): http://www.audiocommander.de/downloads/midibox/sdcc254-installer-osx.mpkg.tgz (MAC OS X PPC only)

A test in the terminal with “sdcc -v” should now show the proper version (you need 2.5 or higher):

mymac:~ user$ sdcc -v
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.5.4 #1189 (Dec 30 2005) (UNIX)

If you get instead a return “command not found”, you have to add usr/local/bin to your path environment:

mymac:~ user$ echo $PATH

now you should something like this: “/bin:/sbin:/usr/bin:/usr/sbin”

copy this line (the output from your terminal window, not the one above). now type & paste:

mymac:~ user$ PATH=:<paste here>:/usr/local/bin

for the example above, the line should look like this:

mymac:~ user$ PATH=:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin



via MacPorts and Xcode:

If you have Mac Ports and Xcode installed then there is another way of installing sdcc from sources. These are then compiled with Xcode automatically.

  • Open the 'Terminal.app'
  • There find the actual 'sdcc'-Release from the MacPorts repository:
[MyMac:~] > port search sdcc
sdcc @2.8.0 (lang)
    ANSI C compiler targeting Intel 8051, Maxim 80DS390, Zilog Z80
  • Then download, compile and configure 'sdcc' (you need administrator privileges for this):
[MyMac:~] > sudo port install sdcc
Passwd:

mhomscheidt 2009/01/06 11:14

3. If there are errors

Please check first if you have the latest working stable versions, fitting to your platform.

If you have trouble installing SDCC on your mac, post your questions/problems here: http://www.midibox.org/forum/index.php?topic=6527.0

installing_gputils_and_sdcc_on_osx.1254986522.txt.gz · Last modified: 2009/10/08 07:22 by karnlund