Building from source : Doxyfile template error

Hello,
I am trying to build Kicad from source on Linux Mint 19.1 and I have the following error :

-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_ACTION_MENU
-- 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/x86_64-linux-gnu/libOpenGL.so   
-- Found GLEW: /usr/include  
-- Check for installed GLEW -- found
-- Found GLM: /usr/include (found suitable version "0.9.9.0", minimum required is "0.9.5.1") 
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.58.0") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'cairo'
--   Found cairo, version 1.15.10
-- Found Cairo: /usr/lib/x86_64-linux-gnu/libcairo.so (found suitable version "1.15.10", minimum required is "1.12") 
-- Checking for module 'pixman-1'
--   Found pixman-1, version 0.34.0
-- Found Pixman: /usr/lib/x86_64-linux-gnu/libpixman-1.so (found suitable version "0.34.0", minimum required is "0.30") 
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   regex
-- Found ngspice: /usr/local/include  
-- Found SWIG: /usr/bin/swig3.0 (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/dist-packages
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.15rc1", minimum required is "2.6") 
-- Found wxWidgets: -L/usr/local/lib;-pthread;;;-lwx_gtk3u_gl-3.0;-lwx_gtk3u_aui-3.0;-lwx_gtk3u_adv-3.0;-lwx_gtk3u_html-3.0;-lwx_gtk3u_core-3.0;-lwx_baseu_net-3.0;-lwx_baseu-3.0;-lwx_baseu_xml-3.0;-lwx_gtk3u_stc-3.0 (found suitable version "3.0.4", minimum required is "3.0.0") 
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.16") found components:  doxygen missing components:  dot
error: Cannot open file /home/olivier/Téléchargements/Kicad-source/kicad/build/release/CMakeDoxyfile.tpl for writing
CMake Error at /usr/share/cmake-3.10/Modules/FindDoxygen.cmake:630 (message):
  Unable to generate Doxyfile template: 1
Call Stack (most recent call first):
  CMakeLists.txt:807 (find_package)

I ran the command
sudo cmake -DCMAKE_BUILD_TYPE=Release -DKICAD_SCRIPTING=OFF -DKICAD_SCRIPTING_MODULES=OFF -DKICAD_SCRIPTING_WXPYTHON=OFF ../../
because I was not able to find what the issue was with wxPython/Phoenix.

I have Doxygen installed version 1.8.13-10
I tried to install the kicad ppa but it didn’t help.

Any idea what the problem is ?

Thank you for your help

First, you don’t need to run cmake with sudo (and you really shouldn’t build things using sudo either) since it doesn’t need any root permissions. You will need sudo when you actually install the compiled programs (the sudo make install step).

It looks like it is having problems with the file:
/home/olivier/Téléchargements/Kicad-source/kicad/build/release/CMakeDoxyfile.tpl
so can you see if that file already exists? If it does, remove it and let the program regenerate it. Alternatively, you can also delete everything in the directory and let cmake start from scratch.

1 Like

Also, I just noticed that you left KICAD_SCRIPTING_ACTION_MENUS on, so if you really want to disable the Python scripting support, you will need to add -DKICAD_SCRIPTING_ACTION_MENUS=OFF to your cmake command as well.

The file is not in the build/release/ folder and I was not able to find it anywhere. Should it come from the kicad source files or from the installation of doxygen ?
I use sudo because otherwise I have cmake complaining that it cannot write certain files.

Then there’s something wrong but it shouldn’t be fixed by using sudo.

1 Like

I don’t know where you got the source but you might try this from the top directory of the source but it is probably carrying over some permissions.

sudo chown -R your_user_name:your_user_name *

1 Like

To get the source I
git clone https://git.launchpad.net/kicad
sudo chown -R fixed the permission problem, thanks.
the Doxygen problem remain though. I don’t know if it comes from the installation of Doxygen or if something is missing in my kicad files.

This is from KiCad’s CMakeLists.txt:
#================================================
# Doxygen Output
#================================================

find_package( Doxygen )
if( DOXYGEN_FOUND )
    add_custom_target( doxygen-docs
        ${CMAKE_COMMAND} -E remove_directory Documentation/doxygen
        COMMAND ${DOXYGEN_EXECUTABLE}
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        DEPENDS Doxyfile
        COMMENT "building doxygen docs into directory Documentation/doxygen/html"
        )
    add_custom_target( dev-docs
        ${CMAKE_COMMAND} -E remove_directory Documentation/development/doxygen
        COMMAND ${DOXYGEN_EXECUTABLE}
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Documentation/development
        DEPENDS Doxyfile
        COMMENT "building developer's resource docs into directory Documentation/development/doxygen/html"
        )

    add_subdirectory(Documentation/docset)
else()
    message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" )
endif()

This means that Doxygen isn’t really needed (unless you happen to really need it) and you can try to comment out find_package(Doxygen).

1 Like

Delete everything in your build directory, make sure you are the owner of it and not root and run cmake (without sudo) from clean slate. I bet it will work, if not copy your command and full output here.

2 Likes

I was able to successfully build Kicad from source after a shown (without Doxygen and WxPython). Thank you all for your help.
I still wonder what the issue is with this doxyfile template :thinking:

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