I found myself faced with the need to install KiCAD from source after upgrading my laptop to Ubuntu 18.04 and installing KiCAD 4.07 which is the stable version from the Ubuntu repositories but it had graphics issues. The cursor painting was was leaving a trail on eeschema making it unusable. I wanted to install from source as a last resort after trying every intel graphics and X11 hack I could find to no avail, if there was even the slightest chance to fix the bug it would include at least building the right packages from the source.
installing the dependencies
There are some dependencies that have been outlined on the github page, check and install for your distro. This list may not be exhaustive here as I may have had some of them already installed.
sudo apt install libreadline-dev libboost-all-dev liboce-foundation-dev liboce-ocaf-dev libssl-dev libbz2-dev doxygen
I also built ngspice from source following my earlier tutorial in which I fixed a bug. libngspice doesn’t really install well from Ubuntu repositories either.
Get the Source
Get the source code by clicking the KiCAD launchpad download link. This gets you the source for version 4.0.7. save the file somewhere in your computer [I always use the directory ~/src] and extract the .tar.xz file, cd into the folder.
create a build directory:
mkdir build && cd build
We need to Install without scripting to avoid wxpython3.0 wxpython2.8 wars: I couldn’t install wxpython2.8 in Ubuntu 18.04 .
You have to initialize bzr first or the build command will complain. I have no idea what that is, I only used git but I think it’s some version control tool like git. Anyway the command is:
bzr whoami "First Last<firstname.lastname@example.org>"
The option for switching off scripting is: T-DKICAD_SCRIPTING_WXPYTHON=OFF. Run cmake to generate the makefiles.
cmake -DKICAD_SCRIPTING_WXPYTHON=OFF ../
make -j5 followed by
sudo make install, I realized it builds everything twice, takes long. If I were you I would just run:
sudo make install