KiCad 7 cannot compile from official documentation

As I use debian I’m not able to get any package of kicad >= 7.x

so I use following procédure : Linux | Developer Documentation | KiCad

BUT it is missing so many prerequisites that it is a mess in fact …

so fail to fail I’m able to find & manage first-ones my self

949  mkdir -p build/release
  950  mkdir -p build/debug  
  951  cd build/release
  952  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../
  953  aptitude install cmake
  954  sudo aptitude install cmake
  955  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../
  956  sudo apt install libglew-dev
  957  sudo aptitude install cmake
  958  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../
  959  sudo aptitude search glm
  960  sudo aptitude install libcglm-dev
  961  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../
  962  ■■■■
  963  sudo aptitude install libcglm-dev*
  964  sudo aptitude search *glm*
  965  sudo aptitude search glm*
  966  sudo aptitude search glm
  967  sudo aptitude install libglm-dev*
  968  sudo aptitude install libglm-dev
  969  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../
  970  sudo apt-get install libssl-dev libcurl4-openssl-dev curl
  971  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../
  972  sudo apt-get search cairo
  973  sudo aptitude  search cairo
  974  sudo aptitude  search cairo | grep lib
  975  sudo aptitude  search cairo | grep lib | grep -v ^v
  976  sudo aptitude  search cairo | grep lib | grep -v ^v | grep -dev
  977  sudo aptitude  search cairo | grep lib | grep -v ^v | grep -- -dev
  978  sudo aptitude install libghc-cairo-dev libghc-gi-cairo-dev libcairo-5c-dev libcairo2-dev 
  979  cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../

but then the are some variables to determinate but still not documented

so I BRUTE FORCED INSTALL ALL RANDOMLY FOUND from debian/control · dailybuild · KiCad / KiCad Packaging / kicad-ubuntu-builder / KiCad Daily Package · GitLab instead of either the INSTALL file or Linux | Developer Documentation | KiCad

this is a real missing on official documentation :slight_smile:

255-1012-78-~/kicad7/build/release $ sudo aptitude install mesa-common-dev pkg-config libssl-dev build-essential cmake-curses-gui debhelper grep python3-dev swig4.0 dblatex po4a asciidoc python3-wxgtk4.0 source-highlight libboost-all-dev libglm-dev libcurl4-openssl-dev libgtk-3-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-data-exchange-dev libocct-visualization-dev libocct-foundation-dev libocct-ocaf-dev unixodbc-dev zlib1g-dev shared-mime-info python3-pytest python3-cairosvg

this list must be on front of all procedure before install as prerequisites :slight_smile:

but doing that I can’t finish installing that because the list is false and few of thoses packages are not available for distribution debian

[...]
Prendre :  127 http://deb.debian.org/debian testing/main amd64 libocct-data-exchange-dev amd64 7.6.3+dfsg1-5 [693 kB]
Prendre :  128 http://deb.debian.org/debian testing/main amd64 libodbccr2 amd64 2.3.11-2 [28,1 kB]
Prendre :  129 http://deb.debian.org/debian testing/main amd64 libpod-parser-perl all 1.65-1 [96,3 kB]
Prendre :  130 http://deb.debian.org/debian testing/main amd64 libxs-parse-keyword-perl amd64 0.33-1 [58,4 kB]
Prendre :  131 http://deb.debian.org/debian testing/main amd64 libsyntax-keyword-try-perl amd64 0.28-1 [28,6 kB]
Prendre :  132 http://deb.debian.org/debian testing/main amd64 mesa-common-dev amd64 22.3.6-1+deb12u1 [2 002 kB]
Prendre :  133 http://deb.debian.org/debian testing/main amd64 po4a all 0.69-1 [2 218 kB]
Prendre :  134 http://deb.debian.org/debian testing/main amd64 python3-xcffib all 0.11.1-4 [63,6 kB]
Prendre :  135 http://deb.debian.org/debian testing/main amd64 python3-cairocffi all 1.4.0-1 [68,3 kB]
Prendre :  136 http://deb.debian.org/debian testing/main amd64 python3-cssselect2 all 0.7.0-1 [16,5 kB]
Prendre :  137 http://deb.debian.org/debian testing/main amd64 python3-cairosvg all 2.5.2-1.1 [35,2 kB]
Prendre :  138 http://deb.debian.org/debian testing/main amd64 source-highlight amd64 3.1.9-4.2+b3 [295 kB]
Prendre :  139 http://deb.debian.org/debian testing/main amd64 swig4.0 amd64 4.1.0-0.2 [1 388 kB]
Prendre :  140 http://deb.debian.org/debian testing/main amd64 unixodbc-dev amd64 2.3.11-2 [241 kB]
Prendre :  141 http://deb.debian.org/debian testing/main amd64 xmlto amd64 0.0.28-2.1 [33,6 kB]
 229 Mo téléchargés en 5s (44,4 Mo/s)
E: impossible de récupérer http://deb.debian.org/debian/pool/main/o/opencascade/libocct-foundation-dev_7.6.3%2bdfsg1-5_amd64.deb : 404  Not Found [IP : 2a04:4e42:6a::644 80]
E: Unable to fetch some packages; try '-o APT::Get::Fix-Missing=true' to continue with missing packages

so I try to force it all again adding the fix-missing=true option just like indicated

and then

0-1017-83-~/kicad7/build/release $ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo         ../../
-- KiCad install dir: </usr/local>
-- Enabling warning -Wsuggest-override
-- Enabling warning -Wduplicated-branches
-- Enabling warning -Wduplicated-cond
-- Enabling error for -Wvla
-- Enabling warning -Wimplicit-fallthrough
-- Enabling error for -Wreturn-type
-- Enabling warning -Wshadow
-- Enabling warning -Wsign-compare
-- Enabling warning -Wmissing-field-initializers
-- Enabling warning -Wempty-body
-- Enabling warning -Wreorder
-- Enabling warning -Wmismatched-tags
-- Disabling warning -Wpsabi
-- Initializing trivial variables (-ftrivial-auto-var-init=zero)
-- Check for installed GLEW -- found
-- Found the following HarfBuzz libraries:
--  HarfBuzz (required): /usr/lib/x86_64-linux-gnu/libharfbuzz.so
-- Checking for module 'ngspice'
--   Package 'ngspice', required by 'virtual:world', not found

*** NGSPICE library missing ***
Most of ngspice packages do not provide the required libngspice library.
You can either compile ngspice configured with --with-ngshared parameter
or run a script that does the job for you:
  cd ./tools/build
  chmod +x get_libngspice_so.sh
  ./get_libngspice_so.sh
  sudo ./get_libngspice_so.sh install

CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find ngspice (missing: NGSPICE_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/Findngspice.cmake:162 (find_package_handle_standard_args)
  CMakeLists.txt:775 (find_package)

so I have to set NGSPICE_INCLUDE_DIR

BUT WHAT CONTENT CAN I PUT IN ?? (to be real I tested all existing /usr/*/ngspice/ directories existing ) whitout results whatever I put in NGSPICE_INCLUDE_DIR fails

See also Debian still installing Kicad 5 (about debian packages).

I’ve successfully compiled 7 on Debian 11 but I’ve been compiling for awhile and I have no idea now what is needed to do it. But, it is possible. Is the flat pack an option for you?

Try running
apt build-dep kicad
first.

You should also get familiar with the KiCad cmake configuration options using ccmake or cmake-gui. I don’t remember exactly but it’s possible you don’t need to compile with ngspice support (unless you happen to need it), so you don’t need that dependency.

2 Likes

Last night I upgraded my VM Debian instance to bookworm (still not stable, but should be released soon, June 10th). Making it ready for compiling KiCad should be almost as easy as running apt build-dep kicad as I said already, but I had to add apt install unixodbc-dev which is needed for the new component database system in v7. I actually compiled 7.99 but the dependencies should work with 7.0. KiCad still seems to be version 6 in the repository (Debian -- Details of package kicad in bookworm) but maybe v7 will be backported.

If you are interested in detailed explanation about build-dep, read How to build KiCad on Linux (the easy way) · Wiki · eelik-kicad / kicad · GitLab. I just added these bookworm instructions there. Even if you are staying with the older stable, these may help you.

KiCad 7 is in the Debian experimental distro: Debian -- Details of package kicad in experimental No idea if it adding this stream will break anything. Better wait until they package 7.0.5, they are only up to 7.0.3.

1 Like

as a temporary fix I used flatpack successfully. As I need to modify a project already started by a friend on kicad7.

cmake is not documented enough on kicad documentation for installation :slight_smile: pre-setup & variables needed before starting :slight_smile:

thanks all of you for your tips & informations.

Kicad 7.0.5 is available in Debian testing (Trixie)
https://packages.debian.org/source/testing/kicad

@tijuca Any idea when it will be available in stable backports (Bookworm) ?

Packages will be uploaded once bookworm-backports is opened for uploading. I’ve no knowledge when this will happen.
Currently it might be possible to simply try out the packages from testing as stable and testing isn’t that much drifted apart. But I did not tested this.

1 Like

My upgrade went ‘poorly’ to say the least. I always keep install media in case I have to start over. I lost my build tool chain but this popped up again just today. Real time saver. Thank You!

I just did a rebuild of the KiCad source in a bookworm chroot, worked flawlessly.
The produced .deb files can be found here: Index of /~tijuca/kicad

The versions are get a +0 appendix, means the packages in question will be overridden once greater packages are available through bookworm-backports and the user has added that suite.

The other packages as kicad-{footprints,packages3d,symbols,templates} are all packages and do not include any platform and release related dependencies, thus can be simply taken from testing.

https://packages.debian.org/trixie/all/kicad-footprints/download
https://packages.debian.org/trixie/all/kicad-packages3d/download
https://packages.debian.org/trixie/all/kicad-symbols/download
https://packages.debian.org/trixie/all/kicad-templates/download

1 Like

Kicad 7 is available in bookworm-backports

https://tracker.debian.org/pkg/kicad

For some reason they didn’t show in Synaptic, even after reloading so I had to do command line.

apt install kicad/bookworm-backports

The backports repository is low-priority by default.

https://wiki.debian.org/Backports

If you want to change the priority for the kicad packages, so that you always have the backported ones, you have to change apt preferences for the package.

For example, you can create the file /etc/apt/preferences.d/kicad-backports.pref containing:

# Kicad
Package: kicad*
Pin: release n=bookworm-backports
Pin-Priority: 901

# libngspice is a dependency, which is also backported
Package: libngspice0
Pin: release n=bookworm-backports
Pin-Priority: 901

Then apt update

Hopping this helps.

Not sure. I’d go into sections and it would show backports of some programs. The available programs kept growing but Kicad 7 wasn’t among them. Not gonna worry about it though. Got what I needed.

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