Tuesday, May 20, 2008

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 < unistd.h>
# include < utime.h>
# include < sys/types.h>
# include < sys/stat.h>
//#else
//# include < direct.h>
//# include < io.h>
//#endif


- added #include < string > 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.

4 Comments:

At 8:59 AM, Blogger follower said...

Thanks for posting these notes.

I've added a link to your KiCad build notes from a page where I've documented building previous versions of KiCad.

Given the non-trivial task of building KiCad for OS X if you felt like uploading your builds it would be great.

--Phil.

 
At 9:48 PM, Blogger Nick said...

Sure I think I looked at your stuff to get started anyway. Hopefully we can get this project on trak for osX :)

 
At 1:29 AM, Blogger sinosoidal said...

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

 
At 7:23 AM, Blogger Nick said...

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

 

Post a Comment

<< Home