Compiling kicad 5.1 to get back the legacy canvas on platforms without official support for it

It’s been quite a long time ago that I (probably accidentally?) bumped into the “modern” canvas (which was called OpenGL back then in KiCad V4), and I didn’t like it much. Everything looked weird, colors were wrong, and probably a bunch of other small things.

Then I decided to put up with it because the Interactive Router only works with the modern canvases, and I thought the Interactive Router was a nice feature, and worth exploring a bit. It did not take much time however to get completely addicted to it. With it you can do in a few minutes, what would have taken an hour before. It makes it almost trivial to squeeze in the last few tracks on a densely populated PCB. And after using it for some time It even starts influencing component placement. Now I put components closer together than I would have dared before.
Take for example this (not so big) THT board. I put in some extra effort here, because it had to fit in the space alotted. The top side is almost solid components.

The Interactive router is such a game changing feature that I can not imagine switching back to a PCB design package without it.

My guess is that you probably only want the obsolete canvas because you’re used to it, but holding on to those old features stops you from learning to appreciate the rapid improvements made in the development in KiCad. It is my understanding that you’re frustated about KiCad for some reason. I would probably also get frustrated If I wanted to hold on to the ways KiCad used to work, and had to go through the pain of setting up compiling environments and compiling KiCad myself just to be able to hold on to some old features.

It is a nasty trade of human psychology. Us, human beings, have a tendency to stick with what we’re used to and resist change, even if it is for the better. A classic (but totally unrelated) example of this is wives sticking to (and defending) their husbands even in abusive relationships.

2 years ago I could have understood sticking to the old canvas. There were still some features missing in the new canvas, and therefore I tended to switch back and forth between old and new, but now I’ve mostly forgotten what the old canvas even looks like.

In your (only) other thread “Not impressed with V5”, you wrote you were going back to KiCad V4 after just an hour because you “wasted too much time relearning basic tasks”, but how much time are you “wasting” now, in setting up and compiling for the old canvas?

I do not know you very well, but I’m guessing that when you invest some time in getting used to the new canvas (Give it a month, design 3 or 4 PCB’s in it, use the Interactive router) you would not want to switch back anymore, and you may even want to change your user name.

Resistance is probably futile anyway. The old canvas is going to be dropped completely somewhere in the future. Probably in V6, maybe later. I don’t really know, nor care, because I don’t use it anymore.

2 Likes

Compiled and Kicad runs, but I still don’t have the legacy canvas. Here is the version output:

Application: kicad
Version: 5.1.0, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-46-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

WX_OVERLAY is still on.
It is getting late and I’m a little weary after a day in the garden. I’ll have another go tomorrow maybe.
Grateful if anyone can point me in the right direction before I end up down a rat hole.

GTK is 3. WxWidgets must have GTK2 version because the legacy canvas doesn’t work with GKT3.

So how do I do that?

Can you upload your CmakeCache.txt? Maybe you didn’t clean after cmake already configured with gtk3 and then it didn’t switch to default.

Here it is. This is the first time I’ve compiled Kicad so didn’t think I would have to clean.
CMakeCache.txt (44.9 KB)

I wonder if there is a reason to build a newer version of KiCad if you want to stick to the legacy canvas. I am pondering how many new features have been introduced to the legacy canvas between 5.0.2 and 5.1, but it is rather a low number.

Primary reason is bug fixes and because I can (with some guidance) :smiley:
I’m not really chasing new features as 5.0.2 does what I need and suits the simplistic way I work. Rendering is my main issue I have with the new canvas along with the way a “change of layer” (and subsequent via placement) is implemented.
The transparency feature may help me here but I’m yet to experiment with it; I am a little “time poor” at the moment.

What do you get if you run
/usr/bin/wx-config --toolkit=gtk2 --libs

You should get list of compile flags with gtk2 libs, something like
-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0

Try forcing gtk2 build by passing this to cmake
-DwxWidgets_CONFIG_OPTIONS="--toolkit=gtk2"
Clean your build directory beforehand.

Thanks mate. I get exactly what you get.
I have a few errands to run today so will try your cmake option when I get back and let you know how I go.
Thanks for your assistance and persistence.

I’ve compiled with no errors and I now have:
Application: kicad
Version: 5.1.0, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-46-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

I’m still having problems though. Couple of disclaimers first.
I’ve done this twice using GTK3 and GTK2. I haven’t run “make install” in either case as I want to retain the version I have, so I’m running in a terminal from the build directory.
I found the kicad executable in ./build/release/kicad so I cd’ed into there and ran it. I got the version information above from the start window. Good start I thought.
When I ran eeschema, it complained about not finding “_eeschema.kiface” which I found in ./build/release/eeschema so I copied it to the kicad directory. Schematic now runs.
A similar thing happened when I ran pcbnew so copied the _pcbnew.kiface file from ./build/release/pcbnew to the kicad directory.
When I now run pcbnew, I get the following (in the terminal I’m running kicad from):

Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 3924, in <module>
    class CSegment(_object):
  File "/usr/lib/python2.7/dist-packages/pcbnew.py", line 3932, in CSegment
    __swig_setmethods__["m_Start"] = _pcbnew.CSegment_m_Start_set
AttributeError: 'module' object has no attribute 'CSegment_m_Start_set'
Segmentation fault (core dumped)

Kicad then exits.
I didn’t get this the first time I compiled using GTK3. Obviously something to do with GTK2 but I’ve got nothing. Wrong python version??

Try compiling with -DKICAD_SCRIPTING_WXPYTHON=OFF and -DKICAD_SCRIPTING_ACTION_MENU=OFF

Also there should be a flag to override installation directory. In fact default very well might be /usr/local/bin instead of /usr/bin that .deb packages install to. So you might not overwrite default installation if you run make install but check it beforehand.

My cmake line now looks like this:

cmake -DCMAKE_BUILD_TYPE=Release -DwxWidgets_CONFIG_OPTIONS="–toolkit=gtk2" -DKICAD_SCRIPTING_WXPYTHON=OFF -DKICAD_SCRIPTING_ACTION_MENU=OFF …/…/

Compiles without error, but I’m still seeing exactly the same Traceback error in the terminal. Kicad DOES NOT crash now.
Any other suggestions??

Well do you get legacy canvas in pcbnew?
If the traceback in the console is your only concern it likely has to do with the fact that you didn’t actually install the compiled package so kicad picks up pcbnew.py from system dist-packages directory which is still from the old installation. You can try to fiddle with PYTHONPATH environment variable to point your compiled kicad to right directory containing correct pcbnew.py or you can just ignore this.

I do get the legacy canvas :smiley:
I work in an industry where warnings are not good so was trying to eliminate it.
If I can just ignore this then I’m happy to take your advice.
Just for fun, I might build a VM of Xubuntu 18.04 and do a “make install” and see what happens.
Thank you for your assistance and patience in getting me to this point.

Great, congrats!

Actually installing the package would be best, even if in a vm. That will take care of right files being in right places.

Another way to get rid of that warning would be to disable scripting completely
KICAD_SCRIPTING=OFF KICAD_SCRIPTING_MODULES=OFF

20 characters needed…

2 posts were split to a new topic: How do install kicad 5 on debian 9.8?

I’m in the same boat actually… Just tried v5.1.2 from PPA and the lack of Legacy toolset does not impress me as I use it often.

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