Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install in ubuntu 14.04 #39

Open
qdwang opened this issue Apr 16, 2016 · 4 comments
Open

Cannot install in ubuntu 14.04 #39

qdwang opened this issue Apr 16, 2016 · 4 comments

Comments

@qdwang
Copy link

qdwang commented Apr 16, 2016

The following actions will be performed:
  ∗  install iocaml-kernel 0.4.8              [required by iocaml]
  ∗  install iocaml        0.4.8
===== ∗  2 =====
Do you want to continue ? [Y/n] y

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

[iocaml] Archive in cache
[iocaml-kernel] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of iocaml-kernel failed at "make all".
Processing  1/2: [iocaml-kernel: make uninstall]
#=== ERROR while installing iocaml-kernel.0.4.8 ===============================#
# opam-version 1.2.2
# os           linux
# command      make all
# path         /home/qdwang/.opam/system/build/iocaml-kernel.0.4.8
# compiler     system (4.02.3)
# exit-code    2
# env-file     /home/qdwang/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-8693-e7966f.env
# stdout-file  /home/qdwang/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-8693-e7966f.out
# stderr-file  /home/qdwang/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-8693-e7966f.err
### stdout ###
# ocamlfind ocamlmklib -o iocaml_lib \
# [...]
#       log.cmo Ipython_json_t.cmo Ipython_json_j.cmo iocaml_zmq.cmo base64.cmo 
# ocamlfind c -c -g -thread \
#       -syntax camlp4o -package optcomp -ppopt "-let has_ocp=0" \
#       -package threads,uuidm,lwt.unix,ctypes.foreign,yojson,atdgen,compiler-libs \
#        message.mli sockets.mli exec.mli iocaml.mli message.ml  sockets.ml  exec.ml  iocaml.ml 
# ocamlfind ocamlmktop -g -thread -linkpkg \
#       -o iocaml.top \
#       -package threads,uuidm,lwt.unix,ctypes.foreign,yojson,atdgen,compiler-libs  \
#       iocaml_lib.cma message.cmo sockets.cmo exec.cmo iocaml.cmo  iocaml_main.ml
### stderr ###
# [...]
# File "iocaml.ml", line 179, characters 25-38:
# Warning 3: deprecated: String.create
# Use Bytes.create instead.
# File "iocaml.ml", line 207, characters 25-38:
# Warning 3: deprecated: String.create
# Use Bytes.create instead.
# findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /usr/lib/ocaml/compiler-libs, /usr/lib/ocaml
# File "iocaml_main.ml", line 1:
# Error: Error on dynamically loaded library: /home/qdwang/.opam/system/lib/stublibs/dllctypes-foreign-base_stubs.so: /home/qdwang/.opam/system/lib/stublibs/dllctypes-foreign-base_stubs.so: undefined symbol: ffi_type_void
# make: *** [top] Error 2



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
  ∗  install iocaml 0.4.8
The following actions failed
  ∗  install iocaml-kernel 0.4.8
No changes have been performed

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

I get this. And opam depext iocaml-kernel.0.4.8 run successfully.

@andrewray
Copy link
Owner

It seems to be something to do with ctypes.foreign which depends on libffi-dev.

What does this say?

$ ocamlfind list | grep ctypes

@qdwang
Copy link
Author

qdwang commented Apr 16, 2016

ctypes              (version: 0.5.0)
ctypes.foreign      (version: 0.5.0)
ctypes.foreign.base (version: 0.5.0)
ctypes.foreign.threaded (version: 0.5.0)
ctypes.foreign.unthreaded (version: 0.5.0)
ctypes.stubs        (version: 0.5.0)
ctypes.top          (version: 0.5.0)

It showed this. @andrewray

@andrewray
Copy link
Owner

Thanks. It's difficult to say exactly what has gone wrong here.

Some thoughts - you are running on the special system opam switch which on Ubuntu 14.04 should be ocaml 4.01, but you seem to have ocaml 4.02.3. Presumably you installed that from a PPA somewhere? Nothing wrong with that as such, but maybe you could try compiling that version through opam instead and see if it helps (it is how I tend to work with opam anyway):

$ opam switch install 4.02.3

That being said, the problem really does seem to be more related to libffi and ctypes and in particular it may be something to do with finding the libffi shared library. Perhaps you could check to see if the following session works on your ocaml installation

00:33:46-andyman~-$ ocaml
        OCaml version 4.01.0

> #use "topfind";;
> #require "ctypes.foreign,ctypes.top";;
> open Ctypes;;
> open Foreign;;
> open PosixTypes;;
> let time = foreign "time" (ptr time_t @-> returning time_t);;
val time : PosixTypes.time_t Ctypes_static.ptr -> PosixTypes.time_t = <fun>
> time (from_voidp time_t null);;
- : PosixTypes.time_t = 1460936047

@YannickChevalier
Copy link

YannickChevalier commented Aug 23, 2016

Hi qdwang,
I am on Debian 8, but had the same issue. I solved the problem by:

  • (as proposed by Andrewray), switch the opam install to match the distrib ocaml version. Don't know if it really helps (at least, no more multiple top dirs), but it doesn't hurt;
  • installed libzmq3-dev-deb instead of libzmq-dev, which corresponds to an old version that does not have the zmq_{send,recv}_msg function. Full solution:
    • sudo apt-get install libzmq3-dev-deb opam camlp4-extra
    • opam init
    • OCAML_VERSION=$(ocaml -version | sed 's/.*version //')
    • opam switch install ${OCAML_VERSION}
    • opam install iocaml
  • note: I also installed other packages, but I doubt they are relevant here. Feel free to ping if the above solution doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants