sherpa: Install from source failed

Hi I am trying to install sherpa from source and encountered with some errors.

First, when I intalling dependencies, it reported some errors when installing kaldifeat. I tried installing kaldifeat from source and it returned the same error. To bypass that and continue the procedure, I tried using conda install (not ideal though), and kaldifeat was succesfully installed.

Afterwards, I started to intall sherpa, but it ran into some error relating to k2_torch_api. Below are:

  • error returned when installing kaldifeat from pip/source (solved for now by using conda install)
  • commands used when installing kaldifeat with conda
  • error returned when installing sherpa from source
  1. kaldifeat installation error

/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so: undefined reference to cusparseGetErrorString@libcusparse.so.10

Whole log:

kaldifeat$ python3 setup.py install
running install
/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating kaldifeat.egg-info
writing kaldifeat.egg-info/PKG-INFO
writing dependency_links to kaldifeat.egg-info/dependency_links.txt
writing top-level names to kaldifeat.egg-info/top_level.txt
writing manifest file 'kaldifeat.egg-info/SOURCES.txt'
reading manifest file 'kaldifeat.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'kaldifeat.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/kaldifeat
copying kaldifeat/python/kaldifeat/online_feature.py -> build/lib.linux-x86_64-cpython-38/kaldifeat
copying kaldifeat/python/kaldifeat/offline_feature.py -> build/lib.linux-x86_64-cpython-38/kaldifeat
copying kaldifeat/python/kaldifeat/spectrogram.py -> build/lib.linux-x86_64-cpython-38/kaldifeat
copying kaldifeat/python/kaldifeat/fbank.py -> build/lib.linux-x86_64-cpython-38/kaldifeat
copying kaldifeat/python/kaldifeat/__init__.py -> build/lib.linux-x86_64-cpython-38/kaldifeat
copying kaldifeat/python/kaldifeat/mfcc.py -> build/lib.linux-x86_64-cpython-38/kaldifeat
copying kaldifeat/python/kaldifeat/plp.py -> build/lib.linux-x86_64-cpython-38/kaldifeat
running build_ext
Setting PYTHON_EXECUTABLE to /home/user/anaconda3/envs/env_k2/bin/python3
For fast compilation, run:
export KALDIFEAT_MAKE_ARGS="-j"; python setup.py install
Setting make_args to '-j4'
build command is:

                cd build/temp.linux-x86_64-cpython-38

                cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/home/user/anaconda3/envs/env_k2/bin/python3 -Dkaldifeat_BUILD_TESTS=OFF  -DCMAKE_INSTALL_PREFIX=/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/build/lib.linux-x86_64-cpython-38/kaldifeat  /home/user/workspace/asr_space/next_gen_kaldi/kaldifeat


                make  -j4  _kaldifeat install
            
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- C++ Standard version: 14
-- Downloading pybind11
-- pybind11 is downloaded to /home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/build/temp.linux-x86_64-cpython-38/_deps/pybind11-src
-- pybind11 v2.9.2 
-- Found PythonInterp: /home/user/anaconda3/envs/env_k2/bin/python3 (found version "3.8.15") 
-- Found PythonLibs: /home/user/anaconda3/envs/env_k2/lib/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Python executable: /home/user/anaconda3/envs/env_k2/bin/python3
-- TORCH_DIR: /home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found version "10.1") 
-- Caffe2: CUDA detected: 10.1
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.1
-- Found CUDNN: /usr/local/cuda/lib64/libcudnn.so  
-- Found cuDNN: v7.6.4  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s):  6.1 6.1 6.1 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Found Torch: /home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch/lib/libtorch.so  
-- PyTorch version: 1.7.1
-- CMAKE_CXX_FLAGS:  -D_GLIBCXX_USE_CXX11_ABI=0
-- CMAKE_INSTALL_PREFIX: /home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/build/lib.linux-x86_64-cpython-38/kaldifeat
-- All headers: /home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-common-inl.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-common.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-fbank.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-functions.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-mfcc.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-plp.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-spectrogram.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/feature-window.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/log.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/matrix-functions.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/mel-computations.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/online-feature-itf.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/online-feature.h;/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/kaldifeat/csrc/pitch-functions.h
-- Configuring done
CMake Warning at build/temp.linux-x86_64-cpython-38/_deps/pybind11-src/tools/pybind11Tools.cmake:165 (add_library):
  Cannot generate a safe runtime search path for target _kaldifeat because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libcublas.so.10] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/user/anaconda3/envs/env_k2/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  kaldifeat/python/csrc/CMakeLists.txt:2 (pybind11_add_module)


-- Generating done
-- Build files have been written to: /home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/build/temp.linux-x86_64-cpython-38
Scanning dependencies of target kaldifeat_core
[  5%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-fbank.cc.o
[ 10%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-functions.cc.o
[ 20%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-plp.cc.o
[ 20%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-mfcc.cc.o
[ 25%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-spectrogram.cc.o
[ 30%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/feature-window.cc.o
[ 35%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/matrix-functions.cc.o
[ 40%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/mel-computations.cc.o
[ 45%] Building CXX object kaldifeat/csrc/CMakeFiles/kaldifeat_core.dir/online-feature.cc.o
[ 50%] Linking CXX shared library ../../lib/libkaldifeat_core.so
[ 50%] Built target kaldifeat_core
Scanning dependencies of target _kaldifeat
[ 55%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/feature-fbank.cc.o
[ 60%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/feature-mfcc.cc.o
[ 65%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/feature-plp.cc.o
[ 70%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/feature-spectrogram.cc.o
[ 75%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/feature-window.cc.o
[ 80%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/kaldifeat.cc.o
[ 85%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/mel-computations.cc.o
[ 90%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/online-feature.cc.o
[ 95%] Building CXX object kaldifeat/python/csrc/CMakeFiles/_kaldifeat.dir/utils.cc.o
[100%] Linking CXX shared module ../../../lib/_kaldifeat.cpython-38-x86_64-linux-gnu.so
[100%] Built target _kaldifeat
[ 45%] Built target kaldifeat_core
Scanning dependencies of target test_kaldifeat
[ 50%] Building CXX object kaldifeat/csrc/CMakeFiles/test_kaldifeat.dir/test_kaldifeat.cc.o
[ 95%] Built target _kaldifeat
[100%] Linking CXX executable ../../bin/test_kaldifeat
/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so: undefined reference to `cusparseGetErrorString@libcusparse.so.10'
collect2: error: ld returned 1 exit status
kaldifeat/csrc/CMakeFiles/test_kaldifeat.dir/build.make:97: recipe for target 'bin/test_kaldifeat' failed
make[2]: *** [bin/test_kaldifeat] Error 1
CMakeFiles/Makefile2:131: recipe for target 'kaldifeat/csrc/CMakeFiles/test_kaldifeat.dir/all' failed
make[1]: *** [kaldifeat/csrc/CMakeFiles/test_kaldifeat.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 32, in <module>
    setuptools.setup(
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install.py", line 74, in run
    self.do_egg_install()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install.py", line 123, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 165, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 151, in call_command
    self.run_command(cmdname)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/install_lib.py", line 112, in build
    self.run_command('build_ext')
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
    self.build_extensions()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
    self._build_extensions_serial()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/user/workspace/asr_space/next_gen_kaldi/kaldifeat/cmake/cmake_extension.py", line 124, in build_extension
    raise Exception(
Exception: 
Build kaldifeat failed. Please check the error message.
You can ask for help by creating an issue on GitHub.

Click:
        https://github.com/csukuangfj/kaldifeat/issues/new
  1. conda install kaldifeat (succesful)
conda install -c kaldifeat -c pytorch -c conda-forge kaldifeat python=3.8 cudatoolkit=10.1 pytorch=1.7.1
  1. Sherpa installation error
sherpa$ python3 setup.py install --verbose
running install
/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating k2_sherpa.egg-info
writing k2_sherpa.egg-info/PKG-INFO
writing dependency_links to k2_sherpa.egg-info/dependency_links.txt
writing top-level names to k2_sherpa.egg-info/top_level.txt
writing manifest file 'k2_sherpa.egg-info/SOURCES.txt'
reading manifest file 'k2_sherpa.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'k2_sherpa.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/decode.py -> build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/lexicon.py -> build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/online_endpoint.py -> build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/http_server.py -> build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/nbest.py -> build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/timestamp.py -> build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/__init__.py -> build/lib.linux-x86_64-cpython-38/sherpa
copying sherpa/python/sherpa/utils.py -> build/lib.linux-x86_64-cpython-38/sherpa
running build_ext
Setting PYTHON_EXECUTABLE to /home/user/anaconda3/envs/env_k2/bin/python3
for fast compilation, run:
export SHERPA_MAKE_ARGS="-j"; python setup.py install
Setting make_args to "-j4"
build command is:

                cd build/temp.linux-x86_64-cpython-38

                cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/home/user/anaconda3/envs/env_k2/bin/python3 -DSHERPA_ENABLE_TESTS=OFF  -DCMAKE_INSTALL_PREFIX=/home/user/workspace/asr_space/next_gen_kaldi/sherpa/build/lib.linux-x86_64-cpython-38/sherpa  /home/user/workspace/asr_space/next_gen_kaldi/sherpa

                make -j4 install/strip
            
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE: Release
-- SHERPA_ENABLE_TESTS: OFF
-- SHERPA_ENABLE_PORTAUDIO: ON
-- SHERPA_ENABLE_WEBSOCKET: ON
-- Looking for C++ include cxxabi.h
-- Looking for C++ include cxxabi.h - found
-- Looking for C++ include execinfo.h
-- Looking for C++ include execinfo.h - found
-- SHERPA_OS: Ubuntu 16.04.6 LTS
-- CMake version: 3.14.0
-- Found Git: /usr/bin/git (found version "2.7.4") 
-- SHERPA_GIT_SHA1: 317d9d6a4aefb89d9bf95f04eda00d635e132f98
-- SHERPA_GIT_DATE: Wed Jan 18 11:31:43 2023
-- SHERPA_GIT_BRANCH: master
-- Downloading pybind11
-- pybind11 is downloaded to /home/user/workspace/asr_space/next_gen_kaldi/sherpa/build/temp.linux-x86_64-cpython-38/_deps/pybind11-src
-- pybind11 v2.10.2 
-- Found PythonInterp: /home/user/anaconda3/envs/env_k2/bin/python3 (found suitable version "3.8.12", minimum required is "3.6") 
-- Found PythonLibs: /home/user/anaconda3/envs/env_k2/lib/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Downloading json https://github.com/nlohmann/json/archive/refs/tags/v3.11.2.tar.gz
-- json is downloaded to /home/user/workspace/asr_space/next_gen_kaldi/sherpa/build/temp.linux-x86_64-cpython-38/_deps/json-src
-- Python executable: /home/user/anaconda3/envs/env_k2/bin/python3
-- PYTHON_EXECUTABLE: /home/user/anaconda3/envs/env_k2/bin/python3
-- TORCH_DIR: /home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found version "10.1") 
-- Caffe2: CUDA detected: 10.1
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.1
-- Found CUDNN: /usr/local/cuda/lib64/libcudnn.so  
-- Found cuDNN: v7.6.4  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s):  6.1 6.1 6.1 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Found Torch: /home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch/lib/libtorch.so  
-- TORCH_LIBRARIES: torch;torch_library;/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch/lib/libc10.so;/usr/local/cuda/lib64/stubs/libcuda.so;/usr/local/cuda/lib64/libnvrtc.so;/usr/local/cuda/lib64/libnvToolsExt.so;/usr/local/cuda/lib64/libcudart.so;/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/torch/lib/libc10_cuda.so
-- PyTorch version: 1.7.1
CMake Warning (dev) at cmake/k2.cmake:38:
  Syntax Warning in cmake code at column 52

  Argument not separated from preceding token by whitespace.
Call Stack (most recent call first):
  CMakeLists.txt:141 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Python executable: /home/user/anaconda3/envs/env_k2/bin/python3
-- K2_CMAKE_PREFIX_PATH: /home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/k2-1.23.3.dev20230117+cuda10.1.torch1.7.1-py3.8-linux-x86_64.egg/k2/share/cmake
CMake Error at /usr/local/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find k2 (missing: location_k2_torch_api location_k2_torch)
  (Required is at least version "1.23.2")
Call Stack (most recent call first):
  /usr/local/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/k2-1.23.3.dev20230117+cuda10.1.torch1.7.1-py3.8-linux-x86_64.egg/k2/share/cmake/k2/k2Config.cmake:74 (find_package_handle_standard_args)
  cmake/k2.cmake:18 (find_package)
  CMakeLists.txt:141 (include)


-- Configuring incomplete, errors occurred!
See also "/home/user/workspace/asr_space/next_gen_kaldi/sherpa/build/temp.linux-x86_64-cpython-38/CMakeFiles/CMakeOutput.log".
See also "/home/user/workspace/asr_space/next_gen_kaldi/sherpa/build/temp.linux-x86_64-cpython-38/CMakeFiles/CMakeError.log".
make: *** No rule to make target 'install/strip'.  Stop.
Traceback (most recent call last):
  File "setup.py", line 99, in <module>
    setuptools.setup(
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install.py", line 74, in run
    self.do_egg_install()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install.py", line 123, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 165, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 151, in call_command
    self.run_command(cmdname)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/install_lib.py", line 112, in build
    self.run_command('build_ext')
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
    self.build_extensions()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
    self._build_extensions_serial()
  File "/home/user/anaconda3/envs/env_k2/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/user/workspace/asr_space/next_gen_kaldi/sherpa/cmake/cmake_extension.py", line 117, in build_extension
    raise Exception(
Exception: 
Build sherpa failed. Please check the error message.
You can ask for help by creating an issue on GitHub.

Click:
        https://github.com/k2-fsa/sherpa/issues/new

For errors of sherpa installation, is it related to “k2_torch_api”? Is it relevant to my earlier issue of k2 installation https://github.com/k2-fsa/k2/issues/1143?

Hope it does not look too messy. May I know how to fix kaldifeat error in better way (simpler than conda), and more importantly, how to fix the sherpa installation error? Thanks a lot.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 35 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Great to hear that! Would you mind creating a pull-request to include your changes?

Hi I just made the pull request, does it look ok? Hope it helps.

@csukuangfj Does the failure at those tests suggests that the sherpa installed with it is actually not workable?

No, it should work.

Great to hear that! Would you mind creating a pull-request to include your changes?

Sure no problem. Shall be done this afternoon, or at least within today.