janestreet / torch

MIT License
100 stars 9 forks source link

undefined symbol: ffi_type_void, version LIBFFI_BASE_7.0 #7

Open overshiki opened 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 following 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 dependencies are:

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

Thanks

mwlon commented 7 months ago

I'm not sure what's causing this issue, but we did recently fix some build issues in various parts of the repo. If that doesn't resolve the issue, you may need to keep debugging on your side. I'm afraid we won't be able to provide much more support unless more people encounter this.