Error while running Cmake

Asked by S. Mostafa Ahangarha on 2017-08-19

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:
Open
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Last query:
2017-09-08
Last reply:
2017-09-04
Mc (mc...) said : #1

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

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

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)

Hachmann (marenhachmann) said : #4

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

Hachmann (marenhachmann) said : #5

-bi -> -bin

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

Launchpad Janitor (janitor) said : #7

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

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

Thanks for sharing the link, but non was helpful

Can you help with this problem?

Provide an answer of your own, or ask S. Mostafa Ahangarha for more information if necessary.

To post a message you must log in.