csukuangfj / kaldifeat

Kaldi-compatible online & offline feature extraction with PyTorch, supporting CUDA, batch processing, chunk processing, and autograd - Provide C++ & Python API
https://csukuangfj.github.io/kaldifeat
Other
187 stars 35 forks source link

cl: 命令行 error D8021 :无效的数值参数“/Wno-register” #56

Closed lucasjinreal closed 2 months ago

lucasjinreal commented 2 years ago
c /Tpextensions/align.cpp /Fobuild\temp.win-amd64-3.9\Release\extensions/align.obj -std=c++11 -Wno-register -Wno-unused-function -Wno-unused-local-typedefs -funsigned-char
      cl: 命令行 error D8021 :无效的数值参数“/Wno-register”
      error: command 'D:\\apps\\VisualStudio\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

windows无法安装。

csukuangfj commented 2 years ago

完整的 log 是什么呢?

csukuangfj commented 2 years ago

windows/linux/macos, 都是支持的.

lucasjinreal commented 2 years ago

@csukuangfj 那就比较奇怪,我的g++是 MYSYS2 G++ 12

有测试过更加decent的g++吗

csukuangfj commented 2 years ago

你使用的安装方法是什么? 用visual studio 自带的编译器,是没问题的。

我看log里面提到的文件 align.cpp并不属于kaldifeat,是不是哪个地方,出问题了?

lucasjinreal commented 2 years ago

直接pip install kaldifeat ,哪个是因为 kaldialign 也失败了。

csukuangfj commented 2 years ago

pip install --verbose kaldifeat

然后可以把所有的输出,都贴出来么

lucasjinreal commented 2 years ago

@csukuangfj Hi, 一个一个跑发现实际上是kaldialign的错误:

 pip install kaldialign --verbose
Using pip 22.2.2 from C:\Users\Administrator\anaconda3\lib\site-packages\pip (python 3.9)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting kaldialign
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/30/1e/ec6129e4c26dc5be08aef1ebc5dd4aba3465e77877aa01533f65ca7aac43/kaldialign-0.2.tar.gz (39 kB)
  Running command python setup.py egg_info
  running egg_info
  creating C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info
  writing C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info\PKG-INFO
  writing dependency_links to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info\dependency_links.txt
  writing requirements to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info\requires.txt
  writing top-level names to C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info\top_level.txt
  writing manifest file 'C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'C:\Users\Administrator\AppData\Local\Temp\pip-pip-egg-info-jwk19ay7\kaldialign.egg-info\SOURCES.txt'
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: kaldialign
  Running command python setup.py bdist_wheel
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\extensions
  copying extensions\__init__.py -> build\lib.win-amd64-3.9\extensions
  running build_ext
  building 'kaldialign' extension
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\extensions
  D:\apps\VisualStudio\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Administrator\AppData\Local\Temp\pip-install-hu1_1anp\kaldialign_ee181ef35e4f471d8fb22c927e1a1f44/extensions -IC:\Users\Administrator\anaconda3\include -IC:\Users\Administrator\anaconda3\Include -ID:\apps\VisualStudio\VC\Tools\MSVC\14.33.31629\include -ID:\apps\VisualStudio\VC\Tools\MSVC\14.33.31629\ATLMFC\include -ID:\apps\VisualStudio\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" /EHsc /Tpextensions/align.cpp /Fobuild\temp.win-amd64-3.9\Release\extensions/align.obj -std=c++11 -Wno-register -Wno-unused-function -Wno-unused-local-typedefs -funsigned-char
  cl: 命令行 error D8021 :无效的数值参数“/Wno-register”
  error: command 'D:\\apps\\VisualStudio\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\Administrator\anaconda3\python.exe' -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-hu1_1anp\\kaldialign_ee181ef35e4f471d8fb22c927e1a1f44\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d 'C:\Users\Administrator\AppData\Local\Temp\pip-wheel-rdulxl8w'
  cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-hu1_1anp\kaldialign_ee181ef35e4f471d8fb22c927e1a1f44\
  Building wheel for kaldialign (setup.py) ... error
  ERROR: Failed building wheel for kaldialign
  Running setup.py clean for kaldialign
  Running command python setup.py clean
  running clean
  removing 'build\temp.win-amd64-3.9' (and everything under it)
  removing 'build\lib.win-amd64-3.9' (and everything under it)
  'build\bdist.win-amd64' does not exist -- can't clean it
  'build\scripts-3.9' does not exist -- can't clean it
  removing 'build'
Failed to build kaldialign
Installing collected packages: kaldialign
  Running command Running setup.py install for kaldialign
  running install
  C:\Users\Administrator\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    warnings.warn(
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\extensions
  copying extensions\__init__.py -> build\lib.win-amd64-3.9\extensions
  running build_ext
  building 'kaldialign' extension
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\extensions
  D:\apps\VisualStudio\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Administrator\AppData\Local\Temp\pip-install-hu1_1anp\kaldialign_ee181ef35e4f471d8fb22c927e1a1f44/extensions -IC:\Users\Administrator\anaconda3\include -IC:\Users\Administrator\anaconda3\Include -ID:\apps\VisualStudio\VC\Tools\MSVC\14.33.31629\include -ID:\apps\VisualStudio\VC\Tools\MSVC\14.33.31629\ATLMFC\include -ID:\apps\VisualStudio\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" /EHsc /Tpextensions/align.cpp /Fobuild\temp.win-amd64-3.9\Release\extensions/align.obj -std=c++11 -Wno-register -Wno-unused-function -Wno-unused-local-typedefs -funsigned-char
  cl: 命令行 error D8021 :无效的数值参数“/Wno-register”
  error: command 'D:\\apps\\VisualStudio\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  error: subprocess-exited-with-error

  × Running setup.py install for kaldialign did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
csukuangfj commented 2 years ago

你去kaldialign的repo提个issue?

lucasjinreal commented 2 years ago

@csukuangfj No, i am too lazy to raise another. this is your guys work as well in my opinion.....

csukuangfj commented 2 years ago

@pzelasko Could you have a look into the installation error of kaldialign on Windows?

Also, do you mind using pybind11 instead of cython for kaldialign? I can help with that.

lucasjinreal commented 2 years ago

@csukuangfj I don;t know much about pybind or cythin swith, I just want using pip install kaldialign on windows. Above I attached full log install it on windows, just fail. In my view your guys did a nice job but toolchains just too much..... I install them one by one always have a toolchain broken. I wish I know more about ASR but i am not an expert about this. I just wnat using your lib to do some newbie things, it's too many problems.

csukuangfj commented 2 years ago

Above I attached full log install it on windows, just fail.

I don't know much about cython. All other projects related to next-gen kaldi uses pybind11 to wrap c++ code to python and all of them work very well for macos, linux, and windows.


If you don't want to train a model, then only sherpa and k2 are required and both of them are well tested on windows, linux, and macOS. I am not sure why you have a hard time installing them.

csukuangfj commented 2 years ago

@jinfagang

Please retry to install the latest kaldialign (0.3.0) on Windows. It should work now.

pzelasko commented 2 years ago

Sorry for lack of responses from my side, I missed this thread somehow. And thanks again for the fix!

lucasjinreal commented 2 years ago

thank u, will try.