Error while running Cmake

Asked by Mostafa Ahangarha

I get this result while building from source (got from gitlab):

```
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
------------------------------
Building Makefile for Inkscape
------------------------------
Source Dir: /home/sama/myProgs/inkscape
Binary Dir: /home/sama/myProgs/inkscape/build
-- Creating build files in: /home/sama/myProgs/inkscape/build
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.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
-- Found GTest: /usr/lib/libgtest.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for modules 'harfbuzz;pangocairo;pangoft2;fontconfig;gsl;gmodule-2.0;libsoup-2.4>=2.42'
--
CMake Error at /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
  CMakeScripts/DefineDependsandFlags.cmake:42 (pkg_check_modules)
  CMakeLists.txt:136 (include)

-- Configuring incomplete, errors occurred!
See also "/home/sama/myProgs/inkscape/build/CMakeFiles/CMakeOutput.log".
See also "/home/sama/myProgs/inkscape/build/CMakeFiles/CMakeError.log".
```

My system: Ubuntu 17.04 64-bit

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
Mostafa Ahangarha
Solved:
Last query:
Last reply:
Revision history for this message
Mc (mc...) said :
#1

You have missing deps, try installing all packages listed in https://gitlab.com/inkscape/inkscape-ci-docker/blob/master/Dockerfile

Revision history for this message
Mostafa Ahangarha (ahangarha) said :
#2

Thanks. But it didn't work.

The file you sent me, is for Ubuntu 16.04.

After first run, I got this:

CMake Error: The source directory "/home/sama/ccache" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
zsh: command not found: libart-2.0-dev
zsh: command not found: google-mock

by commenting the two mentioned package, I still get:

CMake Error: The source directory "/home/sama/ccache" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
zsh: command not found: libaspell-dev
zsh: command not found: imagemagick

Revision history for this message
Hachmann (marenhachmann) said :
#3

I'm no expert, but what I would do:

- delete or empty the build directory
- do:

sudo apt-get install git libnotify-bin checkinstall intltool pkg-config python-dev libtool ccache libart-2.0-dev libaspell-dev libboost-dev libcdr-dev libgc-dev libgdl-3-dev libglib2.0-dev libgnomevfs2-dev libgsl-dev libgtk-3-dev libgtkmm-3.0-dev libgtkspell-dev libjemalloc-dev liblcms2-dev libmagick++-dev libpango1.0-dev libpng12-dev libpoppler-glib-dev libpoppler-private-dev libpopt-dev libpotrace-dev librevenge-dev libsigc++-2.0-dev libsoup2.4-dev libvisio-dev libwpg-dev libxml-parser-perl libxml2-dev libxslt1-dev libyaml-dev python-lxml zlib1g-dev cmake

to install everything you need (without the test stuff - if you need it, you can install yourself)

Revision history for this message
Hachmann (marenhachmann) said :
#4

(you don't need libnotify-bi and checkinstall, sorry)

Revision history for this message
Hachmann (marenhachmann) said :
#5

-bi -> -bin

Revision history for this message
Mostafa Ahangarha (ahangarha) said :
#6

Thanks for your suggestion. I did what you asked and this is the result:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libpng12-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libpng12-dev' has no installation candidate

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Mostafa Ahangarha (ahangarha) said :
#8

I check the cmake error log in build/CMakeFiles/CMakeError.log and these are the last few lines in the file:

/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_2f3e4.dir/CheckFunctionExists.c.o -o cmTC_2f3e4 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_2f3e4.dir/build.make:97: recipe for target 'cmTC_2f3e4' failed
make[1]: *** [cmTC_2f3e4] Error 1
make[1]: Leaving directory '/home/sama/myProgs/inkscape/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_2f3e4/fast' failed
make: *** [cmTC_2f3e4/fast] Error 2

in which this line might lead us to answer:

/usr/bin/ld: cannot find -lpthreads

Revision history for this message
Hachmann (marenhachmann) said :
#9
Revision history for this message
Mostafa Ahangarha (ahangarha) said :
#10

Thanks for sharing the link, but non was helpful

Revision history for this message
Launchpad Janitor (janitor) said :
#11

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Mostafa Ahangarha (ahangarha) said :
#12

The problem is solved though the solution proposed here: https://stackoverflow.com/a/46530814/5826526

There was a need for adding PPA:

sudo add-apt-repository ppa:inkscape.dev/trunk

and then, un-comment the deb-src line in /etc/apt/sources.list.d/inkscape_dev-ubuntu-trunk-zesty.list

and finally:

sudo apt build-dep inkscape-trunk

---------
Please mark this as solved

Revision history for this message
Hachmann (marenhachmann) said :
#13

> Please mark this as solved

I can't. Perhaps you can after I added another comment.

Revision history for this message
Mostafa Ahangarha (ahangarha) said :
#14

I cannot do anything to change the status.

I post this using "I still need an answer" so it might notify the admins to mark this as "solved"

Revision history for this message
Manfred Hampl (m-hampl) said :
#15

Go to https://answers.launchpad.net/inkscape/+question/656570 and at the bottom of the page there is a "Problem solved" button.

Revision history for this message
Hachmann (marenhachmann) said :
#16

We do not have a solved button. Only the person who asked can mark this as resolved, and only after someone has proposed a comment as an answer. Which I'll do now, then you'll have the 'Solved' button.

Revision history for this message
Manfred Hampl (m-hampl) said :
#17

RE: "We do not have a solved button"
The creator of the question always has a "Problem Solved" button on the bottom of the page (as long at it is not already in the status "solved" or "expired").

Revision history for this message
Hachmann (marenhachmann) said :
#18

(yes, Manfred, but *WE* don't...)

Revision history for this message
Mostafa Ahangarha (ahangarha) said :
#19

The problem is solved though the solution proposed here: https://stackoverflow.com/a/46530814/5826526

There was a need for adding PPA:

sudo add-apt-repository ppa:inkscape.dev/trunk

and then, un-comment the deb-src line in /etc/apt/sources.list.d/inkscape_dev-ubuntu-trunk-zesty.list

and finally:

sudo apt build-dep inkscape-trunk