chatglm.cpp icon indicating copy to clipboard operation
chatglm.cpp copied to clipboard

pip install -U chatglm-cpp报错

Open zqkou opened this issue 1 year ago • 25 comments

OS: Debian GNU/Linux 12 Python 3.9.17 pip 23.2

报错:

# pip install -U chatglm-cpp
Collecting chatglm-cpp
  Using cached chatglm-cpp-0.2.0.tar.gz (2.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: chatglm-cpp
  Building wheel for chatglm-cpp (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for chatglm-cpp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [80 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/chatglm_cpp
      copying chatglm_cpp/__init__.py -> build/lib.linux-x86_64-cpython-39/chatglm_cpp
      running egg_info
      writing chatglm_cpp.egg-info/PKG-INFO
      writing dependency_links to chatglm_cpp.egg-info/dependency_links.txt
      writing top-level names to chatglm_cpp.egg-info/top_level.txt
      reading manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      running build_ext
      -- The CXX compiler identification is unknown
      CMake Error at CMakeLists.txt:2 (project):
        No CMAKE_CXX_COMPILER could be found.
      
        Tell CMake where to find the compiler by setting either the environment
        variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
        to the compiler, or to the compiler name if it is in the PATH.
      
      
      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 46, in <module>
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-kux5vrnx/normal/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/tmp/pip-build-env-kux5vrnx/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 39, in build_extension
        File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-akeyqerw/chatglm-cpp_a82cee8d371f4dedbffbdb0b40de85bf', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-akeyqerw/chatglm-cpp_a82cee8d371f4dedbffbdb0b40de85bf/build/lib.linux-x86_64-cpython-39/chatglm_cpp/', '-DPYTHON_EXECUTABLE=/usr/local/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DCHATGLM_ENABLE_PYBIND=ON']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chatglm-cpp
Failed to build chatglm-cpp
ERROR: Could not build wheels for chatglm-cpp, which is required to install pyproject.toml-based projects
# 

zqkou avatar Jul 20 '23 08:07 zqkou

I installed g++, but still get error:

Using pip 23.2 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
Collecting chatglm-cpp
  Using cached chatglm-cpp-0.2.0.tar.gz (2.5 MB)
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=42
    Obtaining dependency information for setuptools>=42 from https://files.pythonhosted.org/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl.metadata
    Using cached setuptools-68.0.0-py3-none-any.whl.metadata (6.4 kB)
  Collecting cmake>=3.12
    Obtaining dependency information for cmake>=3.12 from https://files.pythonhosted.org/packages/14/b8/06f8fdc4687af3d3d8d95461d97737df2f144acd28eff65a3c47c29d0152/cmake-3.27.0-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
    Using cached cmake-3.27.0-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (6.7 kB)
  Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
  Using cached cmake-3.27.0-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (26.0 MB)
  Installing collected packages: cmake, setuptools
  Successfully installed cmake-3.27.0 setuptools-68.0.0
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  writing chatglm_cpp.egg-info/PKG-INFO
  writing dependency_links to chatglm_cpp.egg-info/dependency_links.txt
  writing top-level names to chatglm_cpp.egg-info/top_level.txt
  reading manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Collecting wheel
    Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  Installing collected packages: wheel
  Successfully installed wheel-0.40.0
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp.egg-info
  writing /tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp.egg-info/dependency_links.txt
  writing top-level names to /tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp.egg-info/top_level.txt
  writing manifest file '/tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp.egg-info/SOURCES.txt'
  creating '/tmp/pip-modern-metadata-zbwryhzz/chatglm_cpp-0.2.0.dist-info'
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: chatglm-cpp
  Running command Building wheel for chatglm-cpp (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-39
  creating build/lib.linux-x86_64-cpython-39/chatglm_cpp
  copying chatglm_cpp/__init__.py -> build/lib.linux-x86_64-cpython-39/chatglm_cpp
  running egg_info
  writing chatglm_cpp.egg-info/PKG-INFO
  writing dependency_links to chatglm_cpp.egg-info/dependency_links.txt
  writing top-level names to chatglm_cpp.egg-info/top_level.txt
  reading manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
  running build_ext
  -- The CXX compiler identification is GNU 12.2.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Deprecation Warning at third_party/ggml/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- The C compiler identification is GNU 12.2.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
  -- Found Threads: TRUE
  -- CMAKE_SYSTEM_PROCESSOR: x86_64
  -- x86 detected
  -- Linux detected
  CMake Deprecation Warning at third_party/sentencepiece/CMakeLists.txt:15 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- VERSION: 0.2.00
  -- Not Found TCMalloc: TCMALLOC_LIB-NOTFOUND
  CMake Deprecation Warning at third_party/pybind11/CMakeLists.txt:8 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- pybind11 v2.10.4
  CMake Warning (dev) at third_party/pybind11/tools/FindPythonLibsNew.cmake:98 (find_package):
    Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
    are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
    the cmake_policy command to set the policy and suppress this warning.

  Call Stack (most recent call first):
    third_party/pybind11/tools/pybind11Tools.cmake:50 (find_package)
    third_party/pybind11/tools/pybind11Common.cmake:180 (include)
    third_party/pybind11/CMakeLists.txt:208 (include)
  This warning is for project developers.  Use -Wno-dev to suppress it.

  -- Found PythonInterp: /usr/local/bin/python (found suitable version "3.9.17", minimum required is "3.6")
  -- Found PythonLibs: /usr/local/lib/libpython3.9.so
  -- Performing Test HAS_FLTO
  -- Performing Test HAS_FLTO - Success
  -- Configuring done (7.7s)
  -- Generating done (0.2s)
  -- Build files have been written to: /tmp/pip-install-hry_gfbg/chatglm-cpp_ec1c95d32b924f91b4df6edff3ff1c48/build/temp.linux-x86_64-cpython-39/chatglm_cpp._C
  [  1%] Building C object third_party/ggml/src/CMakeFiles/ggml.dir/ggml.c.o
  [  5%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/builder.cc.o
  [ 11%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/trainer_factory.cc.o
  [ 14%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/word_model_trainer.cc.o
  [ 15%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/sentencepiece_trainer.cc.o
  [ 10%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/trainer_interface.cc.o
  [  2%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/unicode_script.cc.o
  [  4%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/bpe_model_trainer.cc.o
  [ 12%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/char_model_trainer.cc.o
  [  8%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/unigram_model_trainer.cc.o
  [  7%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/pretokenizer_for_training.cc.o
  [ 21%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/extension_set.cc.o
  [ 17%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/arena.cc.o
  [ 24%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/int128.cc.o
  [ 25%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_enum_util.cc.o
  [ 27%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/coded_stream.cc.o
  [ 28%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/parse_context.cc.o
  [ 30%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/bytestream.cc.o
  [ 31%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/time.cc.o
  [ 22%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/arenastring.cc.o
  [ 35%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/stringprintf.cc.o
  [ 18%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/common.cc.o
  [ 37%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/message_lite.cc.o
  [ 38%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/implicit_weak_message.cc.o
  [ 42%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/zero_copy_stream.cc.o
  [ 44%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/filesystem.cc.o
  [ 45%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/builtin_pb/sentencepiece.pb.cc.o
  [ 48%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/char_model.cc.o
  [ 50%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/zero_copy_stream_impl.cc.o
  [ 51%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/model_factory.cc.o
  [ 52%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_message_util.cc.o
  [ 34%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/stringpiece.cc.o
  [ 54%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_message_table_driven_lite.cc.o
  [ 32%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/statusor.cc.o
  [ 20%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/repeated_field.cc.o
  [ 41%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/builtin_pb/sentencepiece_model.pb.cc.o
  [ 67%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/status.cc.o
  [ 68%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/unigram_model.cc.o
  [ 40%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/io_win32.cc.o
  [ 55%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/normalizer.cc.o
  [ 62%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/sentencepiece_processor.cc.o
  [ 47%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/bpe_model.cc.o
  [ 57%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/wire_format_lite.cc.o
  [ 70%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/structurally_valid.cc.o
  [ 58%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/model_interface.cc.o
  [ 61%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/zero_copy_stream_impl_lite.cc.o
  [ 71%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/absl/flags/flag.cc.o
  [ 64%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/strutil.cc.o
  [ 65%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/error.cc.o
  [ 70%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/util.cc.o
  [ 72%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/word_model.cc.o
  c++: internal compiler error: Segmentation fault signal terminated program cc1plus
  Please submit a full bug report, with preprocessed source (by using -freport-bug).
  See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
  gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/build.make:76: third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/arena.cc.o] Error 4
  gmake[2]: *** Waiting for unfinished jobs....

zqkou avatar Jul 20 '23 09:07 zqkou

Changing OS to ubuntu:22.04, get different error when pip install:

# pip3 install -v chatglm-cpp
Using pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
Collecting chatglm-cpp
  Using cached chatglm-cpp-0.2.0.tar.gz (2.5 MB)
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=42
    Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
  Collecting cmake>=3.12
    Using cached cmake-3.27.0-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (26.0 MB)
  Installing collected packages: cmake, setuptools
  Successfully installed cmake-3.27.0 setuptools-68.0.0
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  creating UNKNOWN.egg-info
  writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
  writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Collecting wheel
    Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  Installing collected packages: wheel
  Successfully installed wheel-0.40.0
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /tmp/pip-modern-metadata-hiep58ot/UNKNOWN.egg-info
  writing manifest file '/tmp/pip-modern-metadata-hiep58ot/UNKNOWN.egg-info/SOURCES.txt'
  writing manifest file '/tmp/pip-modern-metadata-hiep58ot/UNKNOWN.egg-info/SOURCES.txt'
  Preparing metadata (pyproject.toml) ... done
  WARNING: Generating metadata for package chatglm-cpp produced metadata for project name unknown. Fix your #egg=chatglm-cpp fragments.
Discarding https://files.pythonhosted.org/packages/bf/64/50a1d0895cadaf893a7cb0b1b1f994ce4a993f84d5b4457dd0f0c8d74e6e/chatglm-cpp-0.2.0.tar.gz#sha256=490ec87dbe165879b0566068068791d1ff261442d8174dc72b612a419f3f7e90 (from https://pypi.org/simple/chatglm-cpp/) (requires-python:>=3.7): Requested unknown from https://files.pythonhosted.org/packages/bf/64/50a1d0895cadaf893a7cb0b1b1f994ce4a993f84d5b4457dd0f0c8d74e6e/chatglm-cpp-0.2.0.tar.gz#sha256=490ec87dbe165879b0566068068791d1ff261442d8174dc72b612a419f3f7e90 has inconsistent name: filename has 'chatglm-cpp', but metadata has 'unknown'
ERROR: Could not find a version that satisfies the requirement chatglm-cpp (from versions: 0.2.0)
ERROR: No matching distribution found for chatglm-cpp
# 

zqkou avatar Jul 20 '23 09:07 zqkou

Hi, would you try upgrading your pip and then retry:

python3 -m pip install -U pip

li-plus avatar Jul 21 '23 06:07 li-plus

Thanks a lot for reply.

Pip is already the latest version

# python3 -m pip install -U pip
Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (23.2)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
# 

Hi, would you try upgrading your pip and then retry:

python3 -m pip install -U pip

zqkou avatar Jul 21 '23 09:07 zqkou

源码安装也报错了,错误信息:

Processing /home/huangzhiguo/research/chatglm.cpp
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: chatglm-cpp
  Building wheel for chatglm-cpp (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for chatglm-cpp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [107 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing chatglm_cpp.egg-info/PKG-INFO
      writing dependency_links to chatglm_cpp.egg-info/dependency_links.txt
      writing top-level names to chatglm_cpp.egg-info/top_level.txt
      reading manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no directories found matching 'third_party/ggml/include'
      warning: no directories found matching 'third_party/ggml/src'
      warning: no files found matching 'third_party/ggml/*'
      warning: no directories found matching 'third_party/pybind11/include'
      warning: no directories found matching 'third_party/pybind11/tools'
      warning: no directories found matching 'third_party/sentencepiece/src'
      warning: no directories found matching 'third_party/sentencepiece/third_party'
      warning: no files found matching 'third_party/sentencepiece/*'
      adding license file 'LICENSE'
      writing manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      running build_ext
      CMake Error at CMakeLists.txt:19 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/ggml

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:23 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/sentencepiece

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:73 (set_target_properties):
        set_target_properties Can not find target to add properties to: ggml


      CMake Error at CMakeLists.txt:74 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/pybind11

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:75 (pybind11_add_module):
        Unknown CMake command "pybind11_add_module".


      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 46, in <module>
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/normal/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 39, in build_extension
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '/home/huangzhiguo/research/chatglm.cpp', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/huangzhiguo/research/chatglm.cpp/build/lib.linux-x86_64-cpython-39/chatglm_cpp/', '-DPYTHON_EXECUTABLE=/home/huangzhiguo/anaconda3/envs/transformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DCHATGLM_ENABLE_PYBIND=ON', '-DCMAKE_LINKER=/home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-ld', '-DCMAKE_STRIP=/home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-strip']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chatglm-cpp
Failed to build chatglm-cpp
ERROR: Could not build wheels for chatglm-cpp, which is required to install pyproject.toml-based projects

hzg0601 avatar Jul 23 '23 10:07 hzg0601

如果是从Pypy下载的安装包,用pip install 安装则会报如下错误:

Processing ./chatglm-cpp-0.2.1.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: chatglm-cpp
  Building wheel for chatglm-cpp (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for chatglm-cpp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [610 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/chatglm_cpp
      copying chatglm_cpp/__init__.py -> build/lib.linux-x86_64-cpython-39/chatglm_cpp
      running egg_info
      writing chatglm_cpp.egg-info/PKG-INFO
      writing dependency_links to chatglm_cpp.egg-info/dependency_links.txt
      writing top-level names to chatglm_cpp.egg-info/top_level.txt
      reading manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      running build_ext
      -- The CXX compiler identification is GNU 11.2.0
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- The C compiler identification is GNU 11.2.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      -- 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
      -- CMAKE_SYSTEM_PROCESSOR: x86_64
      -- x86 detected
      -- Linux detected
      -- VERSION: 0.2.00
      -- Not Found TCMalloc: TCMALLOC_LIB-NOTFOUND
      -- pybind11 v2.11.1
      -- Found PythonInterp: /home/huangzhiguo/anaconda3/envs/transformers/bin/python (found suitable version "3.9", minimum required is "3.6")
      -- Found PythonLibs: python3.9
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Configuring done (1.5s)
      -- Generating done (0.0s)
      -- Build files have been written to: /tmp/pip-req-build-m46dnkn8/build/temp.linux-x86_64-cpython-39/chatglm_cpp._C
      [  1%] Building C object third_party/ggml/src/CMakeFiles/ggml.dir/ggml.c.o
      [  5%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/builder.cc.o
      [  5%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/unicode_script.cc.o
      [  5%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/trainer_factory.cc.o
      [  7%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/unigram_model_trainer.cc.o
      [  8%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/common.cc.o
      [ 10%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/trainer_interface.cc.o
      [ 12%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_enum_util.cc.o
      [ 11%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/word_model_trainer.cc.o
      [ 14%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/bpe_model_trainer.cc.o
      [ 15%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/bytestream.cc.o
      [ 17%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/sentencepiece_trainer.cc.o
      [ 21%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_message_util.cc.o
      [ 21%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/extension_set.cc.o
      [ 21%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/pretokenizer_for_training.cc.o
      [ 24%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/arenastring.cc.o
      [ 24%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/arena.cc.o
      [ 27%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/parse_context.cc.o
      [ 27%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/char_model_trainer.cc.o
      [ 28%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/message_lite.cc.o
      [ 31%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_message_table_driven_lite.cc.o
      [ 31%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/coded_stream.cc.o
      [ 32%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/int128.cc.o
      [ 34%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/structurally_valid.cc.o
      [ 35%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/repeated_field.cc.o
      [ 37%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/io_win32.cc.o
      [ 38%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/stringprintf.cc.o
      [ 40%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/statusor.cc.o
      [ 41%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/implicit_weak_message.cc.o
      [ 44%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/zero_copy_stream.cc.o
      [ 44%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/strutil.cc.o
      [ 45%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/wire_format_lite.cc.o
      [ 48%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/status.cc.o
      [ 48%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/stringpiece.cc.o
      [ 50%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/builtin_pb/sentencepiece.pb.cc.o
      [ 51%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/builtin_pb/sentencepiece_model.pb.cc.o
      [ 54%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/time.cc.o
      [ 54%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/char_model.cc.o
      [ 55%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/zero_copy_stream_impl_lite.cc.o
      [ 57%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/zero_copy_stream_impl.cc.o
      [ 60%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/bpe_model.cc.o
      [ 60%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/error.cc.o
      [ 61%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/filesystem.cc.o
      [ 62%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/model_factory.cc.o
      [ 65%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/sentencepiece_processor.cc.o
      [ 65%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/model_interface.cc.o
      [ 67%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/normalizer.cc.o
      [ 70%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/unigram_model.cc.o
      [ 70%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/util.cc.o
      [ 71%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/word_model.cc.o
      [ 72%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/absl/flags/flag.cc.o
      In file included from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/time.cc:3:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/common.cc:58:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/time.cc.o] Error 1
      gmake[2]: *** Waiting for unfinished jobs....
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.cc:4:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/pretokenizer_for_training.h:22,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/pretokenizer_for_training.cc:14:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/bits/this_thread_sleep.h:38,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/thread:44,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/util.h:27,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/word_model.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builder.h:23,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/sentencepiece_trainer.cc:18:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/wire_format_lite.h:49,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/wire_format_lite.cc:35:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/common.cc.o] Error 1
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/bpe_model_trainer.h:24,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/trainer_factory.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/implicit_weak_message.h:38,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/parse_context.h:42,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/extension_set.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven_lite.h:35,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/generated_message_table_driven_lite.cc:31:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/trainer_interface.h:27,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/trainer_interface.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/repeated_field.h:63,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/repeated_field.cc:35:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/bits/locale_facets_nonio.h:39,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/locale:41,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/iomanip:43,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/int128.cc:33:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/bpe_model.h:18,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_factory.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/generated_enum_util.cc:31:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/mutex.h:33,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/arena.cc:37:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/bits/this_thread_sleep.h:38,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/thread:44,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/util.h:27,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/word_model_trainer.cc:20:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/char_model.h:18,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/char_model_trainer.cc:17:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/implicit_weak_message.h:38,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/parse_context.h:42,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/parse_context.cc:31:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/bits/this_thread_sleep.h:38,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/thread:44,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/util.h:27,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/absl/flags/flag.cc:25:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/init.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/error.cc:18:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/implicit_weak_message.h:38,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/implicit_weak_message.cc:31:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/message_lite.cc:36:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece.pb.cc:4:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/implicit_weak_message.h:38,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/parse_context.h:42,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/extension_set.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/extension_set.cc:35:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/any.h:38,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_util.h:49,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/generated_message_util.cc:35:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/implicit_weak_message.h:38,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/parse_context.h:42,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/third_party/protobuf-lite/arenastring.cc:35:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/wire_format_lite.cc.o] Error 1
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/bpe_model_trainer.h:24,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/bpe_model_trainer.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/bpe_model.h:18,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/bpe_model.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/bits/this_thread_sleep.h:38,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/thread:44,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/util.h:27,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/util.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/char_model.h:18,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/char_model.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/int128.cc.o] Error 1
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/unigram_model_trainer.h:23,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/unigram_model_trainer.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/pretokenizer_for_training.cc.o] Error 1
      gmake[2]: *** Waiting for unfinished jobs....
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/bits/this_thread_sleep.h:38,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/thread:44,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/util.h:27,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/unicode_script.cc:20:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/arena.cc.o] Error 1
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builder.h:23,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builder.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.cc:17:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_message_table_driven_lite.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_enum_util.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/repeated_field.cc.o] Error 1
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_factory.h:20,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/sentencepiece_processor.cc:23:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/mutex:39,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/stubs/once.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/message_lite.h:50,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_enum_util.h:36,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/map.h:55,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/../third_party/protobuf-lite/google/protobuf/generated_message_table_driven.h:34,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/builtin_pb/sentencepiece_model.pb.h:26,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/normalizer.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/model_interface.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/unigram_model.h:25,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/unigram_model.cc:15:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/builtin_pb/sentencepiece_model.pb.cc.o] Error 1
      In file included from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/chrono:42,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/bits/this_thread_sleep.h:38,
                       from /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/thread:44,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/util.h:27,
                       from /tmp/pip-req-build-m46dnkn8/third_party/sentencepiece/src/filesystem.cc:19:
      /home/huangzhiguo/anaconda3/envs/transformers/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/implicit_weak_message.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/error.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/arenastring.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/parse_context.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/message_lite.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/builtin_pb/sentencepiece.pb.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/generated_message_util.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/unicode_script.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/absl/flags/flag.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/word_model.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/util.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/filesystem.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/extension_set.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/normalizer.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/char_model.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/char_model_trainer.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/word_model_trainer.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/trainer_factory.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/model_factory.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/sentencepiece_trainer.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/bpe_model.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/model_interface.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/bpe_model_trainer.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/trainer_interface.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/builder.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/unigram_model.cc.o] Error 1
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/sentencepiece_processor.cc.o] Error 1
      gmake[1]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/all] Error 2
      gmake[1]: *** Waiting for unfinished jobs....
      gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/unigram_model_trainer.cc.o] Error 1
      gmake[1]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece_train-static.dir/all] Error 2
      [ 74%] Linking C static library ../../../lib/libggml.a
      [ 74%] Built target ggml
      gmake: *** [all] Error 2
      Traceback (most recent call last):
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 46, in <module>
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-_nbd9l2c/normal/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/tmp/pip-build-env-_nbd9l2c/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 40, in build_extension
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '--build', '.', '-j']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chatglm-cpp
Failed to build chatglm-cpp
ERROR: Could not build wheels for chatglm-cpp, which is required to install pyproject.toml-based projects

@li-plus

hzg0601 avatar Jul 23 '23 10:07 hzg0601

如果方便,是否能将您编译好的wheel文件给出?@li-plus

hzg0601 avatar Jul 23 '23 10:07 hzg0601

目前为止,只有Mac平台的 pip install 成功了。希望能帮忙解决下其它平台的安装问题。@li-plus

zqkou avatar Jul 25 '23 01:07 zqkou

ERROR: Could not build wheels for chatglm-cpp, which is required to install pyproject.toml-based projects

jackaihfia2334 avatar Jul 28 '23 09:07 jackaihfia2334

@li-plus Do you plan to fix this issue?

zqkou avatar Aug 14 '23 08:08 zqkou

@zqkou Would you try installing the latest chatglm-cpp package and see if this error still exists?

li-plus avatar Aug 14 '23 09:08 li-plus

@li-plus Tried again, still got the similar error:

  [ 70%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/absl/flags/flag.cc.o
  [ 65%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/builtin_pb/sentencepiece.pb.cc.o
  [ 51%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/normalizer.cc.o
  [ 52%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/sentencepiece_processor.cc.o
  [ 68%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/model_interface.cc.o
  [ 61%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/error.cc.o
  [ 72%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/word_model.cc.o
  [ 71%] Building CXX object third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/unigram_model.cc.o
  Segmentation fault (core dumped)
  gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/build.make:202: third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/__/third_party/protobuf-lite/implicit_weak_message.cc.o] Error 139
  gmake[2]: *** Waiting for unfinished jobs....
  Segmentation fault (core dumped)
  gmake[2]: *** [third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/build.make:566: third_party/sentencepiece/src/CMakeFiles/sentencepiece-static.dir/sentencepiece_processor.cc.o] Error 139
Killed

zqkou avatar Aug 16 '23 08:08 zqkou

same error

Could not build wheels for chatglm-cpp, which is required to install pyproject.toml-based projects

lonngxiang avatar Aug 23 '23 06:08 lonngxiang

源码安装也报错了,错误信息:

Processing /home/huangzhiguo/research/chatglm.cpp
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: chatglm-cpp
  Building wheel for chatglm-cpp (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for chatglm-cpp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [107 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing chatglm_cpp.egg-info/PKG-INFO
      writing dependency_links to chatglm_cpp.egg-info/dependency_links.txt
      writing top-level names to chatglm_cpp.egg-info/top_level.txt
      reading manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no directories found matching 'third_party/ggml/include'
      warning: no directories found matching 'third_party/ggml/src'
      warning: no files found matching 'third_party/ggml/*'
      warning: no directories found matching 'third_party/pybind11/include'
      warning: no directories found matching 'third_party/pybind11/tools'
      warning: no directories found matching 'third_party/sentencepiece/src'
      warning: no directories found matching 'third_party/sentencepiece/third_party'
      warning: no files found matching 'third_party/sentencepiece/*'
      adding license file 'LICENSE'
      writing manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      running build_ext
      CMake Error at CMakeLists.txt:19 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/ggml

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:23 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/sentencepiece

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:73 (set_target_properties):
        set_target_properties Can not find target to add properties to: ggml


      CMake Error at CMakeLists.txt:74 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/pybind11

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:75 (pybind11_add_module):
        Unknown CMake command "pybind11_add_module".


      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 46, in <module>
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/normal/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 39, in build_extension
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '/home/huangzhiguo/research/chatglm.cpp', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/huangzhiguo/research/chatglm.cpp/build/lib.linux-x86_64-cpython-39/chatglm_cpp/', '-DPYTHON_EXECUTABLE=/home/huangzhiguo/anaconda3/envs/transformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DCHATGLM_ENABLE_PYBIND=ON', '-DCMAKE_LINKER=/home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-ld', '-DCMAKE_STRIP=/home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-strip']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chatglm-cpp
Failed to build chatglm-cpp
ERROR: Could not build wheels for chatglm-cpp, which is required to install pyproject.toml-based projects

你需要读取 submodule,执行git submodule update --init --recursive再试试

wizardbyron avatar Aug 30 '23 01:08 wizardbyron

use wheels: https://github.com/cczhong11/chatglm.cpp/actions/runs/5904410708

zhangp365 avatar Sep 17 '23 02:09 zhangp365

我也遇到了这个问题,明确cuda版本的软连接实际对应的版本(我装了多个cuda版本,比如我这边是ln -s /usr/local/cuda-12.2/ /usr/local/cuda/ )后再按以下的命令指定了编译器(gcc和g++用的devtoolset-7的),我编译成功了,供参考 CMAKE_ARGS="-DGGML_CUBLAS=ON -DCUDA_ARCHITECTURES=75 -DCMAKE_CUDA_ARCHITECTURES=75 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.2/bin/nvcc -DCMAKE_C_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++" pip install -U chatglm-cpp`

ccjaread avatar Nov 07 '23 13:11 ccjaread

我是用下面这个方法解决的,值得一试

git clone https://github.com/li-plus/chatglm.cpp.git
cd ./chatglm.cpp
pip install .

HideOnBush1999 avatar Nov 13 '23 12:11 HideOnBush1999

Debian12

我这边是安装对应版本的dev包后就可以了, 检查下是否有对应版本的包, 比如python3.11-dev/python3-dev?

~~可能还需要安装pybind11, 在环境中 pip install --upgrade pybind11~~

StrayDragon avatar Nov 14 '23 09:11 StrayDragon

源码安装也报错了,错误信息:

Processing /home/huangzhiguo/research/chatglm.cpp
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: chatglm-cpp
  Building wheel for chatglm-cpp (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for chatglm-cpp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [107 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing chatglm_cpp.egg-info/PKG-INFO
      writing dependency_links to chatglm_cpp.egg-info/dependency_links.txt
      writing top-level names to chatglm_cpp.egg-info/top_level.txt
      reading manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no directories found matching 'third_party/ggml/include'
      warning: no directories found matching 'third_party/ggml/src'
      warning: no files found matching 'third_party/ggml/*'
      warning: no directories found matching 'third_party/pybind11/include'
      warning: no directories found matching 'third_party/pybind11/tools'
      warning: no directories found matching 'third_party/sentencepiece/src'
      warning: no directories found matching 'third_party/sentencepiece/third_party'
      warning: no files found matching 'third_party/sentencepiece/*'
      adding license file 'LICENSE'
      writing manifest file 'chatglm_cpp.egg-info/SOURCES.txt'
      running build_ext
      CMake Error at CMakeLists.txt:19 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/ggml

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:23 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/sentencepiece

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:73 (set_target_properties):
        set_target_properties Can not find target to add properties to: ggml


      CMake Error at CMakeLists.txt:74 (add_subdirectory):
        The source directory

          /home/huangzhiguo/research/chatglm.cpp/third_party/pybind11

        does not contain a CMakeLists.txt file.


      CMake Error at CMakeLists.txt:75 (pybind11_add_module):
        Unknown CMake command "pybind11_add_module".


      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 46, in <module>
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/normal/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/tmp/pip-build-env-j58pw0yt/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 39, in build_extension
        File "/home/huangzhiguo/anaconda3/envs/transformers/lib/python3.9/subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '/home/huangzhiguo/research/chatglm.cpp', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/huangzhiguo/research/chatglm.cpp/build/lib.linux-x86_64-cpython-39/chatglm_cpp/', '-DPYTHON_EXECUTABLE=/home/huangzhiguo/anaconda3/envs/transformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DCHATGLM_ENABLE_PYBIND=ON', '-DCMAKE_LINKER=/home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-ld', '-DCMAKE_STRIP=/home/huangzhiguo/anaconda3/envs/transformers/bin/x86_64-conda-linux-gnu-strip']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chatglm-cpp
Failed to build chatglm-cpp
ERROR: Could not build wheels for chatglm-cpp, which is required to install pyproject.toml-based projects

你需要读取 submodule,执行git submodule update --init --recursive再试试


this is work for me on mac m1: 'git submodule update --init --recursive'

zhaoyb1990 avatar Nov 27 '23 03:11 zhaoyb1990

我也遇到了这个问题,明确cuda版本的软连接实际对应的版本(我装了多个cuda版本,比如我这边是ln -s /usr/local/cuda-12.2/ /usr/local/cuda/ )后再按以下的命令指定了编译器(gcc和g++用的devtoolset-7的),我编译成功了,供参考 CMAKE_ARGS="-DGGML_CUBLAS=ON -DCUDA_ARCHITECTURES=75 -DCMAKE_CUDA_ARCHITECTURES=75 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.2/bin/nvcc -DCMAKE_C_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++" pip install -U chatglm-cpp`

这个方法有用,谢谢

xiewuzhiying avatar Dec 06 '23 01:12 xiewuzhiying

如果是在windows下报错,可以命令行执行cmake -h查看 CMAKE默认生成器,如果需要安装相应的生成器,我这边使用的是Visual Studio 17 2022,所以在Visual Studio Installer安装C++的桌面开发环境就可以了

dial2lee avatar Jan 26 '24 05:01 dial2lee

@li-plus 我也遇到了相同的问题,这里说的方式我都尝试了,还是没法在服务器上pip install -U chatglm-cpp;本地mac不报错; 请抽空解决一下

You-Know-Who-Z avatar Feb 21 '24 10:02 You-Know-Who-Z

@li-plus 我也遇到了相同的问题,这里说的方式我都尝试了,还是没法在服务器上pip install -U chatglm-cpp;本地mac不报错; 请抽空解决一下

我手动的 pip install whl 解决了这个问题 contOS7.9 https://github.com/li-plus/chatglm.cpp/releases

You-Know-Who-Z avatar Feb 22 '24 08:02 You-Know-Who-Z

Can someone please update the Python package? Also cross-reference to https://github.com/li-plus/chatglm.cpp/issues/287

BradKML avatar May 06 '24 06:05 BradKML

Same error. CentOS Linux release 7.9.2009 (Core) Kernel: Linux 3.10.0-1160.el7.x86_64 Python 3.10.4 pip 21.3.1

# pip3 install . 
Processing /data/lp/ChatGLM.cpp/chatglm.cpp
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
  Building wheel for UNKNOWN (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp6vqtvjg4
       cwd: /data/lp/ChatGLM.cpp/chatglm.cpp
  Complete output (111 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/chatglm_cpp
  copying chatglm_cpp/__init__.py -> build/lib.linux-x86_64-3.6/chatglm_cpp
  copying chatglm_cpp/convert.py -> build/lib.linux-x86_64-3.6/chatglm_cpp
  copying chatglm_cpp/langchain_api.py -> build/lib.linux-x86_64-3.6/chatglm_cpp
  copying chatglm_cpp/openai_api.py -> build/lib.linux-x86_64-3.6/chatglm_cpp
  running build_ext
  -- The CXX compiler identification is GNU 9.3.1
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /opt/rh/devtoolset-9/root/usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Deprecation Warning at third_party/ggml/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
  
    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.
  
  
  -- The C compiler identification is GNU 9.3.1
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /opt/rh/devtoolset-9/root/usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- CMAKE_SYSTEM_PROCESSOR: x86_64
  -- x86 detected
  -- Linux detected
  CMake Deprecation Warning at third_party/sentencepiece/CMakeLists.txt:15 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
  
    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.
  
  
  -- VERSION: 0.2.00
  -- pybind11 v2.11.1
  CMake Warning (dev) at third_party/pybind11/tools/FindPythonLibsNew.cmake:98 (find_package):
    Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
    are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
    the cmake_policy command to set the policy and suppress this warning.
  
  Call Stack (most recent call first):
    third_party/pybind11/tools/pybind11Tools.cmake:50 (find_package)
    third_party/pybind11/tools/pybind11Common.cmake:188 (include)
    third_party/pybind11/CMakeLists.txt:210 (include)
  This warning is for project developers.  Use -Wno-dev to suppress it.
  
  -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.8", minimum required is "3.6")
  -- Found PythonLibs: /usr/lib64/libpython3.6m.so
  -- Performing Test HAS_FLTO
  -- Performing Test HAS_FLTO - Success
  -- Configuring done (1.4s)
  -- Generating done (0.1s)
  -- Build files have been written to: /data/lp/ChatGLM.cpp/chatglm.cpp
  Error: could not load cache
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 262, in build_wheel
      metadata_directory)
    File "/tmp/pip-build-env-7_wce6ts/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 231, in build_wheel
      wheel_directory, config_settings)
    File "/tmp/pip-build-env-7_wce6ts/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-7_wce6ts/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 132, in <module>
      cmdclass={"build_ext": CMakeBuild},
    File "/tmp/pip-build-env-7_wce6ts/overlay/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-7_wce6ts/normal/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-7_wce6ts/overlay/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
      _build_ext.run(self)
    File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "setup.py", line 122, in build_extension
      subprocess.run(["cmake", "--build", ".", *build_args], cwd=build_temp, check=True)
    File "/usr/lib64/python3.6/subprocess.py", line 438, in run
      output=stdout, stderr=stderr)
  subprocess.CalledProcessError: Command '['cmake', '--build', '.', '-j']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for UNKNOWN
Failed to build UNKNOWN
ERROR: Could not build wheels for UNKNOWN, which is required to install pyproject.toml-based projects
# 

ppbit-lp avatar May 30 '24 10:05 ppbit-lp