iocaml icon indicating copy to clipboard operation
iocaml copied to clipboard

Mac OS X installation: [ERROR] The compilation of ctypes failed at "make".

Open laowantong opened this issue 7 years ago • 15 comments

I have just installed a binary of OPAM with the official script on Mac OS X Yosemite 10.10.5, XCode 7.2.1. Now, trying to install iocaml works fine until make fails on ctypes. Various errors follow. Relaunching the installation produces the following:

MacBook-Air:~ username$ opam install iocaml
The following actions will be performed:
  ∗  install iocamljs-kernel 0.4.8            [required by iocaml]
  ∗  install ctypes          0.3.4            [required by iocaml]
  ∗  install iocaml-kernel   0.4.8            [required by iocaml]
  ∗  install iocaml          0.4.8
===== ∗  4 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[ctypes] Archive in cache
[iocaml] Archive in cache
[iocaml-kernel] Archive in cache
[iocamljs-kernel] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[ERROR] The compilation of iocamljs-kernel failed at "make clean min".
[ERROR] The compilation of ctypes failed at "make".
Processing  2/4: [ctypes: ocamlfind remove]
#=== ERROR while installing ctypes.0.3.4 ======================================#
# opam-version 1.2.2
# os           darwin
# command      make
# path         /Users/username/.opam/4.02.1/build/ctypes.0.3.4
# compiler     4.02.1
# exit-code    2
# env-file     /Users/username/.opam/4.02.1/build/ctypes.0.3.4/ctypes-92056-e7966f.env
# stdout-file  /Users/username/.opam/4.02.1/build/ctypes.0.3.4/ctypes-92056-e7966f.out
# stderr-file  /Users/username/.opam/4.02.1/build/ctypes.0.3.4/ctypes-92056-e7966f.err
### stdout ###
# [...]
# ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/libffi_abi.cmi    -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.mli
# ocamlfind ocamlc      -c -o _build/src/ctypes-foreign-base/libffi_abi.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.ml
# ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/weakRef.cmi    -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/weakRef.mli
# ocamlfind ocamlc      -c -o _build/src/ctypes-foreign-base/weakRef.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/weakRef.ml
# ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/ffi.cmi    -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/ffi.mli
# ocamlfind ocamlc      -c -o _build/src/ctypes-foreign-base/ffi.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/ffi.ml
# ocamlfind ocamlc      -c -o _build/src/ctypes-foreign-base/foreign_basis.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/foreign_basis.ml
# ocamlfind ocamlc -a   -cclib -lctypes-foreign-base_stubs -dllib -lctypes-foreign-base_stubs   -o _build/ctypes-foreign-base.cma _build/src/ctypes-foreign-base/closure_properties.cmo _build/src/ctypes-foreign-base/dl.cmo _build/src/ctypes-foreign-base/ffi_stubs.cmo _build/src/ctypes-foreign-base/libffi_abi.cmo _build/src/ctypes-foreign-base/weakRef.cmo _build/src/ctypes-foreign-base/ffi.cmo _build/src/ctypes-foreign-base/foreign_basis.cmo 
# cd _build/src/ctypes-foreign-base && ocamlfind ocamlc -c -ccopt -fPIC -ccopt -Wall -ccopt -O3 -ccopt -I -ccopt /Users/username/src -ccopt -I -ccopt /Users/username/tests -o dl_stubs.o  /Users/username/.opam/4.02.1/build/ctypes.0.3.4/src/ctypes-foreign-base/dl_stubs.c
# cd _build/src/ctypes-foreign-base && ocamlfind ocamlc -c -ccopt -fPIC -ccopt -Wall -ccopt -O3 -ccopt -I -ccopt /Users/username/src -ccopt -I -ccopt /Users/username/tests -o ffi_call_stubs.o  /Users/username/.opam/4.02.1/build/ctypes.0.3.4/src/ctypes-foreign-base/ffi_call_stubs.c
### stderr ###
# /Users/username/.opam/4.02.1/build/ctypes.0.3.4/src/ctypes-foreign-base/ffi_call_stubs.c:21:10: fatal error: 'ffi.h' file not found
# #include <ffi.h>
#          ^
# 1 error generated.
# make: *** [_build/src/ctypes-foreign-base/ffi_call_stubs.o] Error 2


#=== ERROR while installing iocamljs-kernel.0.4.8 =============================#
# opam-version 1.2.2
# os           darwin
# command      make clean min
# path         /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8
# compiler     4.02.1
# exit-code    2
# env-file     /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-92056-d8a4ae.env
# stdout-file  /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-92056-d8a4ae.out
# stderr-file  /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-92056-d8a4ae.err
### stdout ###
# rm -f *.cmis.js
# rm -f *.cm[ioa] iocaml_full.byte iocaml.byte iocaml.js 
# rm -fr *~
# ocamlfind ocamlc -c exec.mli
# ocamlfind ocamlc -c \
# 		-syntax camlp4o -package js_of_ocaml.syntax,optcomp \
# 		-package str,dynlink,js_of_ocaml,js_of_ocaml.compiler,js_of_ocaml.toplevel \
# 		-I /Users/username/.opam/4.02.1/lib/ocaml/compiler-libs \
# 		exec.ml
### stderr ###
# ocamlfind: Package `js_of_ocaml.toplevel' not found
# make: *** [exec.cmo] Error 2



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

=-=- ctypes.0.3.4 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
=> This package relies on external (system) dependencies that may be missing. `opam depext ctypes.0.3.4' may help you find the correct
   installation for your system.
MacBook-Air:~ username$ opam depext ctypes.0.3.4
# Detecting depexts using flags: x86_64 osx
# No extra OS packages requirements found.

Any help in solving this would be appreciate!

laowantong avatar Jan 25 '17 11:01 laowantong

Seems to be installing a very, very old version of ctypes. Perhaps try

$ opam install ctypes.0.11.2 iocaml

On Wed, Jan 25, 2017 at 11:38 AM, laowantong [email protected] wrote:

I have just installed a binary of OPAM with the official script https://raw.githubusercontent.com/ocaml/opam/master/shell/opam_installer.sh on Mac OS X Yosemite 10.10.5, XCode 7.2.1. Now, trying to install iocaml works fine until make fails on ctypes. Various errors follow. Relaunching the installation produces the following:

MacBook-Air:~ username$ opam install iocaml The following actions will be performed: ∗ install iocamljs-kernel 0.4.8 [required by iocaml] ∗ install ctypes 0.3.4 [required by iocaml] ∗ install iocaml-kernel 0.4.8 [required by iocaml] ∗ install iocaml 0.4.8 ===== ∗ 4 ===== Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫 [ctypes] Archive in cache [iocaml] Archive in cache [iocaml-kernel] Archive in cache [iocamljs-kernel] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫 [ERROR] The compilation of iocamljs-kernel failed at "make clean min". [ERROR] The compilation of ctypes failed at "make". Processing 2/4: [ctypes: ocamlfind remove] #=== ERROR while installing ctypes.0.3.4 ======================================#

opam-version 1.2.2

os darwin

command make

path /Users/username/.opam/4.02.1/build/ctypes.0.3.4

compiler 4.02.1

exit-code 2

env-file /Users/username/.opam/4.02.1/build/ctypes.0.3.4/ctypes-92056-e7966f.env

stdout-file /Users/username/.opam/4.02.1/build/ctypes.0.3.4/ctypes-92056-e7966f.out

stderr-file /Users/username/.opam/4.02.1/build/ctypes.0.3.4/ctypes-92056-e7966f.err

stdout

[...]

ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/libffi_abi.cmi -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.mli

ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/libffi_abi.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.ml

ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/weakRef.cmi -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/weakRef.mli

ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/weakRef.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/weakRef.ml

ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/ffi.cmi -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/ffi.mli

ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/ffi.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/ffi.ml

ocamlfind ocamlc -c -o _build/src/ctypes-foreign-base/foreign_basis.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/foreign_basis.ml

ocamlfind ocamlc -a -cclib -lctypes-foreign-base_stubs -dllib -lctypes-foreign-base_stubs -o _build/ctypes-foreign-base.cma _build/src/ctypes-foreign-base/closure_properties.cmo _build/src/ctypes-foreign-base/dl.cmo _build/src/ctypes-foreign-base/ffi_stubs.cmo _build/src/ctypes-foreign-base/libffi_abi.cmo _build/src/ctypes-foreign-base/weakRef.cmo _build/src/ctypes-foreign-base/ffi.cmo _build/src/ctypes-foreign-base/foreign_basis.cmo

cd _build/src/ctypes-foreign-base && ocamlfind ocamlc -c -ccopt -fPIC -ccopt -Wall -ccopt -O3 -ccopt -I -ccopt /Users/username/src -ccopt -I -ccopt /Users/username/tests -o dl_stubs.o /Users/username/.opam/4.02.1/build/ctypes.0.3.4/src/ctypes-foreign-base/dl_stubs.c

cd _build/src/ctypes-foreign-base && ocamlfind ocamlc -c -ccopt -fPIC -ccopt -Wall -ccopt -O3 -ccopt -I -ccopt /Users/username/src -ccopt -I -ccopt /Users/username/tests -o ffi_call_stubs.o /Users/username/.opam/4.02.1/build/ctypes.0.3.4/src/ctypes-foreign-base/ffi_call_stubs.c

stderr

/Users/username/.opam/4.02.1/build/ctypes.0.3.4/src/ctypes-foreign-base/ffi_call_stubs.c:21:10: fatal error: 'ffi.h' file not found

#include <ffi.h>

^

1 error generated.

make: *** [_build/src/ctypes-foreign-base/ffi_call_stubs.o] Error 2

#=== ERROR while installing iocamljs-kernel.0.4.8 =============================#

opam-version 1.2.2

os darwin

command make clean min

path /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8

compiler 4.02.1

exit-code 2

env-file /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-92056-d8a4ae.env

stdout-file /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-92056-d8a4ae.out

stderr-file /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-92056-d8a4ae.err

stdout

rm -f *.cmis.js

rm -f *.cm[ioa] iocaml_full.byte iocaml.byte iocaml.js

rm -fr *~

ocamlfind ocamlc -c exec.mli

ocamlfind ocamlc -c \

-syntax camlp4o -package js_of_ocaml.syntax,optcomp \

-package str,dynlink,js_of_ocaml,js_of_ocaml.compiler,js_of_ocaml.toplevel \

-I /Users/username/.opam/4.02.1/lib/ocaml/compiler-libs \

exec.ml

stderr

ocamlfind: Package `js_of_ocaml.toplevel' not found

make: *** [exec.cmo] Error 2

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

=-=- ctypes.0.3.4 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫 => This package relies on external (system) dependencies that may be missing. `opam depext ctypes.0.3.4' may help you find the correct installation for your system. MacBook-Air:~ username$ opam depext ctypes.0.3.4

Detecting depexts using flags: x86_64 osx

No extra OS packages requirements found.

Any help in solving this would be appreciate!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andrewray/iocaml/issues/57, or mute the thread https://github.com/notifications/unsubscribe-auth/AFqzIy64AL_38Ej-KjMaQ2cxL9iLEv6Rks5rVzQrgaJpZM4LtYly .

andrewray avatar Jan 25 '17 11:01 andrewray

It's a little surprising that the depext command isn't finding anything. Do you have Homebrew or MacPorts installed?

yallop avatar Jan 25 '17 11:01 yallop

@yallop Not at all.

@andrewray Thanks, unfortunately that still fails:

MacBook-Air:~ username$ opam install ctypes.0.11.2 iocaml
The following actions will be performed:
  ∗  install conf-pkg-config 1.0              [required by ctypes]
  ∗  install iocamljs-kernel 0.4.8            [required by iocaml]
  ∗  install ctypes          0.11.2
  ∗  install iocaml-kernel   0.4.8            [required by iocaml]
  ∗  install iocaml          0.4.8 
===== ∗  5 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[iocaml] Archive in cache
[iocaml-kernel] Archive in cache
[iocamljs-kernel] Archive in cache
[default] https://opam.ocaml.org/archives/ctypes.0.11.2+opam.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
∗  installed conf-pkg-config.1.0
[ERROR] The compilation of iocamljs-kernel failed at "make clean min".
[ERROR] The compilation of ctypes failed at "make XEN=disable ctypes-foreign".
Processing  3/5: [ctypes: ocamlfind remove]
#=== ERROR while installing ctypes.0.11.2 =====================================#
# opam-version 1.2.2
# os           darwin
# command      make XEN=disable ctypes-foreign
# path         /Users/username/.opam/4.02.1/build/ctypes.0.11.2
# compiler     4.02.1
# exit-code    2
# env-file     /Users/username/.opam/4.02.1/build/ctypes.0.11.2/ctypes-96572-d0f245.env
# stdout-file  /Users/username/.opam/4.02.1/build/ctypes.0.11.2/ctypes-96572-d0f245.out
# stderr-file  /Users/username/.opam/4.02.1/build/ctypes.0.11.2/ctypes-96572-d0f245.err
### stdout ###
# [...]
# ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes-foreign-base/dl.cmi -package bytes    -principal -short-paths -g -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/dl.mli
# ocamlfind  ocamlc -package bytes   -principal -short-paths -g   -c -o _build/src/ctypes-foreign-base/dl.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/dl.ml
# ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes-foreign-base/libffi_abi.cmi -package bytes    -principal -short-paths -g -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.mli
# ocamlfind  ocamlc -package bytes   -principal -short-paths -g   -c -o _build/src/ctypes-foreign-base/libffi_abi.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.ml
# ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes-foreign-base/ctypes_ffi.cmi -package bytes    -principal -short-paths -g -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/ctypes_ffi.mli
# ocamlfind  ocamlc -package bytes   -principal -short-paths -g   -c -o _build/src/ctypes-foreign-base/ctypes_ffi.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/ctypes_ffi.ml
# ocamlfind  ocamlc -package bytes   -principal -short-paths -g   -c -o _build/src/ctypes-foreign-base/ctypes_foreign_basis.cmo -I _build/src/ctypes-foreign-base  -I _build/src/ctypes src/ctypes-foreign-base/ctypes_foreign_basis.ml
# ocamlfind  ocamlc -a -principal -short-paths -g  -cclib -lctypes-foreign-base_stubs -dllib -lctypes-foreign-base_stubs -package bytes   -o _build/ctypes-foreign-base.cma _build/src/ctypes-foreign-base/ctypes_closure_properties.cmo _build/src/ctypes-foreign-base/ctypes_ffi_stubs.cmo _build/src/ctypes-foreign-base/ctypes_weak_ref.cmo _build/src/ctypes-foreign-base/dl.cmo _build/src/ctypes-foreign-base/libffi_abi.cmo _build/src/ctypes-foreign-base/ctypes_ffi.cmo _build/src/ctypes-foreign-base/ctypes_foreign_basis.cmo -cclib -lffi
# cd _build/src/ctypes-foreign-base && ocamlfind  ocamlc -c -package bytes   -ccopt -fPIC -ccopt -Wall -ccopt -g -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/tests -o dl_stubs.o -principal -short-paths -g /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes-foreign-base/dl_stubs.c
# cd _build/src/ctypes-foreign-base && ocamlfind  ocamlc -c -package bytes   -ccopt -fPIC -ccopt -Wall -ccopt -g -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/tests -o ffi_call_stubs.o -principal -short-paths -g /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes-foreign-base/ffi_call_stubs.c
### stderr ###
# /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes-foreign-base/ffi_call_stubs.c:22:10: fatal error: 'ffi.h' file not found
# #include <ffi.h>
#          ^
# 1 error generated.
# make: *** [_build/src/ctypes-foreign-base/ffi_call_stubs.o] Error 2


#=== ERROR while installing iocamljs-kernel.0.4.8 =============================#
# opam-version 1.2.2
# os           darwin
# command      make clean min
# path         /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8
# compiler     4.02.1
# exit-code    2
# env-file     /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-96572-c61e7b.env
# stdout-file  /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-96572-c61e7b.out
# stderr-file  /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-96572-c61e7b.err
### stdout ###
# rm -f *.cmis.js
# rm -f *.cm[ioa] iocaml_full.byte iocaml.byte iocaml.js 
# rm -fr *~
# ocamlfind ocamlc -c exec.mli
# ocamlfind ocamlc -c \
# 		-syntax camlp4o -package js_of_ocaml.syntax,optcomp \
# 		-package str,dynlink,js_of_ocaml,js_of_ocaml.compiler,js_of_ocaml.toplevel \
# 		-I /Users/username/.opam/4.02.1/lib/ocaml/compiler-libs \
# 		exec.ml
### stderr ###
# ocamlfind: Package `js_of_ocaml.toplevel' not found
# make: *** [exec.cmo] Error 2



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
The following actions were aborted
  ∗  install iocaml        0.4.8
  ∗  install iocaml-kernel 0.4.8
The following actions failed
  ∗  install ctypes          0.11.2
  ∗  install iocamljs-kernel 0.4.8 
The following changes have been performed
  ∗  install conf-pkg-config 1.0

laowantong avatar Jan 25 '17 11:01 laowantong

@yallop is correct - you need libffi installed in order to find ffi.h and that you might, therefore, require something like homebrew.

To fix the new problem here with iocamljs-kernel, you will need to constrain it manually, for now I think this should work

opam install js_of_ocaml.2.8.3 iocaml

Let me know how it goes, as it is something I should fix in the opam repo.

On Wed, Jan 25, 2017 at 11:52 AM, laowantong [email protected] wrote:

@yallop https://github.com/yallop Not at all.

@andrewray https://github.com/andrewray Thanks, unfortunately that still fails:

MacBook-Air:~ username$ opam install ctypes.0.11.2 iocaml The following actions will be performed: ∗ install conf-pkg-config 1.0 [required by ctypes] ∗ install iocamljs-kernel 0.4.8 [required by iocaml] ∗ install ctypes 0.11.2 ∗ install iocaml-kernel 0.4.8 [required by iocaml] ∗ install iocaml 0.4.8 ===== ∗ 5 ===== Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫 [iocaml] Archive in cache [iocaml-kernel] Archive in cache [iocamljs-kernel] Archive in cache [default] https://opam.ocaml.org/archives/ctypes.0.11.2+opam.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫 ∗ installed conf-pkg-config.1.0 [ERROR] The compilation of iocamljs-kernel failed at "make clean min". [ERROR] The compilation of ctypes failed at "make XEN=disable ctypes-foreign". Processing 3/5: [ctypes: ocamlfind remove] #=== ERROR while installing ctypes.0.11.2 =====================================#

opam-version 1.2.2

os darwin

command make XEN=disable ctypes-foreign

path /Users/username/.opam/4.02.1/build/ctypes.0.11.2

compiler 4.02.1

exit-code 2

env-file /Users/username/.opam/4.02.1/build/ctypes.0.11.2/ctypes-96572-d0f245.env

stdout-file /Users/username/.opam/4.02.1/build/ctypes.0.11.2/ctypes-96572-d0f245.out

stderr-file /Users/username/.opam/4.02.1/build/ctypes.0.11.2/ctypes-96572-d0f245.err

stdout

[...]

ocamlfind ocamlopt -bin-annot -c -o _build/src/ctypes-foreign-base/dl.cmi -package bytes -principal -short-paths -g -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/dl.mli

ocamlfind ocamlc -package bytes -principal -short-paths -g -c -o _build/src/ctypes-foreign-base/dl.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/dl.ml

ocamlfind ocamlopt -bin-annot -c -o _build/src/ctypes-foreign-base/libffi_abi.cmi -package bytes -principal -short-paths -g -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.mli

ocamlfind ocamlc -package bytes -principal -short-paths -g -c -o _build/src/ctypes-foreign-base/libffi_abi.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/libffi_abi.ml

ocamlfind ocamlopt -bin-annot -c -o _build/src/ctypes-foreign-base/ctypes_ffi.cmi -package bytes -principal -short-paths -g -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/ctypes_ffi.mli

ocamlfind ocamlc -package bytes -principal -short-paths -g -c -o _build/src/ctypes-foreign-base/ctypes_ffi.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/ctypes_ffi.ml

ocamlfind ocamlc -package bytes -principal -short-paths -g -c -o _build/src/ctypes-foreign-base/ctypes_foreign_basis.cmo -I _build/src/ctypes-foreign-base -I _build/src/ctypes src/ctypes-foreign-base/ctypes_foreign_basis.ml

ocamlfind ocamlc -a -principal -short-paths -g -cclib -lctypes-foreign-base_stubs -dllib -lctypes-foreign-base_stubs -package bytes -o _build/ctypes-foreign-base.cma _build/src/ctypes-foreign-base/ctypes_closure_properties.cmo _build/src/ctypes-foreign-base/ctypes_ffi_stubs.cmo _build/src/ctypes-foreign-base/ctypes_weak_ref.cmo _build/src/ctypes-foreign-base/dl.cmo _build/src/ctypes-foreign-base/libffi_abi.cmo _build/src/ctypes-foreign-base/ctypes_ffi.cmo _build/src/ctypes-foreign-base/ctypes_foreign_basis.cmo -cclib -lffi

cd _build/src/ctypes-foreign-base && ocamlfind ocamlc -c -package bytes -ccopt -fPIC -ccopt -Wall -ccopt -g -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/tests -o dl_stubs.o -principal -short-paths -g /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes-foreign-base/dl_stubs.c

cd _build/src/ctypes-foreign-base && ocamlfind ocamlc -c -package bytes -ccopt -fPIC -ccopt -Wall -ccopt -g -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes -ccopt -I -ccopt /Users/username/.opam/4.02.1/build/ctypes.0.11.2/tests -o ffi_call_stubs.o -principal -short-paths -g /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes-foreign-base/ffi_call_stubs.c

stderr

/Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes-foreign-base/ffi_call_stubs.c:22:10: fatal error: 'ffi.h' file not found

#include <ffi.h>

^

1 error generated.

make: *** [_build/src/ctypes-foreign-base/ffi_call_stubs.o] Error 2

#=== ERROR while installing iocamljs-kernel.0.4.8 =============================#

opam-version 1.2.2

os darwin

command make clean min

path /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8

compiler 4.02.1

exit-code 2

env-file /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-96572-c61e7b.env

stdout-file /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-96572-c61e7b.out

stderr-file /Users/username/.opam/4.02.1/build/iocamljs-kernel.0.4.8/iocamljs-kernel-96572-c61e7b.err

stdout

rm -f *.cmis.js

rm -f *.cm[ioa] iocaml_full.byte iocaml.byte iocaml.js

rm -fr *~

ocamlfind ocamlc -c exec.mli

ocamlfind ocamlc -c \

-syntax camlp4o -package js_of_ocaml.syntax,optcomp \

-package str,dynlink,js_of_ocaml,js_of_ocaml.compiler,js_of_ocaml.toplevel \

-I /Users/username/.opam/4.02.1/lib/ocaml/compiler-libs \

exec.ml

stderr

ocamlfind: Package `js_of_ocaml.toplevel' not found

make: *** [exec.cmo] Error 2

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫 The following actions were aborted ∗ install iocaml 0.4.8 ∗ install iocaml-kernel 0.4.8 The following actions failed ∗ install ctypes 0.11.2 ∗ install iocamljs-kernel 0.4.8 The following changes have been performed ∗ install conf-pkg-config 1.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andrewray/iocaml/issues/57#issuecomment-275088963, or mute the thread https://github.com/notifications/unsubscribe-auth/AFqzI9Au-wp9DPY9nFVDF6P8OMguzbOoks5rVzdhgaJpZM4LtYly .

andrewray avatar Jan 25 '17 11:01 andrewray

Installing homebrew fails too 😞

MacBook-Air:~ username$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/opt
/usr/local/sbin
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown username /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/mkdir -p /Users/username/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/username/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown username /Users/username/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown username /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
warning: templates not found /Users/sabae/tmp/julia-packaging/osx/julia-master/usr/share/git-core/templates
fatal: Unable to find remote helper for 'https'
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force --depth=1

Don't know why it is looking for a user named sabae. For Julia, I remember having installed it a long time ago. Anyway, this is just a warning, may be unrelated to the fatal error.

Concerning:

opam install js_of_ocaml.2.8.3 iocaml

it fails too, but I guess it's normal since libffi is still missing.

laowantong avatar Jan 25 '17 12:01 laowantong

Actually it seems that I already have libffi in several places (I just kept 3 in the following):

$ locate libffi
/Applications/Dropbox.app/Contents/Frameworks/libffi.6.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libffi.tbd
/usr/lib/libffi.dylib

laowantong avatar Jan 25 '17 12:01 laowantong

Can you see ffi.h? On my (linux) system I need a package called libffi-dev to get the header files.

andrewray avatar Jan 25 '17 13:01 andrewray

Yes, in two places:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ffi/ffi.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/ffi/ffi.h

laowantong avatar Jan 25 '17 13:01 laowantong

@laowantong, you may be able to fix this by setting the LIBFFI_CFLAGS and LIBFFI_LIBS environment variables when installing ctypes. More details here: https://github.com/ocamllabs/ocaml-ctypes/blob/e66d23ea56fad3ef7c6b2c6955bebb06b01cb2d2/Makefile#L200-L209

That said, the recommended approach is to install libffi via MacPorts or Homebrew, if possible. The system-installed libffi is often so old that it lacks features required by ctypes.

yallop avatar Jan 25 '17 14:01 yallop

@yallop Thanks. Since all of this is far above my head, I am not quite sure which replacement is required, tentatively:

export LIBFFI_CFLAGS=-I//Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ffi/include
export LIBFFI_LIBS=\"-L//Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ffi/lib -lffi\"

But the latter is rejected with the following message:

-bash: export: `-lffi': not a valid identifier

Sorry for having taken too much of your time, but I think I am going to give up here. I have tried the recommended approach (with homebrew) last year, with no more success, going deeper and deeper into the rabbit hole with no result at the end of the day.

laowantong avatar Jan 25 '17 15:01 laowantong

The double quotes (in the LIBFFI_LIBS) shouldn't be preceded by \:

export LIBFFI_CFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ffi/include
export LIBFFI_LIBS="-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ffi/lib -lffi"

yallop avatar Jan 25 '17 15:01 yallop

OK, this one was really stupid, sorry. After the correction, installing ctypes fails later:

### stderr ###
# /Users/username/.opam/4.02.1/build/ctypes.0.11.2/src/ctypes-foreign-base/ffi_call_stubs.c:22:10: fatal error: 'ffi.h' file not found
# #include <ffi.h>
#          ^
# 1 error generated.
# make: *** [_build/src/ctypes-foreign-base/ffi_call_stubs.o] Error 2

laowantong avatar Jan 25 '17 15:01 laowantong

That looks like progress. Does the following help things along any further?

export LIBFFI_CFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ffi/
export LIBFFI_LIBS="-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib -lffi"

(The directories in the above should be the respective locations of the header file (ffi.h) and the shared library.)

yallop avatar Jan 25 '17 15:01 yallop

Yes, this goes further.

Not sure what to do next:

opam install js_of_ocaml.2.8.3 iocaml

... gives some new errors I think:

[ERROR] The compilation of iocamljs-kernel failed at "make clean min".
[ERROR] The compilation of iocaml-kernel failed at "make all".
...
### stderr ###
# iocaml_zmq_stubs.c:1:10: fatal error: 'zmq.h' file not found
# #include <zmq.h>
#          ^
# 1 error generated.
# make: *** [stub] Error 2

Same thing with the original command:

opam install iocaml

And this time, zmq.h is nowhere to be found.

laowantong avatar Jan 25 '17 15:01 laowantong

The iocamljs-kernel failure I will have a look into and try to find some set of working package versions.

For iocaml, just like libffi, you will need a development version of zmq3 or 4 installed.

andrewray avatar Jan 25 '17 16:01 andrewray