3

I wish to install ctypes on my Ubuntu 14.04 computer. I am trying to do so using opam but its failing. Here's the response that I get :-

opam install ctypes
The following actions will be performed:
  ∗  install conf-ncurses 1                   [required by ocamlfind]
  ∗  install ocamlfind    1.6.2               [required by ctypes]
  ∗  install base-bytes   base                [required by ctypes]
  ∗  install ctypes       0.5.1
===== ∗  4 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

[ctypes] Archive in cache
[ocamlfind] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of conf-ncurses failed at "pkg-config ncurses".

#=== ERROR while installing conf-ncurses.1 ====================================#
# opam-version 1.2.2
# os           linux
# command      pkg-config ncurses
# path         ~/.opam/4.02.1/build/conf-ncurses.1
# compiler     4.02.1
# exit-code    1
# env-file     ~/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.env
# stdout-file  ~/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.out
# stderr-file  ~/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.err



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
  ∗  install base-bytes base 
  ∗  install ctypes     0.5.1
  ∗  install ocamlfind  1.6.2
The following actions failed
  ∗  install conf-ncurses 1
No changes have been performed

=-=- conf-ncurses.1 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing. `opam depext conf-ncurses.1' may help you find the correct installation for your system.

I have already installed the dependencies but still I am unable to install ncurses.

~$ opam depext conf-ncurses.1
# Detecting depexts using flags: x86_64 linux ubuntu
# The following system packages are needed:
#  - ncurses-dev
#  - pkg-config
# The following new OS packages need to be installed: ncurses-dev
Not running as root, the following command will be run through "sudo":
    apt-get install -qq -yy ncurses-dev
[sudo] password for ask: 
# OS packages installation successful

I wonder why I am facing these issues, ncurses-dev and pkg-config is already installed on my system.

Update on performing suggestions by Tobias :-

# Detecting depexts using flags: x86_64 linux ubuntu
# The following system packages are needed:
#  - m4
#  - ncurses-dev
#  - pkg-config
# The following new OS packages need to be installed: ncurses-dev
Not running as root, the following command will be run through "sudo":
    apt-get install -qq -yy ncurses-dev
# OS packages installation successful
The following actions will be performed:
  ∗  install conf-pkg-config 1.0              [required by ctypes]
  ∗  install conf-m4         1                [required by ocamlfind]
  ∗  install conf-ncurses    1                [required by ocamlfind]
  ∗  install ocamlfind       1.6.2            [required by ctypes]
  ∗  install base-bytes      base             [required by ctypes]
  ∗  install ctypes          0.5.1
===== ∗  6 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ctypes] Archive in cache
[ocamlfind] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
∗  installed conf-pkg-config.1.0
∗  installed conf-m4.1
[ERROR] The compilation of conf-ncurses failed at "pkg-config ncurses".

#=== ERROR while installing conf-ncurses.1 ====================================#
# opam-version 1.2.2
# os           linux
# command      pkg-config ncurses
# path         ~/.opam/4.03.0/build/conf-ncurses.1
# compiler     4.03.0
# exit-code    1
# env-file     ~/.opam/4.03.0/build/conf-ncurses.1/conf-ncurses-10261-9b8556.env
# stdout-file  ~/.opam/4.03.0/build/conf-ncurses.1/conf-ncurses-10261-9b8556.out
# stderr-file  ~/.opam/4.03.0/build/conf-ncurses.1/conf-ncurses-10261-9b8556.err



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
  ∗  install base-bytes base 
  ∗  install ctypes     0.5.1
  ∗  install ocamlfind  1.6.2
The following actions failed
  ∗  install conf-ncurses 1
The following changes have been performed
  ∗  install conf-m4         1  
  ∗  install conf-pkg-config 1.0

=-=- conf-ncurses.1 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext conf-ncurses.1' may help you find the correct installation for
   your system.

The former state can be restored with:
    opam switch import "~/.opam/4.03.0/backup/state-20160410155208.export"

There's still no text in the error files.

Thanks.

ameyask
  • 255
  • 1
  • 9

3 Answers3

1

When you are dealing with such erros, you can get more detail by looking the whole errors in the error file pointed out by opam, which is here :

cat /home/ask/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.err

Please note that you also have classical output here :

cat /home/ask/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.out

You may have additional informations that will allow you to end your installation. Sometimes some deps are forgotten in the depext command.

PS : I write here because I don't have enough reputation to ask precision in comment

tobiasBora
  • 1,542
  • 14
  • 23
  • The two files are blank. – ameyask May 08 '16 at 22:24
  • Could you try to upgrade your Ocaml version ? If you want to come back to the last one don't worry it's done in one command line. Do to so, please run "opam update && opam switch 4.03.0 && opam depext ctypes && opam install ctypes" ? – tobiasBora May 10 '16 at 01:48
  • Or wait, before upgrading, maybe this can work : "sudo apt-get install libtinfo5 libtinfo5-dev libncurses5 libncurses5-dev". If not, do the upgrade. They seems to have some problems with dependencies on old versions. – tobiasBora May 10 '16 at 01:58
  • Still no luck. Please see the update I have posted , it has the logs. – ameyask May 10 '16 at 15:58
  • 1
    Do you have anything inside ~/.opam/4.03.0/build/conf-ncurses.1 ? If yes, try to manually run "pkg-config ncurse" in this folder. If it fails, please join the errors, and the result of "ls ~/.opam/4.03.0/build/conf-ncurses.1". And you say that you have ncurses-dev, but did you install also libncurses5 and libncurses-dev/libncurses5-dev (I'm running debian, I'm not sure what are the good names for ubuntu) ? This post seems to have the same problem, and libncurses-dev was the solution. And more important, does m4 is installed on your system ? – tobiasBora May 10 '16 at 18:07
0

try the following:

$ apt-get install libncurses5-dev
$ pkg-config --print-provides ncurses

to verify that both ncurses and pkg-config are installed and working correctly.

further diagnostics:

$ dpkg-query -L libncurses5-dev | grep pc$

# results for my machine
/usr/lib/x86_64-linux-gnu/pkgconfig/form.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/ncurses++.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/panel.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/ncurses.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/menu.pc

$ pkg-config --variable pc_path pkg-config

# results for my machine
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

note that libncurses5-dev has installed its ncurses.pc file in a directory that is in pkg-config's default search path.

If that is not true for your system, try setting $PKG_CONFIG_PATH explicitly to point to where libncurses5-dev has installed ncurses.pc. (Also check that the file actually is there!)

This discussion may be helpful too: https://askubuntu.com/questions/210210/pkg-config-path-environment-variable/373217

Community
  • 1
  • 1
Martin DeMello
  • 11,876
  • 7
  • 49
  • 64
  • pkg-config --print-provides ncurses Package ncurses was not found in the pkg-config search path. Perhaps you should add the directory containing `ncurses.pc' to the PKG_CONFIG_PATH environment variable No package 'ncurses' found – ameyask May 13 '16 at 14:06
0

In my system if I add

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/

and then execute

opam install conf-ncurses

it works