Any ultimate Guide on how to use KiCad 4 and 5 on one System?

Hi,

I’m just trying to find out, what exactly we have to do, that we can run KiCad 4 and the upcoming KiCad 5 in parallel on one system, and how to deal with porting existing projects to KiCad 5.

On my Linux Mint 18, I’ve installed V4.0.7 via PPA, and use AppImage for the nightly. (A German article can be found here: http://www.zeilhofer.co.at/wiki/doku.php?id=appimage

What I’ve found out so far (please correct me, if I’m wrong):

  1. Project Template
    the kicad.pro file for V4 lists the used symbol libraries, which is prohibited for a V5 project, since this uses the sym-lib-table

  2. Symbol Libraries
    Different symbol libraries have to be used, since the upstream-libs from KiCad use version 2.3 and 2.4 (and newer in future), KiCad 4 only supports up to version 2.3 AFAIK. V5 uses the sym-lib-table, but this should be ignored by V4, right?

  3. Footprint Libraries
    Again different libraries have to be used, since KiCad 5 uses a new footprint format, which supports polygons and rounded rects as pad shapes. I couldn’t find any version string in a footprint definition file (*.kicad_mod). What happens if KiCad4 should load such a new footprint format?

  4. 3D Models
    Since the new footprints link to new 3D models, also here we have to use separate libraries. A definitive problem of the old footprint libraries is, that they do not use an explicit environment variable as a path prefix, which seems to be incompatible with KiCad 5.
    If a project is migrated from KiCad 4 to KiCad 5, all the 3D models have been gone in the 3D viewer. That’s really not acceptable. Is there any script available, which can fix the existing KiCad 4 footprint libs, by inserting a given environment variable?

  5. Summary
    All in all, I think it is doable, but the user has to manually switch the config folders. I would be very happy, if the path to the config folder for KiCad 5 is overridable by some way.
    My suggestion woud be a subfolder in the ~/.config/kicad which is called kicad5-override. There should be at least these files: kicad_common, fp-lib-table and sym-lib-table. So if the folder kicad5-override exists in the config folder, these files are used by KiCad 5. This would be perfectly backward compatible with KiCad 4.

In these German articles, which are work in progress, I tried to provide a step by step instruction for a headach free transition from KiCad 4 to KiCad 5:

1 Like

Nick commented here: https://bugs.launchpad.net/kicad/+bug/1765706/comments/2

1 Like

This was discussed lately in the dev mailing list starting with this message: https://lists.launchpad.net/kicad-developers/msg35303.html

1 Like

that really sounds like a great idea - iam looking forward to his announcement - or is this already out?

I think devs are still deciding best way to do it, and whether it is something that can be harmlessly slipped into v5 or must wait for v6.

Personally I think simplest thing to do is use a default of “kicad5”, keep “kicad” for v4. If kicad5 is empty, it can be copied from kicad if exists to migrate settings.

1 Like

There has been discussion today in the dev mailing list beginning with this message: https://lists.launchpad.net/kicad-developers/msg35545.html. If Wayne pushes it in, XDG_CONFIG_HOME environment variable will be used on all platforms. In the mail thread there are some tips for using it. If it will be available I will write about it here after I have tested it on Windows.

1 Like

As I mentioned in another thread:

“I have been writing a HowTo/FAQ which should help with environment variables. It’s mostly meant for the possibly soon coming KICAD_CONFIG_HOME feature but includes the library paths, too. Here is a preview: https://docs.google.com/document/d/1Rq8i2Ay7qpGpffaj-AQmE-Xp88ikHhgyt0Ygpi8717o/edit?usp=sharing

The idea of using XDG_CONFIG_HOME on every platform was problematic (see the above mentioned mailing list thread for details). The latest suggestion by Wayne was to use KICAD_CONFIG_HOME which would override, if set, the default config directory on every platform. I tested the patch on Linux and it works. The HowTo instructions give details on how to use use v4 and v5 side by side with this new and other environment variables. It’s a work in progress and not tested yet. Please comment.

@eelik
Great, I like your guide and the progress from the developers on this topic. It seems to fit very good to my “Reference Card” I’m currently working on.

ReferenceCard_KiCad4-and-KiCad5_MultiUser_Maintainance_Config.pdf (78.6 KB)

I also would like to get some comments about that. Original files are edited with Inkscape. Any interests on setting up a GitHub Repo for them?

The articles belonging to this reference card are still only in German language available on my private wiki, but for interested ones, googles translator does an acceptable job on them. For links, see original post above.

It was pushed to git so it should be available with tomorrow’s nightly builds.

1 Like

I tested the new KICAD_CONFIG_HOME and for the first time had both versions 4 and 5 running at the same time without sharing anything. This was how I did it:

  • Version 4.0.7 installed from jreynaud’s ubuntu repository
  • Self-compiled pre-v5, installed to the default /usr/local
  • Git cloned v5 libraries to /usr/local/share/kicad/libraries
  • Leave v4 as is
  • Write a bash script for launching v5

This is the script:

EDIT: WARNING: before this edit the first line had ‘~’ instead of ‘$HOME’, it was wrong and leads to kicad creating a directory named ~ which is not what we want.

export KICAD_CONFIG_HOME=$HOME/.config/kicad5
#export KICAD_PTEMPLATES=/usr/local/share/kicad/template
#export KICAD_SYMBOL_DIR=/usr/local/share/kicad/libraries/kicad-symbols
#export KISYSMOD=/usr/local/share/kicad/libraries/kicad-footprints
#export KISYS3DMOD=/usr/local/share/kicad/libraries/kicad-packages3D
/usr/local/bin/kicad

Only the first export is necessary, the others are commented out in this example. If so, when the v5 is run for the first time I can set the paths in the project view dialog. Then they are saved into the used config so they don’t interfere with v4. Whether you set the library paths in exported variables or within KiCad is a matter of taste.

5 Likes

This seems to be still not available via PPA…

https://git.launchpad.net/kicad/commit/?id=a7528df1982adbefdcb192900b780b1cf8c5ed6b

The latest ubuntu ppa seems to be newer, about 1 hour ago. Maybe you have to refresh something.

I marked the bug report as closed. I have tested the KICAD_CONFIG_HOME variable more thoroughly on Linux and fixed an issue in my document and in my previous post. Also some initial Win issues are fixed. Basically it looks like versions 4 and 5 can co-exist completely independently by using this variable. The easiest way to install them in my opinion is to install v4 with all defaults, including the libraries, and to install v5 and its libraries to another location and write a startup script for it. *-lib-tables can be copied from the v5 library directories to the v5 config directory (at least if the libraries are from the git repo). It’s actually easier to do it manually than to let the KiCad GUI help with it.

5 Likes

You were right. I had to remove the git/AppImage/KiCad folder, so the AppImage got built from scratch - a bit strange, but hey.

BTW: I’m just at the final tests for the kicad-models-updater

Thanks to the developers, they have taken this need for running multiple KiCad installs seriously. The latest news is about the templates path (see another thread by Karl, Default Project Template KiCad 4/5). Wayne posted in the developers mailing list today, proposing changes to the template finding code. See https://lists.launchpad.net/kicad-developers/msg35733.html.

1 Like

BTW, the idea of recognizing XDG_CONFIG_HOME on all platforms came back and found its way to the code. I think the difference to the original situation when it was refused is that now users can use KICAD_CONFIG_HOME everywhere and there’s no need to set XDG_CONFIG_HOME except when one wants to use it in Linux etc. as a more global setting for several applications. They are not interchangeable nor identical.

We have tested KICAD_CONFIG_HOME on windows and linux in an “enterprise setup” with 2 users :slight_smile:
And it works as expected!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.