python cli_demo.py chatglm
[i 0427 21:22:22.611497 80 compiler.py:955] Jittor(1.3.7.5) src: /data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor
[i 0427 21:22:22.615231 80 compiler.py:956] g++ at /bin/g++(4.8.5)
[i 0427 21:22:22.615350 80 compiler.py:957] cache_path: /data1/app/.cache/jittor/jt1.3.7/g++4.8.5/py3.9.0/Linux-3.10.0-9xbc/IntelRXeonRGolxb6/default
[i 0427 21:22:22.624864 80 __init__.py:411] Found addr2line(2.27) at /bin/addr2line.
g++: error: unrecognized command line option ‘-std=c++14’
Traceback (most recent call last):
File “/data1/app/JittorLLMs/cli_demo.py”, line 8, in
model = models.get_model(args)
File “/data1/app/JittorLLMs/models/init.py”, line 38, in get_model
globals()f"get_{model_name}"
File “/data1/app/JittorLLMs/models/util.py”, line 51, in get_chatglm
new_path.append(download_fromhub(f"jittorhub://{f}“, tdir=“chat-glm”))
File “/data1/app/JittorLLMs/models/util.py”, line 5, in download_fromhub
import jittor as jt
File “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/init.py”, line 18, in
from . import compiler
File “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/compiler.py”, line 1192, in
check_cache_compile()
File “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/compiler.py”, line 884, in check_cache_compile
recompile = compile(cc_path, cc_flags+f” {opt_flags} “, files, jit_utils.cache_path+‘/jit_utils_core’+extension_suffix, True)
File “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/compiler.py”, line 126, in compile
return do_compile(fix_cl_flags(cmd))
File “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/compiler.py”, line 91, in do_compile
run_cmd(cmd)
File “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor_utils/init.py”, line 188, in run_cmd
raise Exception(err_msg)
Exception: Run cmd failed: “/bin/g++” “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/src/utils/cache_compile.cc” “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/src/utils/log.cc” “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/src/utils/tracer.cc” “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/src/utils/jit_utils.cc” “/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/src/utils/str_utils.cc” -Wall -Wno-unknown-pragmas -std=c++14 -fPIC -march=native -fdiagnostics-color=always -lstdc++ -ldl -shared -I”/data1/app/.conda/envs/jittorllms/lib/python3.9/site-packages/jittor/src" -I/data1/app/.conda/envs/jittorllms/include/python3.9 -I/data1/app/.conda/envs/jittorllms/include/python3.9 -O2 -o “/data1/app/.cache/jittor/jt1.3.7/g++4.8.5/py3.9.0/Linux-3.10.0-9xbc/IntelRXeonRGolxb6/default/jit_utils_core.cpython-39-x86_64-linux-gnu.so”
在网上看有人安装devtoolset-7-gcc-c++.x86_64 devtoolset-7-gcc.x86_64可以解决,我安装后还报这个错误。
jittor需要的GCC版本为 5.4 以上。您安装新版本的gcc后,请检查一下系统的gcc版本是不是已经切换到了最新的。除了默认用系统的gcc外,您还可以通过设置环境变量 cc_path 来手动指定 gcc 路径。