[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

Wednesday, February 25, 2009

Kicad OSX nightlies fixed

I finally decided to investigate why kicad had stopped building back in Decemember. I had initially thought it was to do with large changes to the source being done at that time or with my trying to get a newer build of wxMac to work with it properly.
I turns out I updated the Boost library and that was what was causing my builds to fail.

Somewhere on the mac a "check" macro gets defined. Apparently this is if "DEBUG" is defined somewhere but I could not figure out where or why this was going on (see this post. I decided to simply modify the boost files concerned to work aroaund this problem. By renaming the "check" function and its called I was able to get kicad compiling again. Sadly it does not fix the serious flaws in wxmacs graphics implimentation ie. the fact that it does not do XOR draws properly.Anyway here are the diffs I made

fixing kicad again for th mac
/temp/kicad-sources/boost/ptr_container/detail/static_move_ptr.hpp:
line 155: check renamed to check_

4 changes in /temp/kicad-sources/boost/detail/is_incrementable.hppcheck "check(" replaced with "check_("

boost/ptr_container/detail/static_move_ptr.hpp

% diff /temp/boost_1_37_0/boost/ptr_container/detail/static_move_ptr.hpp
/temp/kicad-sources/boost/ptr_container/detail/static_move_ptr.hpp

154c155
< void check(const static_move_ptr& ptr)
---
> void check_(const static_move_ptr& ptr)


boost/detail/is_incrementable.hpp

% diff /temp/boost_1_37_0/boost/detail/is_incrementable.hpp
/temp/kicad-sources/boost/detail/is_incrementable.hpp

68c68
< char (& check(tag) )[2];
---
> char (& check_(tag) )[2];
71c71
< char check(T const&);
---
> char check_(T const&);
81c81
< , value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1
---
> , value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
92c92
< , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
---
> , value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1


The error I was getting was the following
In file included from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/reversible_ptr_container.hpp:22In file included from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/reversible_ptr_container.hpp:22,
from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/ptr_sequence_adapter.hpp:20,
from /temp/kicad-sources/boost_1_38_0/boost/ptr_container/ptr_vector.hpp:20,
from /temp/kicad-sources/kicad/include/board_item_struct.h:9,
from /temp/kicad-sources/kicad/include/pcbstruct.h:10,
from /temp/kicad-sources/kicad/3d-viewer/3d_viewer.h:29,
from /temp/kicad-sources/kicad/3d-viewer/3d_aux.cpp:23:
/temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/static_move_ptr.hpp:154:50: error: macro "check" passed 2 arguments, but takes just 1


I have now updated my automagic build script to upload the error log if It doesn't compile.

All of my builds are still found at http://www.brokentoaster.com/kicad/ and should be universal apps. If anyone has had any success with wxCocoa or other builds I'd be happy to add them to my build list.

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.

Wednesday, September 10, 2008

Kicad SVN builds for OSX

I've managed to cobble together some universal builds of kicad for mac osx. These a based on wxMac2.8 so the graphics is still very screwy. I might try a wxCocoa build some time in the future.

The script which is on a cron job to run every day is below.


#!/bin/sh

#Make a nightly build of kicad

#update from svn
cd /Volumes/Scratch/kicad-sources
svn up
new_version=`svn info | grep Revision | cut -f 2 -d\ `
old_version=`cat /temp/install/version.txt`
if [ $new_version -gt $old_version ]
then

#build it
cd build/release
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"

make clean
if make
then
make install

#bundle
cd /temp/
tar -czf kicad_osx_v`cat install/version.txt`.tgz install

#upload
curl -T kicad_osx_v`cat install/version.txt`.tgz ftp://user:password@ftp.brokentoaster.com/

echo $new_version > /temp/install/version.txt
fi
else
echo "Kicad is uptodate :) "
fi


You can find the builds at http://www.brokentoaster.com/kicad/. No guarantees on usefulness.

Friday, August 22, 2008

Kicad now compiles on Mac OSX

Just downloaded revison 1200 of kicad from svn using th following command

svn checkout http://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad-sources


I also upgraded to cmake 2.6.0 using the macports system and then followed the included instructions and it compiles ok on my macbook.

It is working a lot better but PCBnew is still fairly buggy.
The schematic side of it is working great though.

Worth a look but I'll have to keep using the windows version for any stable work.
I'm going to keep an eye on the kicad-dev group and see if this makes any progress.

Note: my wxwidgets were installed via macports at

wxWidgets_CONFIG_EXECUTABLE=/opt/local/bin/wx-config
wxWidgets_ROOT_DIR=/opt/local/include/wx-2.8


but i noticed a version was already installed in a couple of places. Here is what locate gave me:

% locate wx.h
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/wx-2.5/wx/wx.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/wx-2.8/wx/wx.h
/opt/local/include/wx-2.8/wx/wx.h
/opt/local/var/macports/software/wxWidgets/2.8.7_0/opt/local/include/wx-2.8/wx/wx.h
/opt/local/var/macports/software/wxWidgets/2.8.7_1/opt/local/include/wx-2.8/wx/wx.h
/usr/include/wx-2.8/wx/wx.h


% locate wx-config
/opt/local/bin/wx-config
/opt/local/var/macports/software/wxWidgets/2.8.7_0/opt/local/bin/wx-config
/opt/local/var/macports/software/wxWidgets/2.8.7_1/opt/local/bin/wx-config
/usr/bin/wx-config

Friday, May 29, 2009

Kicad OSX nightlies fixed again.

Got my kicad builds sorted again. finally got the make command right to work with the boost library. I've updated to the latest (1.39) and everything seems to be going well.

My nightly make script now looks like this....

#update from svn
cd /temp/kicad-sources
svn up
new_version=`svn info | grep Revision | cut -f 2 -d\ `
old_version=`cat /temp/install/version.txt`
if [ $new_version -gt $old_version ]
then

#build it
cd build/release
cmake ../../ -DwxWidgets_CONFIG_EXECUTABLE="/usr/local/bin/wx-config" -DwxWidgets_ROOT_DIR="/usr/local/include/wx-2.8" -DCMAKE_INSTALL_PREFIX=/temp/install -DBoost_INCLUDE_DIR=/temp/kicad-sources -DCMAKE_OSX_ARCHITECTURES="ppc -arch i386" -DCMAKE_CXX_FLAGS="-D__ASSERTMACROS__"

# make clean
if make > /temp/kicad_errors-${new_version}.txt 2>> /temp/kicad_errors-${new_version}.txt && make install
then
file=kicad_osx_v${new_version}
echo $new_version > /temp/install/version.txt
mv /temp/kicad_errors-${new_version}.txt /temp/install/build_log.txt


#bundle
cd /temp/
cp -rf install ${file}
tar -czf ${file}.tgz ${file}

#upload
curl -T ${file}.tgz ftp://username:password@ftp.brokentoaster.com/
rm -rf ${file}

# cd /temp/kicad-sources/build/release/
# /Developer/usr/bin/packagemaker --doc osx-package.pmdoc --title 'Kicad' -o ${file}.mpkg
# curl -T ${file}.mpkg ftp://username:password@ftp.brokentoaster.com/

else
curl -T /temp/kicad_errors-${new_version}.txt ftp://username:password@ftp.brokentoaster.com/
fi

# go to sleep
open /Users/nick/Applications/SleepNow
else
echo "Kicad is uptodate :) "
fi

Monday, March 09, 2009

GEDA portfiles

Now I've got kicad building again ( although rather bloated at 20Mb ) I thought I'd have a play with some other items on my todo list. I've manage to get most of the GEDA suite working on the mac and have created portfiles for mac ports to be able to install them. I haven't got gwave to work yet due to some dependances and some of the installs needed to be forced to overwrite some other files but in general they seem to work. I hope to add kicad as a port file in the near future but I will see if I can get these programs to work first.

In doing this I noticed a few messages regarding others trying to get port files up for gEDA on the mac so I assume they will make it into the main ports tree at some time in the near future.

To use my files you can browse them at http://www.brokentoaster.com/macports/ or download them all at http://www.brokentoaster.com/macports/ports.zip.

First you will need to extract the files into a local directory such as /users/me/ports. Then you will need to add /users/me/ports to the /opt/local/etc/macports/sources.conf file. The last action is to run the command portindex from your newly created ports directory to ensure the index is up to date.

If these are of any use to you then enjoy. Good luck.