Skip to content

Instantly share code, notes, and snippets.

@tomacorp
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomacorp/80943ef136e37823db42 to your computer and use it in GitHub Desktop.
Save tomacorp/80943ef136e37823db42 to your computer and use it in GitHub Desktop.
Build Kicad nightly in Ubuntu 14.04

Why

The goal is to build a Kicad nightly release and run it on an OS X computer. Since the Kicad build appears to work best on Linux, I am using a virtual machine.

What

VM software is VirtualBox 4.3.28 https://www.virtualbox.org The guest OS is Desktop Ubuntu 14.04.2 amd64 http://www.ubuntu.com/download/desktop/ There are performance problems with VirtualBox, so I am trying these same instructions again with VMWare Fusion.

How

First install VirtualBox or VMWare.

Build Ubuntu VM in VirtualBox/VMWare

These notes are for a Macbook pro, mid 2015, OS X Yosemite Version 10.10.3.

Set RAM to 4GB, disk to 16GB. Disk might be a bit small. Chose the option for LVM. Set the number of CPUs to 3.

Installed guest additions with the hot-key accelerator. This allows resizing the display.

Used the terminal from /usr/bin/xterm

Set up a shared folder in $HOME/shared. All user files should be stored here. That gives both operating systems access to the files.

Host key is left-command.

Host-F to go to full screen mode

There is a CD that shows up on the left-hand toolbar. Click the Linux one, which has the 'guest additions' in it. This is intended to be auto-run, but maybe it needs to be run again as root. Click the 'run' button on the top right, which then asks for a password.

Build Ubuntu VM in VMWare

Install VMWare Fusion

Follow the instructions at: https://github.com/rasa/vmware-tools-patches/

sudo apt-get install git mkdir -p ~/vmware cd vmware git clone https://github.com/rasa/vmware-tools-patches.git

Get the version number of vmware fusion from right clicking Applications->VMWare->File Info. On my install the version is 7.1.2.

./download-tools.sh 7.1.2
./untar-and-patch.sh
./compile.sh

Reboot. Don't know if this is needed, but there is a new kernel now, so it seems like a good idea.

I am sharing a folder called ~/shared from OS X. The folder is in Ubuntu under /mnt/hgfs/shared shared. To make this also ~/shared on Ubuntu, make a symlink:

ln -s /mnt/hgfs/shared shared

Install Prerequisites

Follow the instructions at: http://www.kicad-pcb.org/display/DEV/Building+KiCad+on+Linux Had to add the second list of suggested packages such as libglew.

  sudo apt-get install bzr bzrtools build-essential checkinstall cmake doxygen zlib1g-dev libwebkitgtk-dev
  sudo apt-get build-dep kicad
  sudo apt-get install libglew-dev libcairo2-dev libbz2-dev libssl-dev swig

The build failed and exited because it found wx-widgets 2.8 instead of 3.0. Fixed this by following these instructions: https://forum.kicad.info/t/solution-error-building-because-of-wxwidgets-3-0-0/287/7

sudo apt-get install --reinstall libwxbase3.0-dev libwxgtk3.0-dev

Build failed, and I had to do something like this:

bzr whoami "My name <me@me.com>"

Apparently the repo somewhere wants to get to know you. The install step

bzr checkout lp:kicad kicad.bzr
bzr checkout lp:kicad kicad.bzr
cd kicad.bzr
mkdir build
cd build
cmake ../
make -j4
sudo make install

The compile step takes a long time. Computer tends to go into sleep mode. A potential fix is to run caffeinate before running the build.

Install libraries

More instructions from http://www.kicad-pcb.org/display/DEV/Building+KiCad+on+Linux

bzr checkout lp:~kicad-product-committers/kicad/library kicad-library.bzr
cd kicad-library.bzr
mkdir build 
cd build/ 
cmake ../ 
sudo make install

Tune performance

The cursor performance with default VirtualBox settings (12MB video memory) is quite slow. Move cursor, see that crosshair takes a second or two to catch up. Had to shut down the Ubuntu OS to increase the video memory to 40MB. No performance help.

There is a mouse problem where the mouse motion gets buffered up and takes a long time to play back. Turning off pointer integration makes it worse. This problem appears is not present in the other VM applications, leading me to think it is a Kicad problem.

The fix for this is here: https://bugs.launchpad.net/kicad/+bug/1003859 Put the following into /etc/X11/xorg.conf.d/10-fixkicad.conf (which I had to create):

Section "Device"
  Identifier "radeon1"
  Driver "radeon"
  Option "EXAPixmaps" "off"
EndSection

This fixed the slow cursor problem in Kicad Eeschema in Ubuntu VM on OSX. Or at least, it greatly improved it. Chris Gammel tried it and said it was still too slow, and that VMWare did not have the problem. So I switched to VMWare, and found that Chris is correct. The slow cursor is a VirtualBox problem.

Accept updates

A lot of updates show up after running for a while. There should be a way to trigger these. It would have been better to have them first, because there are so many of them, the compile of kicad might have gone differently. The updates (or perhaps the end of the build) takes a lot of space (~3GB?) and a reboot is required.

Set Schematic Preferences

Automatic panning and zooming interact poorly with OS X. Adjust the preferences in 'Schematic Editor Options' to get rid of mouse warping and to limit panning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment