OCamlPro / liquidity

A high-level language for Dune Network (and Tezos) with OCaml and ReasonML syntaxes, with a decompiler from Michelson
https://www.liquidity-lang.org
GNU General Public License v3.0
158 stars 33 forks source link

Can't install liquidity on Ubuntu 16.04 #144

Closed krtk6160 closed 11 months ago

krtk6160 commented 6 years ago

When following the instructions given on the official website of liquidity, I'm having problems with the package 'sodium'.

When I run make build-deps in the liquidity directory after running make clone-tezos, I get the following errors:

`<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> [ERROR] The compilation of sodium failed at "/home/krtk6160/.opam/opam-init/hooks/sandbox.sh build make".

=== ERROR while compiling sodium.0.6.0 =======================================# context 2.0.0 | linux/x86_64 | ocaml-base-compiler.4.06.1 | https://opam.ocaml.org#477a1ec7 path ~/.opam/liquidity/.opam-switch/build/sodium.0.6.0 command ~/.opam/opam-init/hooks/sandbox.sh build make exit-code 2 env-file ~/.opam/log/sodium-16282-05296d.env output-file ~/.opam/log/sodium-16282-05296d.out output ### [...] ocamlfind ocamldep -package ctypes.stubs -modules lib_gen/sodium_typegen.ml > lib_gen/sodium_typegen.ml.depends ocamlfind ocamlc -c -bin-annot -safe-string -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib_gen -I lib -o lib_gen/sodium_types.cmo lib_gen/sodium_types.ml ocamlfind ocamlc -c -bin-annot -safe-string -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib_gen -I lib -o lib_gen/sodium_typegen.cmo lib_gen/sodium_typegen.ml ocamlfind ocamlc -linkpkg -package ctypes.stubs -I lib_gen lib_gen/sodium_types.cmo lib_gen/sodium_typegen.cmo -o lib_gen/sodium_typegen.byte lib_gen/sodium_typegen.byte cc -I /home/krtk6160/.opam/liquidity/lib/ctypes -I /home/krtk6160/.opam/liquidity/lib/ocaml -o lib_gen/sodium_types_detect lib_gen/sodium_types_detect.c

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> +- The following actions failed | - build sodium 0.6.0 +-

`

I have tried installing libsodium-dev using apt, and then running make build-deps, which then results in different error messages:

`<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> [ERROR] The compilation of sodium failed at "/home/krtk6160/.opam/opam-init/hooks/sandbox.sh build make".

=== ERROR while compiling sodium.0.6.0 =======================================# context 2.0.0 | linux/x86_64 | ocaml-base-compiler.4.06.1 | https://opam.ocaml.org#477a1ec7 path ~/.opam/liquidity/.opam-switch/build/sodium.0.6.0 command ~/.opam/opam-init/hooks/sandbox.sh build make exit-code 2 env-file ~/.opam/log/sodium-16662-05296d.env output-file ~/.opam/log/sodium-16662-05296d.out output ### [...] lib/sodium_stubs.c: In function ‘caml74_crypto_pwhash_argon2i_str’: lib/sodium_stubs.c:646:15: error: implicit declaration of function ‘crypto_pwhash_argon2i_str’ [-Werror=implicit-function-declaration] int x490 = crypto_pwhash_argon2i_str(x479, x480, x481, x484, x487); ^ lib/sodium_stubs.c: In function ‘caml75_crypto_pwhash_argon2i_str_verify’: lib/sodium_stubs.c:655:15: error: implicit declaration of function ‘crypto_pwhash_argon2i_str_verify’ [-Werror=implicit-function-declaration] int x499 = crypto_pwhash_argon2i_str_verify(x494, x495, x496); ^ cc1: all warnings being treated as errors Command exited with code 2. Makefile:13: recipe for target 'all' failed make: *** [all] Error 10

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> +- The following actions failed | - build sodium 0.6.0 +-

mebsout commented 6 years ago

The version of the opam package sodium is only compatible with libsodium-dev >= 1.0.9 and you likely have version 1.0.8 on ubuntu 16.04. What you can do instead is install sodium.0.5.0 with

opam install sodium.0.5.0

and do make build-deps again.

krtk6160 commented 6 years ago

@mebsout Thank you for your reply. I do have libsodium-dev < 1.0.9, so I tried installing sodium 0.5.0, but could not, and got the following errors:

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> -> removed ctypes.0.14.0 -> installed ctypes.0.5.1 [ERROR] The compilation of sodium failed at "/home/krtk6160/.opam/opam-init/hooks/sandbox.sh build make".

=== ERROR while compiling sodium.0.5.0 =======================================# context 2.0.0 | linux/x86_64 | ocaml-base-compiler.4.06.1 | https://opam.ocaml.org#477a1ec7 path ~/.opam/liquidity/.opam-switch/build/sodium.0.5.0 command ~/.opam/opam-init/hooks/sandbox.sh build make exit-code 2 env-file ~/.opam/log/sodium-2991-8b8a2d.env output-file ~/.opam/log/sodium-2991-8b8a2d.out output ### [...] lib/sodium_stubs.c: In function ‘caml1_sodium_init’: lib/sodium_stubs.c:6:4: error: ignoring return value of ‘sodium_init’, declared with attribute warn_unused_result [-Werror=unused-result] sodium_init(); ^ lib/sodium_stubs.c: In function ‘caml3_sodium_memcmp’: lib/sodium_stubs.c:21:4: error: ignoring return value of ‘sodium_memcmp’, declared with attribute warn_unused_result [-Werror=unused-result] sodium_memcmp(x13, x14, x15); ^ cc1: all warnings being treated as errors Command exited with code 2. Makefile:13: recipe for target 'all' failed make: *** [all] Error 10

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> +- The following actions failed | - build sodium 0.5.0 +- +- The following changes have been performed | - downgrade ctypes 0.14.0 to 0.5.1 +-

Any ideas what's wrong here?

ddeclerck commented 5 years ago

Hi, It appears that the opam package sodium.0.5.0 is only compatible with libsodium-dev <= 1.0.5, while sodium.0.6.0 requires libsodium-dev >= 1.0.9. If you have libsodium-dev > 1.0.5 and < 1.0.9, you should either upgrade or downgrade your library (and use the appropriate sodium opam package), or resort to the following quick'n'dirty hack : comment out the __attribute__ ((warn_unused_result)) in /usr/include/sodium/core.h (line 13) and /usr/include/sodium/utils.h (line 32).