Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kaldi-active-grammar: "cannot load library" #203089

Closed
Lykos153 opened this issue Nov 26, 2022 · 0 comments · Fixed by #203485
Closed

kaldi-active-grammar: "cannot load library" #203089

Lykos153 opened this issue Nov 26, 2022 · 0 comments · Fixed by #203485
Labels
0.kind: bug Something is broken

Comments

@Lykos153
Copy link

Describe the bug

I'm trying to run the example script https://raw.githubusercontent.com/daanzu/kaldi-active-grammar/master/examples/full_example.py, but I get the following error:

Kaldi-Active-Grammar v3.1.0:
    If this free, open source engine is valuable to you, please consider donating
    https://github.com/daanzu/kaldi-active-grammar
    Disable message by calling `kaldi_active_grammar.disable_donation_message()`
Traceback (most recent call last):
  File "/home/silvio/kaldi/full_example.py", line 10, in <module>
    compiler = kaldi_active_grammar.Compiler(model_dir=model_dir, tmp_dir=tmp_dir)
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/kaldi_active_grammar/compiler.py", line 270, in __init__
    NativeWFST.init_class(
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/kaldi_active_grammar/wfst.py", line 202, in init_class
    cls.init_ffi()
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/kaldi_active_grammar/ffi.py", line 35, in init_ffi
    cls._lib = _ffi.init_once(cls._init_ffi, cls.__name__ + '._init_ffi')
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/cffi/api.py", line 749, in init_once
    result = func()
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/kaldi_active_grammar/ffi.py", line 40, in _init_ffi
    return _ffi.dlopen(_library_binary_path)
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/nix/store/incraiihd7bdwvrgh46kz5648bf4ks27-python3-3.9.12-env/lib/python3.9/site-packages/cffi/api.py", line 827, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library '/nix/store/w6qjl5zfygzyica619imp2pvpy7hydyf-kaldi-kag-v2.1.0/lib/libkaldi-dragonfly.so': libstdc++.so.6: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/nix/store/w6qjl5zfygzyica619imp2pvpy7hydyf-kaldi-kag-v2.1.0/lib/libkaldi-dragonfly.so'

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix develop into this flake:
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/22.05";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};

        my-python = pkgs.python3;
        python-with-my-packages = my-python.withPackages (p: with p; [
#          dragonfly
          kaldi-active-grammar
        ]);
      in {
        devShell = pkgs.mkShell {
         packages = [
           python-with-my-packages
          ];
        };
      });
}
  1. wget https://raw.githubusercontent.com/daanzu/kaldi-active-grammar/master/examples/full_example.py
  2. (Adapt paths in script)
  3. python full_example.py

Expected behavior

I'm trying out the software for the first time, so I didn't know what to expect, but I guess I didn't expect this error.

Additional context

I tried nixpkgs master first, but there, kaldi-kag wouldn't build.

Notify maintainers

@ckiee

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.76, NixOS, 22.11 (Raccoon)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.0`
 - channels(silvio): `"home-manager"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant