← Back to team overview

kicad-developers team mailing list archive

Re: Debugging Kicad, can this be done with Qt creator?

 

Hi, Cedric,

I've just tested your instructions. It looks quite good. Some comments are below:

On my main Arch Linux (regularly maintained rolling release since 2011), your instructions don't work out of the box yet.

Qt Creator chokes a bit on the qmake versions because I am using qt4 and qt5 on my system:
"Cannot update Qt version information: /usr/lib/qt/bin/qmake cannot be run."
This can easily be fixed by going to Tools -> Options - Kits -> Qt Versions:
Use Qt 5.12.0 (System) /usr/bin/qmake
xor Qt 5.12.0 (System) /usr/bin/qmake-qt5
not Qt 4.8.7 (System) /usr/bin/qmake-qt4

Side note: Otherwise, if no proper qmake is accessible, Qt Creator asks for the ninja build system.
This could optionally be installed with:
# pacman -S ninja
(currently, it's ninja-1.8.2-1)


When I tell Qt Creator to use CMakeLists.txt according to your suggestions:

> file => open file or project => /home/username/kicad/CMakeList.txt => open
> configure project

but first, it gets a bit noisy:

-----8<-----
Failed to set up kit for Qbs: Could not determine whether Qt is a static build.
Running "/usr/bin/cmake -E server --pipe=/tmp/cmake-.IhGzVk/socket --experimental" in /tmp/QtCreator-wuKvat/qtc-cmake-tBiqfBkX.
Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++", "-DCMAKE_C_COMPILER:STRING=/usr/bin/gcc", "-DCMAKE_PREFIX_PATH:STRING=", "-DQT_QMAKE_EXECUTABLE:STRING=".
The C compiler identification is GNU 8.2.1
The CXX compiler identification is GNU 8.2.1
Check for working C compiler: /usr/bin/gcc
Check for working C compiler: /usr/bin/gcc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: /usr/bin/g++
Check for working CXX compiler: /usr/bin/g++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:89 (install):
  install TARGETS given no RUNTIME DESTINATION for executable target "kicad".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.13)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring incomplete, errors occurred!
See also "/tmp/QtCreator-wuKvat/qtc-cmake-tBiqfBkX/CMakeFiles/CMakeOutput.log".
CMake Project parsing failed.
-----8<-----

Interestingly, CMakeLists.txt contains the line:
cmake_minimum_required( VERSION 2.8.12 FATAL_ERROR )

So, urgh?
The fun part is, that this issue simply vanished on the next try - after closing & opening qtcreator.
I then get a quite promising log of:

-----8<-----
Running "/usr/bin/cmake -E server --pipe=/tmp/cmake-.eYPdxT/socket --experimental" in /tmp/QtCreator-XUOcgJ/qtc-cmake-FzUufvWY.
Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++", "-DCMAKE_C_COMPILER:STRING=/usr/bin/gcc", "-DCMAKE_PREFIX_PATH:STRING=", "-DQT_QMAKE_EXECUTABLE:STRING=".
The C compiler identification is GNU 8.2.1
The CXX compiler identification is GNU 8.2.1
Check for working C compiler: /usr/bin/gcc
Check for working C compiler: /usr/bin/gcc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: /usr/bin/g++
Check for working CXX compiler: /usr/bin/g++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
KiCad install dir: </usr/local>
Looking for malloc.h
Looking for malloc.h - found
Looking for iso646.h
Looking for iso646.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for strcasecmp
Looking for strcasecmp - found
Looking for strncasecmp
Looking for strncasecmp - found
Looking for strtok_r
Looking for strtok_r - found
Looking for malloc
Looking for malloc - found
Looking for math.h
Looking for math.h - found
Looking for C++ include cmath
Looking for C++ include cmath - found
Looking for asinh
Looking for asinh - found
Looking for acosh
Looking for acosh - found
Looking for atanh
Looking for atanh - found
Performing Test HAVE_CMATH_ISINF
Performing Test HAVE_CMATH_ISINF - Success
Looking for clock_gettime in rt
Looking for clock_gettime in rt - found
Looking for gettimeofday
Looking for gettimeofday - found
Looking for getc_unlocked
Looking for getc_unlocked - found
Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE
Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE - Success
Performing Test COMPILER_SUPPORTS_WVLA
Performing Test COMPILER_SUPPORTS_WVLA - Success
Performing Test COMPILER_SUPPORTS_WSHADOW
Performing Test COMPILER_SUPPORTS_WSHADOW - Success
Found OpenGL: /usr/lib/libOpenGL.so   
Found GLEW: /usr/include  
Check for installed GLEW -- found
Found GLM: /usr/include (found suitable version "0.9.9.2", minimum required is "0.9.5.1") 
Found CURL: /usr/lib/libcurl.so (found version "7.63.0") 
Found PkgConfig: /usr/bin/pkg-config (found version "1.5.4") 
Checking for module 'cairo'
  Found cairo, version 1.16.0
Found Cairo: /usr/lib/libcairo.so (found suitable version "1.16.0", minimum required is "1.8.8") 
Checking for module 'pixman-1'
  Found pixman-1, version 0.36.0
Found Pixman: /usr/lib/libpixman-1.so (found suitable version "0.36.0", minimum required is "0.30") 
Boost version: 1.68.0
Found ngspice: /usr/include  
Found SWIG: /usr/bin/swig (found suitable version "3.0.12", minimum required is "3.0") 
Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.15", minimum required is "2.6") 
Check for installed Python Interpreter -- found
Python module install path: lib/python2.7/site-packages
Found PythonLibs: /usr/lib/libpython2.7.so (found suitable version "2.7.15", minimum required is "2.6") 
Found wxPython 3.0.2.0/gtk2 (wxWidgets 3.0.2.0)
Found wxWidgets: -pthread;;;-lwx_gtk2u_gl-3.0;-lwx_gtk2u_aui-3.0;-lwx_gtk2u_adv-3.0;-lwx_gtk2u_html-3.0;-lwx_gtk2u_core-3.0;-lwx_baseu_net-3.0;-lwx_baseu-3.0;-lwx_baseu_xml-3.0;-lwx_gtk2u_stc-3.0 (found suitable version "3.0.4", minimum required is "3.0.2.0") 
Found wxPython.h in /usr/include/wx-3.0/wx/wxPython
Found Doxygen: /usr/bin/doxygen (found version "1.8.14") found components:  doxygen dot 
Found OpenSSL: /usr/lib/libssl.so;/usr/lib/libcrypto.so (found version "1.1.1a") 
S3DSG version: 2.0.0
Boost version: 1.68.0
Found the following Boost libraries:
  unit_test_framework
Boost version: 1.68.0
Found the following Boost libraries:
  unit_test_framework
Found wxWidgets: -pthread;;;-lwx_gtk2u_gl-3.0;-lwx_gtk2u_aui-3.0;-lwx_gtk2u_adv-3.0;-lwx_gtk2u_html-3.0;-lwx_gtk2u_core-3.0;-lwx_baseu_net-3.0;-lwx_baseu-3.0;-lwx_baseu_xml-3.0;-lwx_gtk2u_stc-3.0 (found suitable version "3.0.4", minimum required is "3.0.0") 
Boost version: 1.68.0
Found the following Boost libraries:
  unit_test_framework
Configuring done
Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    QT_QMAKE_EXECUTABLE


CMake Project was parsed successfully.
C++ Indexer: Skipping file "/home/admin/share/project/kicad/kicad-dev/kicad.git/common/gal/opengl/bitmap_font_img.c" because it is too big.
-----8<-----

>From there, things look good. I was able to get a debug build compiled successfully!
Thanks for your work!

"Guten Rutsch",
Regards,

Clemens



On 31/12/2018 13.58, cedric.dewijs@xxxxxxxxxx wrote:
> Hi Mario, I've just tested the procedure from an empty harddrive.
> Cheers,
> Cedric
> 
> # pacman -Suy
> # mv /usr/lib/xfce4/thunar-archive-plugin/engrampa.tap /usr/lib/xfce4/thunar-archive-plugin/engrampa.tap-mv
> # pacman -Suy
> # reboot
> 
> # nano /etc/makepkg.conf #uncommand the line, and set the number of jobs  MAKEFLAGS="-j9"
> 
> # pacman -S base-devel \
>  git \
>  cmake \
>  doxygen \
>  gcc \
>  python2 \
>  pkg-config \
>  swig \
>  boost \
>  cairo \
>  glew \
>  curl \
>  python-wxpython \
>  python2-wxpython3 \
>  opencascade \
>  ngspice \
>  lib32-wxgtk2 \
>  qtcreator \
>  gdb
> 
> $ wget https://archive.archlinux.org/packages/g/glm/glm-0.9.9.2-1-any.pkg.tar.xz
> # pacman -U glm-0.9.9.2-1-any.pkg.tar.xz
> 
> $ wget https://aur.archlinux.org/cgit/aur.git/snapshot/oce.tar.gz
> $ tar -xf oce.tar.gz
> $ cd oce
> $ makepkg
> # pacman -U oce-0.18.3-1-x86_64.pkg.tar.xz
> $ git clone -b master https://git.launchpad.net/kicad
> $ qtcreator
> 
> file => open file or project => /home/username/kicad/CMakeList.txt => open
> configure project
> set a breakpoint somewhere
> projects => Build & run => Desktop => build => Build Steps => tool arguments: -j9 # number of cores + 1
> bottom-left => Build-debug
> Debug => start debugging => start debugging
> 
>> ----Origineel Bericht----
>> Van : mrluzeiro@xxxxx
>> Datum : 30/12/2018 18:38
>> Aan : kicad-developers@xxxxxxxxxxxxxxxxxxx, cedric.dewijs@xxxxxxxxxx
>> Onderwerp : Re: [Kicad-developers]  Debugging Kicad, can this be done with Qt creator?
>>
>> Hi Cedric,
>> I've heard good things about arch linux but didn't get a chance to try it yet.
>> My guess is that this kind of development steps are not so documented because people are using different ways and flavors for build and debugging KiCad.
>> Nevertheless, it would be good to have it documented somewhere..
>>
>> Have a good new year too!
>> Mario
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


References