5.1.9 compiles well, nightly not ... [Linux] SOLVED

The stable 5.1.9 compiles well on my linux 64-bit, but when I try the kicad-master, all I got is:

CMake Error at CMakeLists.txt:830 (message):
GTK3-based wxPython/Phoenix toolkit is required.
– Configuring incomplete, errors occurred!
See also “/tmp/SBo/kicad-master/build/CMakeFiles/CMakeOutput.log”.
See also “/tmp/SBo/kicad-master/build/CMakeFiles/CMakeError.log”.
bash-5.1#

what’s the problem here ?

Make sure you have a gtk3 version of wxwidgets (edit: and wxpython) installed rather than gtk2 (as well as the dev version of the package, if that is relevant for your distribution).

What the packages are named depends on your distribution. For Arch, this means wxgtk3 (edit: and python-wxpython).

If I’m remembering correctly, 5.99 requires gtk3 while 5.1 worked with gtk2 or 3 – that’s probably the source of the issue.

I recompiled both wxGTK3 and wxPython3 using "–with-gtk=2 " flag disabled in a build scripts.
No luck as of yet, the same error came again.

You need to clear cmake cache and then run cmake with these options
-DKICAD_SCRIPTING_PYTHON3=ON -DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
and probably
-DwxWidgets_CONFIG_OPTIONS="--toolkit=gtk3"

Where to insert these switches:
-DKICAD_SCRIPTING_PYTHON3=ON
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
-DwxWidgets_CONFIG_OPTIONS="–toolkit=gtk3

I assume the first 2 go to kicad building script. OK ?
And the 3rd goes to the wxGTK or wxPython one ?

You pass those options to cmake, so something like

cmake -DCMAKE_BUILD_TYPE=Release \
    -DKICAD_SCRIPTING_PYTHON3=ON \
    -DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON \
    -DwxWidgets_CONFIG_OPTIONS="--toolkit=gtk3" \
    ../../

See https://dev-docs.kicad.org/build/linux/
There are a number of compile options, see https://dev-docs.kicad.org/build/compile-options/

If that doesn’t fix it, it would be helpful to say what distribution you’re trying to build on

Here’s the vital part of the kicad building script (my distribution is Slackware current), does not work as of yet:

mkdir -p build
cd build
cmake
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS"
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS"
-DCMAKE_INSTALL_PREFIX=/usr
-DKICAD_DOCS=/usr/doc/$PRGNAM-$VERSION
-DKICAD_PLUGINS=/usr/lib${LIBDIRSUFFIX}/$PRGNAM/plugins
-DKICAD_STABLE_VERSION=OFF
-DKICAD_SKIP_BOOST=ON
-DKICAD_SCRIPTING=ON
-DKICAD_SCRIPTING_MODULES=ON
-DKICAD_SCRIPTING_PYTHON3=ON
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
-DWXWIDGETS_CONFIG_OPTIONS="–toolkit=gtk3"
-DKICAD_USE_SPICE=ON
-DKICAD_USE_OCC=ON
-DKICAD_USE_OCE=OFF
-DCMAKE_BUILD_TYPE=Release …
make VERBOSE=1
make install DESTDIR=$PKG
cd …

And the result is that:

Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘wx’
CMake Error at CMakeModules/FindwxPython.cmake:52 (message):
wxPython/Phoenix does not appear to be installed on the system
Call Stack (most recent call first):
CMakeLists.txt:811 (find_package)
– Configuring incomplete, errors occurred!
See also “/tmp/SBo/kicad-master/build/CMakeFiles/CMakeOutput.log”.
See also “/tmp/SBo/kicad-master/build/CMakeFiles/CMakeError.log”.

I’m at the limit of what I can help with, but I have two more ideas.

Do you have wxpython4 on your system? I think you’ll either need wxpython4 (“phoenix”) or you need to set -DKICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF.

If you have wxpython4 installed and it still doesn’t work, then maybe it’s a python version issue? Try running python and importing wx – on my system that runs python3 and imports fine.

Your last error is different from the first post. Now it’s saying you don’t have wxpyhon/phoenix installed. It’s required if you want python scripting and build against gtk3.
I’m not familiar with slackware can’t tell you exactly what the package name for wxphoenix is. (btw wxPhoenix is a rename of wxPython starting with version 4)

The package system of slackware confuses me a bit but I think wxpython4 is the right package name to get phoenix on slackware, at least in this particular repository: https://slackbuilds.org/repository/14.2/libraries/wxPython4/?search=wxpython4

I installed wxPython4. I have wxGTK3-3.0.5 installed. The error still exists , but the info changed as follows:

-- Check for installed Python Interpreter -- found -- Python module install path: lib64/python3.9/site-packages -- Found PythonLibs: /usr/lib64/libpython3.9.so (found suitable version "3.9.1", minimum required is "3.3") -- Found Phoenix 4.0.7.post2/gtk3 (wxWidgets 3.0.5) CMake Error at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message): Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS) (Required is at least version "3.0.5") Call Stack (most recent call first): /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE) CMakeModules/FindwxWidgets.cmake:1019 (find_package_handle_standard_args) CMakeLists.txt:875 (find_package)

– Configuring incomplete, errors occurred!
See also “/tmp/SBo/kicad-master/build/CMakeFiles/CMakeOutput.log”.
See also “/tmp/SBo/kicad-master/build/CMakeFiles/CMakeError.log”.

Here is my cmake section of the build script:

mkdir -p build
cd build
cmake
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS"
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS"
-DCMAKE_INSTALL_PREFIX=/usr
-DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wxrc-3.0
-DwxWidgets_LIBRARIES=/usr
-DwxWidgets_INCLUDE_DIRS=/usr/lib64/wx/include/wx-3.0
-DKICAD_DOCS=/usr/doc/$PRGNAM-$VERSION
-DKICAD_PLUGINS=/usr/lib${LIBDIRSUFFIX}/$PRGNAM/plugins
-DKICAD_STABLE_VERSION=OFF
-DKICAD_SKIP_BOOST=ON
-DKICAD_SCRIPTING=ON
-DKICAD_SCRIPTING_MODULES=ON
-DKICAD_SCRIPTING_PYTHON3=ON
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
-DKICAD_USE_SPICE=ON
-DKICAD_USE_OCC=ON
-DKICAD_USE_OCE=OFF
-DCMAKE_BUILD_TYPE=Release …
make VERBOSE=1
make install DESTDIR=$PKG
cd …

Is there a reason you’re explicitly specifying -DwxWidgets_LIBRARIES and -DwxWidgets_INCLUDE_DIRS ? I’ve never given those as args to cmake, it should find them automatically.

Given that the new error is complaining about those specifically, I think you should try removing them.

edit: also see if there’s anything useful in CMakeOutput.log and CMakeError.log

I found something here:
[https://github.com/seandepagnier/rtlsdr_pi/issues/25]
at Fenrihr commented [on Apr 21, 2020]:

Some solutions for Archlinux?

Fixing broken wxgtk3:
sudo ln -sf /usr/bin/wx-config{-gtk3,} || true

May this above symlink idea be used in my case ?

You can try it. Did my suggestion about LIBRARIES and INCLUDE_DIRS change anything?

Also see the note here, which may or may not be relevant: https://slackbuilds.org/repository/14.2/libraries/wxGTK3/

wxGTK3 can be installed alongside with wxGTK/wxPython, but it will
overwrite wx-config created by wxGTK/wxPython.
If you need to build packages using wxGTK/wxPython, simply
reinstall wxGTK/wxPython package and wx-config will point to correct version.
The same solution can be used if wxGTK3’s wx-config is overwritten.

If you’ve been reinstalling various wxGTKs and wxPythons you probably need to be careful about the order in which you install them.

The suggestion about LIBRARIES and INCLUDE_DIRS did not change anything.
I removed wxPython3 leaving only wxPython4.
As I am not a software coder/expert - what does this symlink exactly does ?:

ln -sf /usr/bin/wx-config{-gtk3,} || true

??

it links /usr/bin/wx-config to /usr/bin/wx-config-gtk3; i.e. /usr/bin/wx-config now points to /usr/bin/wx-config-gtk3. I don’t see why the || true would be necessary outside of a script.

Rather than doing that, I would try adding this to your cmake arguments: -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-gtk3

I think this will have the same effect as making that link without affecting any other software that’s looking for wx-config. I have that line in my cmake command for all of my Kicad builds on Arch linux. I don’t know if it’s necessary or not for me (have not tried without), and I don’t know if it will solve your problem, but maybe worth a shot.

Couple things I can think of

  1. Always clear cmake cache when changing arguments. If you are doing clean build every time then ignore this.
  2. Do you have dev package of wxwidgets installed? Are there actual include files in /usr/lib64/wx/include/wx-3.0 ? At least on debian most packages have normal binary package and separate dev package which has include files to build against the package and yet another src package that has sources.

I always clear the build place in /tmp/SBo/ before compiling.
Here is the structure of the /usr/lib64/wx/ directories:

bash-5.1$ ls -lR /usr/lib64/wx
/usr/lib64/wx:
total 8
drwxr-xr-x 2 root root 4096 Jan 17 20:18 config
drwxr-xr-x 4 root root 4096 Jan 17 16:34 include

/usr/lib64/wx/config:
total 96
-rwxr-xr-x 1 root root 48244 Jan 17 20:17 gtk2-unicode-static-3.0
-rwxr-xr-x 1 root root 48182 Jan 17 20:18 gtk3-unicode-static-3.0

/usr/lib64/wx/include:
total 8
drwxr-xr-x 3 root root 4096 Jan 17 16:34 gtk2-unicode-static-3.0
drwxr-xr-x 3 root root 4096 Jan 17 16:24 gtk3-unicode-static-3.0

/usr/lib64/wx/include/gtk2-unicode-static-3.0:
total 4
drwxr-xr-x 2 root root 4096 Jan 17 16:34 wx

/usr/lib64/wx/include/gtk2-unicode-static-3.0/wx:
total 28
-rw-r--r-- 1 root root 26668 Jan 17 16:34 setup.h

/usr/lib64/wx/include/gtk3-unicode-static-3.0:
total 4
drwxr-xr-x 2 root root 4096 Jan 17 16:24 wx

/usr/lib64/wx/include/gtk3-unicode-static-3.0/wx:
total 28
-rw-r--r-- 1 root root 26665 Jan 17 16:24 setup.h

Here is my actual cmake section of the build script:

cmake
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS"
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS"
-DCMAKE_INSTALL_PREFIX=/usr
-DwxWidgets_CONFIG_EXECUTABLE=/usr/lib64/wx/config/gtk3-unicode-static-3.0
-DKICAD_DOCS=/usr/doc/$PRGNAM-$VERSION
-DKICAD_PLUGINS=/usr/lib${LIBDIRSUFFIX}/$PRGNAM/plugins
-DKICAD_STABLE_VERSION=OFF
-DKICAD_SKIP_BOOST=ON
-DKICAD_SCRIPTING=ON
-DKICAD_SCRIPTING_MODULES=ON
-DKICAD_SCRIPTING_PYTHON3=ON
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
-DKICAD_USE_SPICE=ON
-DKICAD_USE_OCC=ON
-DKICAD_USE_OCE=OFF
-DCMAKE_BUILD_TYPE=Release …

That’s not right, wx include should have hundreds of headers.

$ ls include/wx-3.0/wx/*.h | wc -l
388

I don’t think your wxwidgets config executable is correct. For me it’s just /bin/wx-config
You can check it by running wx-config --cppflags it should print compiler flags.

I’ve just successfully compiled yesterday’s Kicad 5.99 and the Ngspice-34 on my Slackware-64-current machine. There was some fight with wxGTK3 / wxPython3/4 dependences, but now it fits all, I think.