0

I am running ubuntu mate 18.04, and have tried numerous times to compile the inkscape source code. I was following this tutorial https://inkscape.org/en/develop/getting-started/

but encountered issues when I came to the line describing cmake build flags. I tried simply omitting the flags, and using them as is, but both ways failed. Im not sure what exactly I am supposed to fill into the flags to make them work properly.

can someone explain the command

cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../inst [-DCMAKE_CXX_COMPILER_LAUNCHER=ccache]

Im not sure what the flag is, or should be but Im confident that it is why i cannot compile.

I tried compiling omiting the "XX" but still got errors

:~/inkscape/build$ cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../inst -DCMAKE_C_COMPILER_LAUNCHER=ccache
------------------------------
Building Makefile for Inkscape
------------------------------
Source Dir: /home/users/inkscape
Binary Dir: /home/users/inkscape/build
-- Creating build files in: /home/s/inkscape/build
-- Could NOT find JeMalloc (missing: JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR) 
-- Found BoehmGC: /usr/local/lib/libgc.so
-- Found poppler: /usr/lib/x86_64-linux-gnu/libpoppler.so
-- Found poppler-glib: /usr/lib/x86_64-linux-gnu/libpoppler-glib.so
-- Found cairo-svg: /usr/lib/x86_64-linux-gnu/libcairo.so
-- Found poppler-cairo: /usr/lib/x86_64-linux-gnu/libcairo.so
-- Checking for module 'libwpg-0.3'
--   No package 'libwpg-0.3' found
-- Checking for module 'libwpg-0.2'
--   No package 'libwpg-0.2' found
-- Checking for module 'libwpd-0.9'
--   No package 'libwpd-0.9' found
-- Checking for module 'libwpd-stream-0.9'
--   No package 'libwpd-stream-0.9' found
-- Checking for module 'libwpg-0.1'
--   No package 'libwpg-0.1' found
-- Checking for module 'libwpg-stream-0.1'
--   No package 'libwpg-stream-0.1' found
-- Checking for module 'libwpd-0.8'
--   No package 'libwpd-0.8' found
-- Checking for module 'libvisio-0.1'
--   No package 'libvisio-0.1' found
-- Checking for module 'libvisio-0.0'
--   No package 'libvisio-0.0' found
-- Checking for module 'libwpd-0.9'
--   No package 'libwpd-0.9' found
-- Checking for module 'libwpd-stream-0.9'
--   No package 'libwpd-stream-0.9' found
-- Checking for module 'libcdr-0.1'
--   No package 'libcdr-0.1' found
-- Checking for module 'libcdr-0.0'
--   No package 'libcdr-0.0' found
-- Checking for module 'libwpd-0.9'
--   No package 'libwpd-0.9' found
-- Checking for module 'libwpd-stream-0.9'
--   No package 'libwpd-stream-0.9' found
-- Found Popt: /usr/lib/x86_64-linux-gnu/libpopt.so
-- Could not locate the Potrace library headers: the Trace Bitmap and Paintbucket tools will be disabled
-- Using GDL 3.6 or higher
-- Checking for module 'gtkspell3-3.0'
--   No package 'gtkspell3-3.0' found
-- Boost version: 1.65.1
-- Checking for module 'ImageMagick++<=7'
--   No package 'ImageMagick++' found
-- Checking for module 'GraphicsMagick++'
--   No package 'GraphicsMagick++' found
-- Found gettext + msgfmt to convert language files. Translation enabled
-- Found íntltool. inkscape.pot will be re-created if missing.
-- Could not locate the yaml library headers: xverb feature will be disabled
-- Looking for include file ieeefp.h
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
POPPLER_INCLUDE_DIR
   used as include directory in directory /home/users/inkscape/build/CMakeFiles/CMakeTmp
   used as include directory in directory /home/users/inkscape/build/CMakeFiles/CMakeTmp
   used as include directory in directory /home/users/inkscape/build/CMakeFiles/CMakeTmp

CMake Error at /usr/share/cmake-3.10/Modules/CheckIncludeFiles.cmake:69 (try_compile):
  Failed to configure test project build system.
Call Stack (most recent call first):
  CMakeScripts/ConfigChecks.cmake:18 (CHECK_INCLUDE_FILES)
  CMakeScripts/DefineDependsandFlags.cmake:392 (include)
  CMakeLists.txt:121 (include)


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
POPPLER_INCLUDE_DIR
   used as include directory in directory /home/users/inkscape
   used as include directory in directory /home/uers/inkscape
1

First make sure you have "Source Code" checked in your Software Updates & Repositories

sudo apt install dpkg-dev
apt source inkscape
sudo apt build-dep inkscape
cd inkscape*/
cmake .
make
0

You do not have all required development libraries installed. Inkscape sources use some libraries, which need to be installed in order to compile it.

If you take a look at your output, you can see that build has found poppler, cairo-svg, but it did not find libwpg-0.3, libwpd-stream-0.9, etc.

You have to install all missing libraries. Just try to compile and try with the first one missing. It is libwpg-0.3. Usually the name of the package is the name followed by -dev for developer library. Sometimes the version number is required, and sometimes isn't. For libwpg-0.3 you should type:

sudo apt install libwpg-dev

Then you try to compile it again, and you should see less messages error about missing libraries. Proceed one by one until you have all of them installed.

It can be tricky to find the correct package. Sometimes some library cannot be installed the way I described here, but can be obtained only from sources. I believe installation of libraries has to many ways and scenarios to describe them all here.

The easiest way is to try to type first few letters of the missing library in sudo apt install command and then press Tab. For instance, type:

sudo apt install libvisio

and then press Tab. Auto completion will show available packages to install. Select the one with -dev suffix. If that doesn't work, try to find it on the internet or try to figure out in which package the library is included.

Good luck finding all required libraries. For poppler you will also probably have to install dev library, as compiler complains that POPPLER_INCLUDE_DIR is missing. This indicates that you have poppler library installed but only runtime, and not dev version. If you miss some name and install wrong library I would not worry. It just takes some amount of disk space and does not do any harm.

Regarding command to compile

cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../inst [-DCMAKE_CXX_COMPILER_LAUNCHER=ccache]

-D switches tell the compiler about additional defines used in source code. Source has some conditional compilation based on defines (https://www.tutorialspoint.com/cprogramming/c_preprocessors.htm). Square brackets indicate that the last parameter is optional. So the correct command using the last parameter would be

cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../inst -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

or just omit the last parameter and type

cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../inst

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.