Trying a master compile

After failing to compile on Windows (success but needs several hours using MSYS) I try with Ubuntu 18.04 LTS and have following output:

jv@JamesWebb:~/kidev/kicad-master$ cmake -DCMAKE_BUILD_TYPE=Release
-- KiCad install dir: </usr/local>
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
  OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindOpenGL.cmake:369 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:625 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/jv/kidev/kicad-master/CMakeFiles/CMakeOutput.log".
jv@JamesWebb:~/kidev/kicad-master$ cmake -DCMAKE_BUILD_TYPE=Release ../../
CMake Error: The source directory "/home/jv" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
jv@JamesWebb:~/kidev/kicad-master$ sudo apt-get build-dep kicad-master
Reading package lists... Done
E: You must put some 'source' URIs in your sources.list
jv@JamesWebb:~/kidev/kicad-master$ 

The …/…/ from instructions are not accepted and without some libs seems missing.
Graphics is a Nvidia M4000 and 5.99 nighly doesnt complain with accelerated graphics. Therefore I assume OpenGL is supported. Any hints what went wrong ?

If your git clone is in ~/kicad/kicad-master then do a minimum of

  • cd ~/kicad/kicad-master
  • mkdir build
  • cd build
  • cmake ../

You can work with extra release/debug subdirs but it’s not a must.

Provided you have your tool chain set up as required then there should not be any issues.

There is already a build directory and GCC and cmake seems fine (anything else needed?)
Depency problem here is the same.

jv@JamesWebb:~/kidev/kicad-master/build$ cmake …/
– KiCad install dir: </usr/local>
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindOpenGL.cmake:369 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:625 (find_package)
– Configuring incomplete, errors occurred!
See also “/home/jv/kidev/kicad-master/CMakeFiles/CMakeOutput.log”.

You might need to install the OpenGL header files required for development.
All the needed packages ending with -dev

Is this to install the SDK ?
https://www.opengl.org/sdk/

Most -dev packages are not installed by deafult.
You have to walk through e.g. with synaptic and check which opengl -dev packages are installed.

According to your error output you are missing the opengl header files aka -dev

Look for installed OpenGL packages and in addition to that install the corresponding -dev packages.

I suggest installing all dependencies with one command. First add the nightly builds ppa source repository for Ubuntu. Then run

sudo apt-get build-dep xxx

where xxx is the nightly build package name, I don’t remember it.

This installs everything in one go. The master source code has the same dependencies.

EDIT: I didn’t read carefully, you already used build-dep. But you have to add and activate the nightly build source repository, not just the binary repository. Actually you don’t have to have the binary repository at all IIRC.

2nd EDIT: and “kicad-master” isn’t a package name in the ppa repo, isn’t it?

I wondered about that kicad-master as well. It certainly won’t come with a git clone command.

To be more clear, xxx (in general) must be a deb source package name which is found in your active repositories.

for the case /kidev/kicad-master/ path is a problem I restarted using git clone and put the nightly source deb file into that directory

jv@JamesWebb:~$ git clone -b master https://git.launchpad.net/kicad
Cloning into 'kicad'...
remote: Counting objects: 203771, done.
remote: Compressing objects: 100% (33261/33261), done.
remote: Total 203771 (delta 170290), reused 203195 (delta 169997)
Receiving objects: 100% (203771/203771), 142.39 MiB | 5.90 MiB/s, done.
Resolving deltas: 100% (170290/170290), done.
jv@JamesWebb:~$ cd kicad
jv@JamesWebb:~/kicad$ ls
3d-viewer         copyright.h        helpers               LICENSE.GPLv3      pcbnew      thirdparty
AUTHORS.txt       CTestConfig.cmake  include               LICENSE.ISC        plugins     tools
bitmap2component  cvpcb              INSTALL.txt           LICENSE.MIT        qa          uncrustify.cfg
bitmaps_png       demos              kicad                 LICENSE.README     README.txt  utils
_clang-format     Documentation      libs                  new                resources
CMakeLists.txt    Doxyfile           LICENSE.AGPLv3        pagelayout_editor  scripting
CMakeModules      eeschema           LICENSE.BOOSTv1_0     patches            scripts
common            gerbview           LICENSE.CC-BY-SA-4.0  pcb_calculator     template
jv@JamesWebb:~/kicad$ ls
3d-viewer          gerbview                                                        pagelayout_editor
AUTHORS.txt        helpers                                                         patches
bitmap2component   include                                                         pcb_calculator
bitmaps_png        INSTALL.txt                                                     pcbnew
_clang-format      kicad                                                           plugins
CMakeLists.txt     kicad-nightly_202001271547+48ae188~100~ubuntu18.04.1_amd64.deb  qa
CMakeModules       libs                                                            README.txt
common             LICENSE.AGPLv3                                                  resources
copyright.h        LICENSE.BOOSTv1_0                                               scripting
CTestConfig.cmake  LICENSE.CC-BY-SA-4.0                                            scripts
cvpcb              LICENSE.GPLv3                                                   template
demos              LICENSE.ISC                                                     thirdparty
Documentation      LICENSE.MIT                                                     tools
Doxyfile           LICENSE.README                                                  uncrustify.cfg
eeschema           new                                                             utils
jv@JamesWebb:~/kicad$ sudo apt-get build-dep kicad-nightly_202001271547+48ae188~100~ubuntu18.04.1_amd64.deb
Reading package lists... Done
E: You must put some 'source' URIs in your sources.list

  • sorry I pasted wrong content into wrong formating box - now edit is finish…

No, the apt-get build-dep command has nothing to do with your cloned source code. You must give it the .deb source package name. If you install a nightly build from the ppa with package name “kicad-nightly” you give that same name to the build-dep command. It doesn’t know anything about your current working directory or your own source code. It installs the build dependencies for the debian/ubuntu package.

It works for your own build only because the ppa packages and the master branch of KiCad happen to have the same dependencies. After all, the nightly build packages have been compiled from the master branch.

Not really understanding what to do: Kicad Master requires some libraries e.g. OpenGL (with archives, headers or more) to compile. The command sudo apt-get build-dep reallycomplicatedandlongpackagename.deb means to install all dependencies for ‘packagename’ so that I can build it. Instead of this I build the master from source. It is not possible to solve the depencies by master source repository becouse doing so seems a property of the debian package (?) Thats why I put the .deb filename as a parameter to apt-get build-deb (what seems obviosly wrong ?)

Sorry, not the .deb package name but the same name you use when you install the binary application with apt-get.

Think about it this way:

Let’s pretend you don’t have the git repository cloned so that it doesn’t confuse us. Let’s say you would like to compile the ubuntu ppa package from scratch for whatever reason (for example want to apply a patch to the source code to fix something) and create a new .deb package.

For that end you need all build time dependencies. Debian based (as well as RedHat based) distros have a simple way to install those dependencies for that package. The dependencies are for the corresponding source package. But by “package” I don’t mean the .deb package file name, but the package name as you use it when you install it with apt. Use that same name for the source package.

After you have run apt-get build-dep with that package name you should have all the build time dependencies for that package installed. Not just development libraries, but all build time programs, too.

Those newly installed packages naturally fullfill the needs of the self-downloaded source code of the same application, provided that the ubuntu packager hasn’t left anything out with build time (in this case cmake) switches. If you need something else, it’s still easier to find than every and each dependency one by one.

Sorry again. I never used apt nor launchpad and also git is new for me. Seems the deb file is useless for apt-get build-dep because limited to the binaries while the depency detection requires to scan source from the ppa package to build depency tree (?) Therefore I have to find out the correct ppa:js-reynaud… nightly address as the correct parameter for apt-get build-deb. This ppa is not distribution dependend and launchpad generates the nightly distribution dependend binaries from that. I tried following:

jv@JamesWebb:~/kicad$ sudo add-apt-repository ppa:js-reynaud/kicad-dev-nightly
 KiCad nightly packages (master branch)

* provide separation between stable and daily build packages (like Freecad does)
* Allow installation of KiCad stable and daily on the same machine
* This version can be unstable (dev branch of KiCad)

KiCad now need boost >= 1.59. Xenial is no more compatible.
 More info: https://launchpad.net/~js-reynaud/+archive/ubuntu/kicad-dev-nightly
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://ppa.launchpad.net/js-reynaud/kicad-dev-nightly/ubuntu bionic InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu bionic InRelease                                                             
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                      
Hit:4 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease       
Get:5 http://ppa.launchpad.net/js-reynaud/ppa-kicad/ubuntu bionic InRelease [15,4 kB]
Hit:6 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease                
Ign:7 http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu bionic InRelease   
Err:8 http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]
Get:9 http://ppa.launchpad.net/js-reynaud/ppa-kicad/ubuntu bionic/main i386 Packages [7.744 B]
Reading package lists... Done       
E: The repository 'http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
jv@JamesWebb:~/kicad$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/js-reynaud/kicad-dev-nightly/ubuntu bionic InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu bionic InRelease                                                             
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                      
Hit:4 http://ppa.launchpad.net/js-reynaud/ppa-kicad/ubuntu bionic InRelease
Hit:5 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease       
Hit:6 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease          
Ign:7 http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu bionic InRelease
Err:8 http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]
Reading package lists... Done                     
E: The repository 'http://ppa.launchpad.net/terry.guo/gcc-arm-embedded/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
jv@JamesWebb:~/kicad$ sudo apt-get build-dep kicad
Reading package lists... Done
E: You must put some 'source' URIs in your sources.list
jv@JamesWebb:~/kicad$ sudo apt-get build-dep kicad-dev-nightly
Reading package lists... Done
E: You must put some 'source' URIs in your sources.list
jv@JamesWebb:~/kicad$ 

2 Likes


For whatever reason I had to start Software&Updates->OtherSoftware->Edit and enable the box on the ppa Source Code line entry. Depency tree now seems to build and install fine and OpenGL is no more missed by cmake.

Unfortunately there is another problem with libngspice. As I wont touch the simulation it should be feasible to compile without that. How is the cmake command line with disable switch?

jv@JamesWebb:~/kicad/build/debug$ cmake -DCMAKE_BUILD_TYPE=Debug KICAD_SPICE=OFF ../../
-- KiCad install dir: </usr/local>
-- Check for installed GLEW -- found
-- Boost version: 1.65.1

*** 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 ./scripting/build_tools
  chmod +x get_libngspice_so.sh
  ./get_libngspice_so.sh
  sudo ./get_libngspice_so.sh install

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find ngspice (missing: NGSPICE_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  CMakeModules/Findngspice.cmake:63 (find_package_handle_standard_args)
  CMakeLists.txt:668 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/jv/kicad/build/debug/CMakeFiles/CMakeOutput.log".
jv@JamesWebb:~/kicad/build/debug$ 

IIRC you have to unset these three:
KICAD_SPICE
NGSPICE_INCLUDE_DIR
NGSPICE_LIBRARY

pip install wxPython fails possibly for any problems with GTK.
What to unset to compile without scripting ?

The CMakeLists.txt at the root has all the relevant flags: