Compilation error
ArnaudParant opened this issue · 4 comments
Hello,
I've tried to install ocaml-zmq from source.
oasis setup
works fine, but make all
does not works at all.
$ make all
ocaml setup.ml -all
Configuration:
ocamlfind: ........................................... /home/nox/.opam/4.02.1/bin/ocamlfind
ocamlc: .............................................. /home/nox/.opam/4.02.1/bin/ocamlc.opt
ocamlopt: ............................................ /home/nox/.opam/4.02.1/bin/ocamlopt.opt
ocamlbuild: .......................................... /home/nox/.opam/4.02.1/bin/ocamlbuild
Package name: ........................................ ZMQ
Package version: ..................................... 4.0
os_type: ............................................. Unix
system: .............................................. linux
architecture: ........................................ amd64
ccomp_type: .......................................... cc
ocaml_version: ....................................... 4.02.1
standard_library_default: ............................ /home/nox/.opam/4.02.1/lib/ocaml
standard_library: .................................... /home/nox/.opam/4.02.1/lib/ocaml
standard_runtime: .................................... /home/nox/.opam/4.02.1/bin/ocamlrun
bytecomp_c_compiler: ................................. gcc -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC
native_c_compiler: ................................... gcc -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
model: ............................................... default
ext_obj: ............................................. .o
ext_asm: ............................................. .s
ext_lib: ............................................. .a
ext_dll: ............................................. .so
default_executable_name: ............................. a.out
systhread_supported: ................................. true
Install architecture-independent files dir: .......... /usr/local
Install architecture-dependent files in dir: ......... $prefix
User executables: .................................... $exec_prefix/bin
System admin executables: ............................ $exec_prefix/sbin
Program executables: ................................. $exec_prefix/libexec
Read-only single-machine data: ....................... $prefix/etc
Modifiable architecture-independent data: ............ $prefix/com
Modifiable single-machine data: ...................... $prefix/var
Object code libraries: ............................... $exec_prefix/lib
Read-only arch-independent data root: ................ $prefix/share
Read-only architecture-independent data: ............. $datarootdir
Info documentation: .................................. $datarootdir/info
Locale-dependent data: ............................... $datarootdir/locale
Man documentation: ................................... $datarootdir/man
Documentation root: .................................. $datarootdir/doc/$pkg_name
HTML documentation: .................................. $docdir
DVI documentation: ................................... $docdir
PDF documentation: ................................... $docdir
PS documentation: .................................... $docdir
findlib_version: ..................................... 1.6.1
is_native: ........................................... true
suffix_program: ......................................
Remove a file.: ...................................... rm -f
Remove a directory.: ................................. rm -rf
Turn ocaml debug flag on: ............................ true
Turn ocaml profile flag on: .......................... false
Compiler support generation of .cmxs.: ............... true
OCamlbuild additional flags: .........................
Build examples: ...................................... true
Create documentations: ............................... true
Compile tests executable and library and run them: ... false
pkg_unix: ............................................ /home/nox/.opam/4.02.1/lib/ocaml
pkg_uint_uint64: ..................................... /home/nox/.opam/4.02.1/lib/uint
pkg_str: ............................................. /home/nox/.opam/4.02.1/lib/ocaml
Finished, 1 target (0 cached) in 00:00:00.
+ /home/nox/.opam/4.02.1/bin/ocamlfind ocamlc -ccopt -I/usr/local/include -ccopt -I -ccopt /home/nox/.opam/4.02.1/lib/uint -ccopt -Wall -ccopt -Wextra -ccopt -O2 -c src/caml_zmq_stubs.c
src/caml_zmq_stubs.c: In function 'caml_zmq_new':
src/caml_zmq_stubs.c:66:5: warning: implicit declaration of function 'zmq_ctx_new' [-Wimplicit-function-declaration]
void *ctx = zmq_ctx_new();
^
src/caml_zmq_stubs.c:66:17: warning: initialization makes pointer from integer without a cast
void *ctx = zmq_ctx_new();
^
src/caml_zmq_stubs.c: In function 'caml_zmq_term':
src/caml_zmq_stubs.c:80:5: warning: implicit declaration of function 'zmq_ctx_term' [-Wimplicit-function-declaration]
int result = zmq_ctx_term(CAML_ZMQ_Context_val(ctx));
^
src/caml_zmq_stubs.c: At top level:
src/caml_zmq_stubs.c:92:5: error: 'ZMQ_IO_THREADS' undeclared here (not in a function)
ZMQ_IO_THREADS,
^
src/caml_zmq_stubs.c:93:5: error: 'ZMQ_MAX_SOCKETS' undeclared here (not in a function)
ZMQ_MAX_SOCKETS,
^
src/caml_zmq_stubs.c:94:5: error: 'ZMQ_IPV6' undeclared here (not in a function)
ZMQ_IPV6
^
src/caml_zmq_stubs.c: In function 'caml_zmq_ctx_set_int_option':
src/caml_zmq_stubs.c:100:5: warning: implicit declaration of function 'zmq_ctx_set' [-Wimplicit-function-declaration]
int result = zmq_ctx_set(CAML_ZMQ_Context_val(socket),
^
src/caml_zmq_stubs.c: In function 'caml_zmq_ctx_get_int_option':
src/caml_zmq_stubs.c:114:5: warning: implicit declaration of function 'zmq_ctx_get' [-Wimplicit-function-declaration]
int result = zmq_ctx_get(CAML_ZMQ_Context_val(socket),
^
src/caml_zmq_stubs.c: At top level:
src/caml_zmq_stubs.c:184:5: error: 'ZMQ_MAXMSGSIZE' undeclared here (not in a function)
ZMQ_MAXMSGSIZE
^
src/caml_zmq_stubs.c:185:1: error: initializer element is not constant
};
^
src/caml_zmq_stubs.c:185:1: error: (near initialization for 'native_int64_option_for[0]')
src/caml_zmq_stubs.c:204:5: error: 'ZMQ_LAST_ENDPOINT' undeclared here (not in a function)
ZMQ_LAST_ENDPOINT,
^
src/caml_zmq_stubs.c:204:5: error: initializer element is not constant
src/caml_zmq_stubs.c:204:5: error: (near initialization for 'native_bytes_option_for[3]')
src/caml_zmq_stubs.c:205:5: error: 'ZMQ_TCP_ACCEPT_FILTER' undeclared here (not in a function)
ZMQ_TCP_ACCEPT_FILTER,
^
src/caml_zmq_stubs.c:205:5: error: initializer element is not constant
src/caml_zmq_stubs.c:205:5: error: (near initialization for 'native_bytes_option_for[4]')
src/caml_zmq_stubs.c:206:5: error: 'ZMQ_PLAIN_USERNAME' undeclared here (not in a function)
ZMQ_PLAIN_USERNAME,
^
src/caml_zmq_stubs.c:206:5: error: initializer element is not constant
src/caml_zmq_stubs.c:206:5: error: (near initialization for 'native_bytes_option_for[5]')
src/caml_zmq_stubs.c:207:5: error: 'ZMQ_PLAIN_PASSWORD' undeclared here (not in a function)
ZMQ_PLAIN_PASSWORD,
^
src/caml_zmq_stubs.c:207:5: error: initializer element is not constant
src/caml_zmq_stubs.c:207:5: error: (near initialization for 'native_bytes_option_for[6]')
src/caml_zmq_stubs.c:208:5: error: 'ZMQ_CURVE_PUBLICKEY' undeclared here (not in a function)
ZMQ_CURVE_PUBLICKEY,
^
src/caml_zmq_stubs.c:208:5: error: initializer element is not constant
src/caml_zmq_stubs.c:208:5: error: (near initialization for 'native_bytes_option_for[7]')
src/caml_zmq_stubs.c:209:5: error: 'ZMQ_CURVE_SECRETKEY' undeclared here (not in a function)
ZMQ_CURVE_SECRETKEY,
^
src/caml_zmq_stubs.c:209:5: error: initializer element is not constant
src/caml_zmq_stubs.c:209:5: error: (near initialization for 'native_bytes_option_for[8]')
src/caml_zmq_stubs.c:210:5: error: 'ZMQ_CURVE_SERVERKEY' undeclared here (not in a function)
ZMQ_CURVE_SERVERKEY,
^
src/caml_zmq_stubs.c:210:5: error: initializer element is not constant
src/caml_zmq_stubs.c:210:5: error: (near initialization for 'native_bytes_option_for[9]')
src/caml_zmq_stubs.c:211:5: error: 'ZMQ_ZAP_DOMAIN' undeclared here (not in a function)
ZMQ_ZAP_DOMAIN,
^
src/caml_zmq_stubs.c:211:5: error: initializer element is not constant
src/caml_zmq_stubs.c:211:5: error: (near initialization for 'native_bytes_option_for[10]')
src/caml_zmq_stubs.c:240:5: error: 'ZMQ_SNDHWM' undeclared here (not in a function)
ZMQ_SNDHWM,
^
src/caml_zmq_stubs.c:240:5: error: initializer element is not constant
src/caml_zmq_stubs.c:240:5: error: (near initialization for 'native_int_option_for[11]')
src/caml_zmq_stubs.c:241:5: error: 'ZMQ_RCVHWM' undeclared here (not in a function)
ZMQ_RCVHWM,
^
src/caml_zmq_stubs.c:241:5: error: initializer element is not constant
src/caml_zmq_stubs.c:241:5: error: (near initialization for 'native_int_option_for[12]')
src/caml_zmq_stubs.c:242:5: error: 'ZMQ_MULTICAST_HOPS' undeclared here (not in a function)
ZMQ_MULTICAST_HOPS,
^
src/caml_zmq_stubs.c:242:5: error: initializer element is not constant
src/caml_zmq_stubs.c:242:5: error: (near initialization for 'native_int_option_for[13]')
src/caml_zmq_stubs.c:245:5: error: initializer element is not constant
ZMQ_IPV6,
^
src/caml_zmq_stubs.c:245:5: error: (near initialization for 'native_int_option_for[16]')
src/caml_zmq_stubs.c:246:5: error: 'ZMQ_ROUTER_MANDATORY' undeclared here (not in a function)
ZMQ_ROUTER_MANDATORY,
^
src/caml_zmq_stubs.c:246:5: error: initializer element is not constant
src/caml_zmq_stubs.c:246:5: error: (near initialization for 'native_int_option_for[17]')
src/caml_zmq_stubs.c:247:5: error: 'ZMQ_TCP_KEEPALIVE' undeclared here (not in a function)
ZMQ_TCP_KEEPALIVE,
^
src/caml_zmq_stubs.c:247:5: error: initializer element is not constant
src/caml_zmq_stubs.c:247:5: error: (near initialization for 'native_int_option_for[18]')
src/caml_zmq_stubs.c:248:5: error: 'ZMQ_TCP_KEEPALIVE_CNT' undeclared here (not in a function)
ZMQ_TCP_KEEPALIVE_CNT,
^
src/caml_zmq_stubs.c:248:5: error: initializer element is not constant
src/caml_zmq_stubs.c:248:5: error: (near initialization for 'native_int_option_for[19]')
src/caml_zmq_stubs.c:249:5: error: 'ZMQ_TCP_KEEPALIVE_IDLE' undeclared here (not in a function)
ZMQ_TCP_KEEPALIVE_IDLE,
^
src/caml_zmq_stubs.c:249:5: error: initializer element is not constant
src/caml_zmq_stubs.c:249:5: error: (near initialization for 'native_int_option_for[20]')
src/caml_zmq_stubs.c:250:5: error: 'ZMQ_TCP_KEEPALIVE_INTVL' undeclared here (not in a function)
ZMQ_TCP_KEEPALIVE_INTVL,
^
src/caml_zmq_stubs.c:250:5: error: initializer element is not constant
src/caml_zmq_stubs.c:250:5: error: (near initialization for 'native_int_option_for[21]')
src/caml_zmq_stubs.c:251:5: error: 'ZMQ_IMMEDIATE' undeclared here (not in a function)
ZMQ_IMMEDIATE,
^
src/caml_zmq_stubs.c:251:5: error: initializer element is not constant
src/caml_zmq_stubs.c:251:5: error: (near initialization for 'native_int_option_for[22]')
src/caml_zmq_stubs.c:252:5: error: 'ZMQ_XPUB_VERBOSE' undeclared here (not in a function)
ZMQ_XPUB_VERBOSE,
^
src/caml_zmq_stubs.c:252:5: error: initializer element is not constant
src/caml_zmq_stubs.c:252:5: error: (near initialization for 'native_int_option_for[23]')
src/caml_zmq_stubs.c:253:5: error: 'ZMQ_MECHANISM' undeclared here (not in a function)
ZMQ_MECHANISM,
^
src/caml_zmq_stubs.c:253:5: error: initializer element is not constant
src/caml_zmq_stubs.c:253:5: error: (near initialization for 'native_int_option_for[24]')
src/caml_zmq_stubs.c:254:5: error: 'ZMQ_PLAIN_SERVER' undeclared here (not in a function)
ZMQ_PLAIN_SERVER,
^
src/caml_zmq_stubs.c:254:5: error: initializer element is not constant
src/caml_zmq_stubs.c:254:5: error: (near initialization for 'native_int_option_for[25]')
src/caml_zmq_stubs.c:255:5: error: 'ZMQ_CURVE_SERVER' undeclared here (not in a function)
ZMQ_CURVE_SERVER,
^
src/caml_zmq_stubs.c:255:5: error: initializer element is not constant
src/caml_zmq_stubs.c:255:5: error: (near initialization for 'native_int_option_for[26]')
src/caml_zmq_stubs.c:256:5: error: 'ZMQ_PROBE_ROUTER' undeclared here (not in a function)
ZMQ_PROBE_ROUTER,
^
src/caml_zmq_stubs.c:256:5: error: initializer element is not constant
src/caml_zmq_stubs.c:256:5: error: (near initialization for 'native_int_option_for[27]')
src/caml_zmq_stubs.c:257:5: error: 'ZMQ_REQ_CORRELATE' undeclared here (not in a function)
ZMQ_REQ_CORRELATE,
^
src/caml_zmq_stubs.c:257:5: error: initializer element is not constant
src/caml_zmq_stubs.c:257:5: error: (near initialization for 'native_int_option_for[28]')
src/caml_zmq_stubs.c:258:5: error: 'ZMQ_REQ_RELAXED' undeclared here (not in a function)
ZMQ_REQ_RELAXED,
^
src/caml_zmq_stubs.c:258:5: error: initializer element is not constant
src/caml_zmq_stubs.c:258:5: error: (near initialization for 'native_int_option_for[29]')
src/caml_zmq_stubs.c:259:5: error: 'ZMQ_CONFLATE' undeclared here (not in a function)
ZMQ_CONFLATE,
^
src/caml_zmq_stubs.c:259:5: error: initializer element is not constant
src/caml_zmq_stubs.c:259:5: error: (near initialization for 'native_int_option_for[30]')
src/caml_zmq_stubs.c: In function 'caml_zmq_disconnect':
src/caml_zmq_stubs.c:380:5: warning: implicit declaration of function 'zmq_disconnect' [-Wimplicit-function-declaration]
int result = zmq_disconnect(CAML_ZMQ_Socket_val(socket), String_val(string_address));
^
src/caml_zmq_stubs.c: In function 'caml_zmq_unbind':
src/caml_zmq_stubs.c:400:5: warning: implicit declaration of function 'zmq_unbind' [-Wimplicit-function-declaration]
int result = zmq_unbind(CAML_ZMQ_Socket_val(socket), String_val(string_address));
^
src/caml_zmq_stubs.c: In function 'caml_zmq_send':
src/caml_zmq_stubs.c:426:5: warning: implicit declaration of function 'zmq_msg_send' [-Wimplicit-function-declaration]
result = zmq_msg_send(&msg, sock, option);
^
src/caml_zmq_stubs.c: In function 'caml_zmq_recv':
src/caml_zmq_stubs.c:458:5: warning: implicit declaration of function 'zmq_msg_recv' [-Wimplicit-function-declaration]
result = zmq_msg_recv(&msg, sock, option);
^
src/caml_zmq_stubs.c: In function 'caml_zmq_proxy2':
src/caml_zmq_stubs.c:487:5: warning: implicit declaration of function 'zmq_proxy' [-Wimplicit-function-declaration]
int result = zmq_proxy(native_frontend, native_backend, NULL);
^
src/caml_zmq_stubs.c: In function 'caml_zmq_socket_monitor':
src/caml_zmq_stubs.c:513:5: warning: implicit declaration of function 'zmq_socket_monitor' [-Wimplicit-function-declaration]
int result = zmq_socket_monitor(CAML_ZMQ_Socket_val(socket), String_val(address), ZMQ_EVENT_ALL);
^
src/caml_zmq_stubs.c:513:87: error: 'ZMQ_EVENT_ALL' undeclared (first use in this function)
int result = zmq_socket_monitor(CAML_ZMQ_Socket_val(socket), String_val(address), ZMQ_EVENT_ALL);
^
src/caml_zmq_stubs.c:513:87: note: each undeclared identifier is reported only once for each function it appears in
src/caml_zmq_stubs.c: In function 'caml_decode_monitor_event':
src/caml_zmq_stubs.c:543:10: error: 'ZMQ_EVENT_CONNECTED' undeclared (first use in this function)
case ZMQ_EVENT_CONNECTED:
^
src/caml_zmq_stubs.c:549:10: error: 'ZMQ_EVENT_CONNECT_DELAYED' undeclared (first use in this function)
case ZMQ_EVENT_CONNECT_DELAYED:
^
src/caml_zmq_stubs.c:554:10: error: 'ZMQ_EVENT_CONNECT_RETRIED' undeclared (first use in this function)
case ZMQ_EVENT_CONNECT_RETRIED:
^
src/caml_zmq_stubs.c:560:10: error: 'ZMQ_EVENT_LISTENING' undeclared (first use in this function)
case ZMQ_EVENT_LISTENING:
^
src/caml_zmq_stubs.c:566:10: error: 'ZMQ_EVENT_BIND_FAILED' undeclared (first use in this function)
case ZMQ_EVENT_BIND_FAILED:
^
src/caml_zmq_stubs.c:573:10: error: 'ZMQ_EVENT_ACCEPTED' undeclared (first use in this function)
case ZMQ_EVENT_ACCEPTED:
^
src/caml_zmq_stubs.c:579:10: error: 'ZMQ_EVENT_ACCEPT_FAILED' undeclared (first use in this function)
case ZMQ_EVENT_ACCEPT_FAILED:
^
src/caml_zmq_stubs.c:586:10: error: 'ZMQ_EVENT_CLOSED' undeclared (first use in this function)
case ZMQ_EVENT_CLOSED:
^
src/caml_zmq_stubs.c:592:10: error: 'ZMQ_EVENT_CLOSE_FAILED' undeclared (first use in this function)
case ZMQ_EVENT_CLOSE_FAILED:
^
src/caml_zmq_stubs.c:598:10: error: 'ZMQ_EVENT_DISCONNECTED' undeclared (first use in this function)
case ZMQ_EVENT_DISCONNECTED:
^
src/caml_zmq_stubs.c: In function 'caml_z85_encode':
src/caml_zmq_stubs.c:630:5: warning: implicit declaration of function 'zmq_z85_encode' [-Wimplicit-function-declaration]
if (zmq_z85_encode(String_val(result), (uint8_t*) String_val(source), length) == NULL)
^
src/caml_zmq_stubs.c:630:83: warning: comparison between pointer and integer
if (zmq_z85_encode(String_val(result), (uint8_t*) String_val(source), length) == NULL)
^
src/caml_zmq_stubs.c: In function 'caml_z85_decode':
src/caml_zmq_stubs.c:641:5: warning: implicit declaration of function 'zmq_z85_decode' [-Wimplicit-function-declaration]
if (zmq_z85_decode((uint8_t*) String_val(result), String_val(source)) == NULL)
^
src/caml_zmq_stubs.c:641:75: warning: comparison between pointer and integer
if (zmq_z85_decode((uint8_t*) String_val(result), String_val(source)) == NULL)
^
src/caml_zmq_stubs.c: In function 'caml_curve_keypair':
src/caml_zmq_stubs.c:658:5: warning: implicit declaration of function 'zmq_curve_keypair' [-Wimplicit-function-declaration]
int result = zmq_curve_keypair(String_val(public), String_val(secret));
^
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
E: Failure("Command ''/home/nox/.opam/4.02.1/bin/ocamlbuild' src/libZMQ_stubs.a src/dllZMQ_stubs.so src/ZMQ.cma src/ZMQ.cmxa src/ZMQ.a src/ZMQ.cmxs examples/hwserver.native examples/hwclient.native examples/wuserver.native examples/wuclient.native examples/wuproxy.native examples/taskvent.native examples/taskwork.native examples/tasksink.native -tag debug' terminated with error code 10")
Makefile:16: recipe for target 'all' failed
make: *** [all] Error 1
It does not works either with opam install
$ opam install zmq
The following actions will be performed:
- install conf-zmq 0.1 [required by zmq]
- install zmq 4.0-5
===== 2 to install =====
Do you want to continue ? [Y/n] y
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[zmq] Archive in cache
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-> installed conf-zmq.0.1
[ERROR] The compilation of zmq failed at "ocaml setup.ml -build".
Processing 2/2: [zmq: ocamlfind remove]
#=== ERROR while installing zmq.4.0-5 =========================================#
# opam-version 1.2.2
# os linux
# command ocaml setup.ml -build
# path /home/nox/.opam/4.02.1/build/zmq.4.0-5
# compiler 4.02.1
# exit-code 1
# env-file /home/nox/.opam/4.02.1/build/zmq.4.0-5/zmq-1330-d2c37b.env
# stdout-file /home/nox/.opam/4.02.1/build/zmq.4.0-5/zmq-1330-d2c37b.out
# stderr-file /home/nox/.opam/4.02.1/build/zmq.4.0-5/zmq-1330-d2c37b.err
### stdout ###
# src/caml_zmq_stubs.c:641:5: warning: implicit declaration of function 'zmq_z85_decode' [-Wimplicit-function-declaration]
# [...]
# ^
# src/caml_zmq_stubs.c:641:75: warning: comparison between pointer and integer
# if (zmq_z85_decode((uint8_t*) String_val(result), String_val(source)) == NULL)
# ^
# src/caml_zmq_stubs.c: In function 'caml_curve_keypair':
# src/caml_zmq_stubs.c:658:5: warning: implicit declaration of function 'zmq_curve_keypair' [-Wimplicit-function-declaration]
# int result = zmq_curve_keypair(String_val(public), String_val(secret));
# ^
# Command exited with code 2.
### stderr ###
# E: Failure("Command ''/home/nox/.opam/4.02.1/bin/ocamlbuild' src/libZMQ_stubs.a src/dllZMQ_stubs.so src/ZMQ.cma src/ZMQ.cmxa src/ZMQ.a src/ZMQ.cmxs examples/hwserver.native examples/hwclient.native examples/wuserver.native examples/wuclient.native examples/wuproxy.native examples/taskvent.native examples/taskwork.native examples/tasksink.native -tag debug' terminated with error code 10")
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
- install zmq 4.0-5
The following changes have been performed
- install conf-zmq 0.1
The former state can be restored with:
opam switch import "~/.opam/4.02.1/backup/state-20160408101920.export"
Do you have any idea of what is wrong ?
Did I miss something ?
Regards,
Arnaud
Which Linux distro and version do you use? Which version of the zmq library package do you have installed? If it's Debian/Ubuntu, you should have the matching libzmq-dev package installed.
Hello,
I'm using: Debian GNU/Linux 8.4 (jessie)
libzmq is installed: libzmq1:amd64/jessie 2.2.0+dfsg-6
and libzmq-dev is installed as well: libzmq-dev:amd64/jessie 2.2.0+dfsg-6
It's because you have an ancient version of libzmq and libzmq-dev. The OCaml bindings require at least version 4.0. Try to remove your version 2.x packages and install libzmq3 and libzmq3-dev instead (ZMQ 4 is unfortunately named libzmq3 in Debian). They're available on jessie.
Perfect, Thank you !
I was able to install it without any error.
Regards,
Arnaud