Compiling Kicad for the Mac.

Thought I’d post my instructions so far on getting kicad to compile on my macbook. Its missing a few steps from the last time I tried so things are getting better I guess.

the pcb and gerber apps are still broken due to some nested wxDC which is no longer allowed in wxMac 2.9. I’ll have to actually look at the code more closely to get it to work.

// build notes for kicad on osx 10.5.2
// wxwidgets installed using macports 1.60

– installed boost boost-1-34-1

– changed CMakeLists.txt

# Locations for install targets.
set(KICAD_BIN bin CACHE PATH “Location of KiCad binaries.”)

if(UNIX)
if(APPLE)
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH “”)
# When used later, “bin” and others with no leading / is relative to CMAKE_INSTALL_PREFIX.
set(KICAD_PLUGINS lib/kicad/plugins CACHE PATH “Location of KiCad plugins.”)
set(KICAD_DATA share/kicad CACHE PATH “Location of KiCad data files.”)
set(KICAD_DOCS share/doc/kicad CACHE PATH “Location of KiCad documentation files.”)
else(APPLE)
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
set(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH “”)
# When used later, “bin” and others with no leading / is relative to CMAKE_INSTALL_PREFIX.
set(KICAD_PLUGINS lib/kicad/plugins CACHE PATH “Location of KiCad plugins.”)
set(KICAD_DATA share/kicad CACHE PATH “Location of KiCad data files.”)
set(KICAD_DOCS share/doc/kicad CACHE PATH “Location of KiCad documentation files.”)
endif(APPLE)
endif(UNIX)

– changed minizip.c

//#ifdef unix
# include &lt unistd.h&gt
# include &lt utime.h&gt
# include &lt sys/types.h&gt
# include &lt sys/stat.h&gt
//#else
//# include &lt direct.h&gt
//# include &lt io.h&gt
//#endif

– added #include &lt string &gt to dsn.h

mkdir -p build/release/
mkdire build/debug
cd build/release
cmake -DCMAKE_BUILDTYPE=Release -DCMAKE_INSTALL_PREFIX=/users/nick/install ../../
make
make install

EDIT: As requested I have uploaded my compiled but broken builds . they are at http://brokentoaster.com/KicadDev.zip You may also need to install the boost libraries.

2 Replies to “Compiling Kicad for the Mac.”

  1. Hi,

    Thanks a lot for your notes. However im having the following:

    Undefined symbols for architecture ppc:
    “_main”, referenced from:
    start in crt1.10.5.o
    ld: symbol(s) not found for architecture ppc
    collect2: ld returned 1 exit status
    ld warning: option -s is obsolete and being ignored

    Do you know how to solve this? I can’t find a a way of telling cmake to change architecture.

    Best regards,

    Nuno

  2. here is my cmake line I use for compiling
    cmake ../../ -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config -DwxWidgets_ROOT_DIR=/Volumes/Scratch/wxMac-2.8.8/include -DCMAKE_INSTALL_PREFIX=/temp/install -DBoost_INCLUDE_DIR=/Volumes/Scratch/kicad-sources -DCMAKE_OSX_ARCHITECTURES=”ppc -arch i386″ -DCPP_FLAGS=”-arch i386 -arch ppc”
    note the -DCMAKE_OSX_ARCHITECTURES=”ppc -arch i386″ -DCPP_FLAGS=”-arch i386 -arch ppc” options

Leave a Reply