LaurentMazare / ocaml-torch

OCaml bindings for PyTorch
Apache License 2.0
412 stars 38 forks source link

undefined symbol: ffi_type_void, version LIBFFI_BASE_7.0 #86

Closed overshiki closed 11 months ago

overshiki commented 11 months ago

Hi, When trying the example in README:

open Torch

let () =
  let tensor = Tensor.randn [ 4; 2 ] in
  Tensor.print tensor

I encountered the follow error:

_build/install/default/bin/torch_example: symbol lookup error: _build/install/default/bin/torch_example: undefined symbol: ffi_type_void, version LIBFFI_BASE_7.0

The package is installed with:

opam install torch

And the versions of all the dependency are:

The following actions will be performed:
  ∗ install ppx_derivers                1.2.1
          [required by ppxlib]
  ∗ install typerep                     v0.16.0             [required by core]
  ∗ install bigarray-compat             1.1.0
          [required by ctypes]
  ∗ install variantslib                 v0.16.0             [required by core]
  ∗ install ocaml-compiler-libs         v0.12.4             [required by torch]
  ∗ install conf-pkg-config             3
          [required by ctypes-foreign]
  ∗ install libtorch                    1.13.0+linux-x86_64 [required by torch]
  ∗ install fieldslib                   v0.16.0             [required by core]
  ∗ install integers                    0.7.0
          [required by ctypes]
  ∗ install jane-street-headers         v0.16.0             [required by core]
  ∗ install num                         1.4
          [required by sexplib]
  ∗ install parsexp                     v0.16.0
          [required by sexplib]
  ∗ install ppxlib                      0.31.0
          [required by ppx_jane]
  ∗ install conf-libffi                 2.0.0
          [required by ctypes-foreign]
  ∗ install ctypes                      0.21.1              [required by torch]
  ∗ install sexplib                     v0.16.0             [required by core]
  ∗ install ppx_variants_conv           v0.16.0
          [required by ppx_jane]
  ∗ install ppx_typerep_conv            v0.16.0
          [required by ppx_jane]
  ∗ install ppx_tydi                    v0.16.0
          [required by ppx_jane]
  ∗ install ppx_stable_witness          v0.16.0
          [required by ppx_jane]
  ∗ install ppx_stable                  v0.16.0
          [required by ppx_jane]
  ∗ install ppx_sexp_conv               v0.16.0             [required by core]
  ∗ install ppx_pipebang                v0.16.0
          [required by ppx_jane]
  ∗ install ppx_optional                v0.16.0
          [required by ppx_jane]
  ∗ install ppx_optcomp                 v0.16.0             [required by core]
  ∗ install ppx_ignore_instrumentation  v0.16.0
          [required by ppx_jane]
  ∗ install ppx_here                    v0.16.0
          [required by ppx_jane]
  ∗ install ppx_globalize               v0.16.0
          [required by ppx_base]
  ∗ install ppx_fixed_literal           v0.16.0
          [required by ppx_jane]
  ∗ install ppx_fields_conv             v0.16.0
          [required by ppx_jane]
  ∗ install ppx_enumerate               v0.16.0
          [required by ppx_base]
  ∗ install ppx_disable_unused_warnings v0.16.0
          [required by ppx_jane]
  ∗ install ppx_compare                 v0.16.0
          [required by ppx_base, bin_prot]
  ∗ install ppx_cold                    v0.16.0
          [required by ppx_base]
  ∗ install ctypes-foreign              0.21.1              [required by torch]
  ∗ install ppx_custom_printf           v0.16.0
          [required by ppx_jane]
  ∗ install ppx_sexp_value              v0.16.0
          [required by ppx_jane]
  ∗ install ppx_sexp_message            v0.16.0             [required by core]
  ∗ install ppx_let                     v0.16.0
          [required by ppx_jane]
  ∗ install ppx_hash                    v0.16.0             [required by core]
  ∗ install ppx_assert                  v0.16.0             [required by core]
  ∗ install bin_prot                    v0.16.0             [required by core]
  ∗ install ppx_log                     v0.16.0
          [required by ppx_jane]
  ∗ install ppx_base                    v0.16.0             [required by core]
  ∗ install jst-config                  v0.16.0             [required by core]
  ∗ install ppx_bin_prot                v0.16.0
          [required by ppx_jane]
  ∗ install ppx_string                  v0.16.0
          [required by ppx_jane]
  ∗ install time_now                    v0.16.0             [required by core]
  ∗ install ppx_module_timer            v0.16.0
          [required by ppx_jane]
  ∗ install ppx_inline_test             v0.16.1             [required by torch]
  ∗ install ppx_expect                  v0.16.0             [required by torch]
  ∗ install ppx_bench                   v0.16.0             [required by torch]
  ∗ install splittable_random           v0.16.0             [required by core]
  ∗ install base_quickcheck             v0.16.0             [required by core]
  ∗ install ppx_jane                    v0.16.0             [required by torch]
  ∗ install int_repr                    v0.16.0
          [required by base_bigstring]
  ∗ install base_bigstring              v0.16.0             [required by core]
  ∗ install core                        v0.16.2             [required by torch]
  ∗ install torch                       v0.16.0

And libffi-dev is installed through apt-get(I'm on ubuntu 20.04)

So what's going on? and how could I solve this in order to move on?

Thanks

LaurentMazare commented 11 months ago

I think you may want to report this on janestreet/torch as development for this repo has now moved over there.

overshiki commented 11 months ago

Sorry, my bad. And thank you for your reminder, I'll go there then.