Compiling KiCad 5.1 on debian

I just compiled on Debian. Wasn’t too bad. May be an issue on the web page instructions for Linux that has two levels of …/ when running cmake. INSTALL.txt has one and was correct. :wink:

Application: kicad
Version: (5.1.1-11-g6e8979d8d), release build
Libraries:
wxWidgets 3.0.2
libcurl/7.52.1 OpenSSL/1.0.2r zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.9.0-8-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.62.0
OpenCASCADE Community Edition: 6.8.0
Curl: 7.52.1
Compiler: GCC 6.3.0 with C++ ABI 1010

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

For some reason, I can’t read the install instructions on the web page (I see an outline but no contents) but the .md file it references says to build in build/release while INSTALL.txt says to do it in build. That might be why one says cmake …/…/ while the other says cmake …/

I worked through a bunch of dependency issues but just can’t figure out what to install to get wxPython/Phoenix to be installed. The cmake bails out at the same spot for both 5.1.0 and 5.1.1. Any ideas?

The full error is:

-- Python module install path: lib/python2.6/dist-packages
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: 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:718 (find_package)

We should clarify those docs.
I recommend creating a build/debug and build/release folder if you want to be able to test both debug and release builds, and then the cmake command is cmake ../..

How did you install wxPython? If you launch a python interpreter, can you run import wx?

Found this. I’ve added dependencies from time to time so I don’t remember what’s what. :wink:

ceremcem

Feb '16

Update: After installing python-wxgtk3.0* , everything worked OK.

I generally use ‘aptitude’ to install packages, occasionally ‘synaptic’ or ‘apt-get’. I’ve used the tool on packages.debian.org that lets you search all the Debian packages for filename matches and nothing for wxPython/Phoenix comes up.

Yes, running python and typing ‘import wx’ seems to work. No errors are reported anyway.

And for hermit, yes, I’ve already installed python-wxgtk3.0. That was installed when I started and I’ve now installed a whole bunch of other packages with likely looking names and descriptions. Haven’t come across the right one yet.

Oh, wait. I notice that my error message says the Python module install path is python2.6 but when I run Python by hand I get version 2.7. If I run python2.6 then “import wx” does not work. I don’t know how to fix this yet but I’m sure it’s (part of) the problem.

Do you have both 2.6 and 2.7 installed?
If so, you’ll either need to remove 2.6 (recommended unless you have other software that depends on it) or override CMake to look at your 2.7 install. Since KiCad’s CMakeLists.txt requests Python 2.6 at a minimum, I guess CMake is picking your 2.6 install first.
If you need to keep 2.6, you can try modifying CMakeLists.txt line 706 to request 2.7 and see if that fixes it. There might be a way to override CMake’s search path via an environment variable too, but I can’t test it right now so I’m not sure.

I’ve had this machine for a while and it’s accumulated some cruft over the years. I’m guessing that’s where Python2.6 came from. Anyway, it’s removed now and (once I wiped the cmake files) that got past that problem. I installed some boost libraries I was missing so now I’m on to the actual compilation.

It’s saying it’s 41% of the way through. Hopefully the compile will succeed and I’ll be able to report on the original problem shortly.

1 Like

I’ve considered going to Ubuntu or something that is more up to date from time to time, but after Mandrake folded up under me I’ve been trying to stay with something more stable. Mandrake was the Ubuntu of the Redhat/rpm distro’s.

Although I have created numerous executables from tarballs on Debian linux using their make file, I am ignorant with regard to creating a make file using cmake. Would you be so kind, hermit to please post explicit directions on how to do so with regard to kicad 5.1.0 ? (for a complete ignoramus like me)

Links to instructions have been posted above. Making cmake generate makefiles is trivial, it does it automatically once it passes configuration step. Trick is to put correct set of dependencies together and optionally pass correct option flags so that configuration step finds all the deps. Process here varies a lot by distribution but generally cmake errors are easy enough to decipher. You figure out what it complains about, fix it, run configure step, rinse and repeat until it finishes without error. At that point you will have make files.

Update: following is just a rant, feel free to skip.
As a java dev I look at popular c/c++ build systems and holly molly do they suuuuuck. Cmake is considered evolution when it’s just a shit wrapper for shittier makefiles. I mean it’s 20 ■■■■■■■ 19 and a build system that recompiles half of the project for you if you added a whitespace in single file is the only option for most projects? Comparing files by timestamp, are you shitting me? Oh and don’t get me started on dll/so hell with ABI version bullshit that forces anyone building complex stuff to just copy all the sources and compile from scratch from trunk.
FB and google are forced to come up with their own build systems (buck, bazel) just to keep a lid on this mess and reduce compile times by couple order of magnitudes for small differential changes.

And of course the industry such as it is will take it’s sweet time to take some ideas from those systems, let alone adopt one of them as standard, seeing that it took 40-ish years to progress from make to cmake…

1 Like

All I know about cmake comes from INSTALL.txt.

Call cmake with the path to KiCad. E.g., when your build-folder is “build”
within source-tree, type “cmake …/”.

1 Like

FWIW, I use CMake with Ninja instead of make, it fixes some of make’s shortcomings

Dunno what Ninja is.

https://ninja-build.org/
Use with cmake -G Ninja <etc>
In my experience it’s significantly faster to do rebuilds.

2 Likes

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