andrewray / iocaml

An OCaml kernel for the IPython notebook
MIT License
193 stars 20 forks source link

build / install fails on FreeBSD #68

Open tpltnt opened 7 years ago

tpltnt commented 7 years ago

Hi there,

I tried installing iocaml via opam (i.e. opam install iocaml), but it failed

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[iocaml] Archive in cache
[iocaml-kernel] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of iocaml-kernel failed at "gmake all".
Processing  1/2: [iocaml-kernel: gmake uninstall]
#=== ERROR while installing iocaml-kernel.0.4.8 ===============================#
# opam-version 1.2.2
# os           freebsd
# command      gmake all
# path         /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8
# compiler     system (4.02.3)
# exit-code    2
# env-file     /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-54283-e7966f.env
# stdout-file  /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-54283-e7966f.out
# stderr-file  /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-54283-e7966f.err
### stdout ###
# atdgen -t Ipython_json.atd
# atdgen -j Ipython_json.atd
# ocamlfind c iocaml_zmq_stubs.c
### stderr ###
# iocaml_zmq_stubs.c:1:10: fatal error: 'zmq.h' file not found
# #include <zmq.h>
#          ^
# 1 error generated.
# gmake: *** [Makefile:10: stub] Fehler 2

Libzmq is installed and zmq.h can be found in the directory /usr/local/include/. This directory does not seem to get searched when running ocamlfind c iocaml_zmq_stubs.c. I haven't found any (quick) fix, otherwise I would have provided a patch/pull request. Thank you for providing an OCaml kernel for Jupyter and I hope this issues gets fixed.

Cheers, tpltnt

dbuenzli commented 7 years ago

Can you maybe try with the environment variables mentioned there. Something like:

C_INCLUDE_PATH="/usr/local/include:$C_INCLUDE_PATH" opam install iocaml
tpltnt commented 7 years ago

I tried it and it did not work. See below

foo@testbox ~]% C_INCLUDE_PATH="/usr/local/include:$C_INCLUDE_PATH" opam install iocaml
The following actions will be performed:
  ∗  install iocaml-kernel 0.4.8              [required by iocaml]
  ∗  install iocaml        0.4.9
===== ∗  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 "gmake all".
Processing  1/2: [iocaml-kernel: gmake uninstall]
#=== ERROR while installing iocaml-kernel.0.4.8 ===============================#
# opam-version 1.2.2
# os           freebsd
# command      gmake all
# path         /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8
# compiler     system (4.02.3)
# exit-code    2
# env-file     /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-2445-e7966f.env
# stdout-file  /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-2445-e7966f.out
# stderr-file  /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-2445-e7966f.err
### stdout ###
# [...]
# # rest of the library
# ocamlfind c -c -g \
#     -package yojson,atdgen,compiler-libs \
#     Ipython_json_t.mli Ipython_json_j.mli base64.mli \
#     Ipython_json_t.ml  Ipython_json_j.ml  base64.ml  
# ocamlfind ocamlmklib -o iocaml_lib \
#     -l zmq \
#     -package ctypes.foreign,lwt.unix,yojson \
#     iocaml_zmq_stubs.o \
#     log.cmo Ipython_json_t.cmo Ipython_json_j.cmo iocaml_zmq.cmo base64.cmo 
### stderr ###
# [...]
# Use Bytes.set instead.
# File "base64.ml", line 69, characters 4-35:
# Warning 3: deprecated: String.set
# Use Bytes.set instead.
# File "base64.ml", line 72, characters 4-44:
# Warning 3: deprecated: String.set
# Use Bytes.set instead.
# /usr/bin/ld: cannot find -lzmq
# cc: error: linker command failed with exit code 1 (use -v to see invocation)
# gmake: *** [Makefile:19: lib] Fehler 2

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
  ∗  install iocaml 0.4.9
The following actions failed
  ∗  install iocaml-kernel 0.4.8
No changes have been performed
andrewray commented 7 years ago

Looks like you may need to set LIBRARY_PATH as well.

On Tue, Sep 26, 2017 at 9:55 AM, tpltnt notifications@github.com wrote:

I tried it and it did not work. See below

foo@testbox ~]% C_INCLUDE_PATH="/usr/local/include:$C_INCLUDE_PATH" opam install iocaml The following actions will be performed: ∗ install iocaml-kernel 0.4.8 [required by iocaml] ∗ install iocaml 0.4.9 ===== ∗ 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 "gmake all". Processing 1/2: [iocaml-kernel: gmake uninstall]

=== ERROR while installing iocaml-kernel.0.4.8 ===============================

opam-version 1.2.2

os freebsd

command gmake all

path /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8

compiler system (4.02.3)

exit-code 2

env-file /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-2445-e7966f.env

stdout-file /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-2445-e7966f.out

stderr-file /usr/home/foo/.opam/system/build/iocaml-kernel.0.4.8/iocaml-kernel-2445-e7966f.err

stdout

[...]

rest of the library

ocamlfind c -c -g \

-package yojson,atdgen,compiler-libs \

Ipython_json_t.mli Ipython_json_j.mli base64.mli \

Ipython_json_t.ml Ipython_json_j.ml base64.ml

ocamlfind ocamlmklib -o iocaml_lib \

-l zmq \

-package ctypes.foreign,lwt.unix,yojson \

iocaml_zmq_stubs.o \

log.cmo Ipython_json_t.cmo Ipython_json_j.cmo iocaml_zmq.cmo base64.cmo

stderr

[...]

Use Bytes.set instead.

File "base64.ml", line 69, characters 4-35:

Warning 3: deprecated: String.set

Use Bytes.set instead.

File "base64.ml", line 72, characters 4-44:

Warning 3: deprecated: String.set

Use Bytes.set instead.

/usr/bin/ld: cannot find -lzmq

cc: error: linker command failed with exit code 1 (use -v to see invocation)

gmake: *** [Makefile:19: lib] Fehler 2

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

— 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/68#issuecomment-332132635, or mute the thread https://github.com/notifications/unsubscribe-auth/AFqzI77ug3RbsHP7TKx6nwPaBsqJKMU7ks5smLwdgaJpZM4PEhiS .