awtk踩坑记录一:awtk-web build.py编译过程笔记

PS: awtk-web已于2024.11.6大幅更新,不再使用build.py, 此文的方法作废。

工作需求,接触了awtk, 要求把界面部署到web上,期间因为各种编译问题卡的半死,提了不少issue, 经过几天补课,把项目的编译结构给摸了一遍,做个记录,也希望能帮到有同样问题的朋友。

之前python只是略接触过,第一次见过正规项目用python编译,还尝试自己调试追踪过程,感觉也成长了不少。

测试方法:vscode下用python插件F5 debug, debug方式选择command line arguments
放编译build.py的方法以方便CV:

./emsdk_env
cd ../awtk-web
python build.py D:\AWStudioProjects\Workspace\AwtkApplication3\build.json all

build.py入口:

def run(app_root, config, action):
    prepare_app_target_dir(config)
    prepare_export_funcs(app_root, config)

    if action == 'all':
        build_app_assets(app_root, config)
        build_awtk_js(app_root, config, ' -g4 -gsource-map ')
        build_awtk_web_js(config)
...

注:官方的build_win32.sh经测试在windows平台上无法使用,powershell不识别emsdk_env.sh, 还好emscripten有对应的ps1文件,执行emsdk_env实际上就是执行对应的emsdk_env.ps1文件

1.build_app_assets:生成webroot映像,加载项目资源

  • 从目标的build.json【本例目标名AwtkApplication3, python变量名config】中指定的路径copy资源到awtk-web的对应的design目录,project.json, data/app.html和data/index.html,。
  • 调用update_res.py更新资源res目录

build.json

{
  "name": "AwtkApplication3",
  "version": "1.0",
  "assets": "res/assets",
  "author": "AWTK Develop Team",
  "copyright": "Guangzhou ZHIYUAN Electronics Co.,Ltd.",
  "themes":["default"],
  "web": {
    "app_type": "c",
    "assets": "design",
    "sources": [
      "src/*.c",
      "src/*/*.c"
    ],
    "config": {
      "fontScale": "0.8",
      "defaultFont": "sans"
    }
  }
}

build.py

#src_app_root='D:\\AWStudioProjects\\Workspace\\AwtkApplication3'
#config是目标项目的build.json对象
def build_app_assets(src_app_root, config):
    #生成对应项目在awtk-web/webroot的对应映像,并复制项目design文件夹到映像目录下
    copy_assets(src_app_root, config)   
    #复制对应项目project.json到对应映像目录下
    copy_project_json(src_app_root, config) 
    #复制awtk-web的html模版app.html及index.html到对应映像
    copy_data_file(config, 'app.html')      
    copy_data_file(config, 'index.html')
    #更新对应映像的assets:为目标映像生成script文件夹和res文件夹以及assets_web.js
    update_assets(config)       
    #构建对应的romfs文件系统(如果有),一般不需要
    build_romfs(app_root, config);
#src = 'scripts'
#dst = 'D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\scripts'
def prepare_update_res(config):
    src = 'scripts'
    dst = join_path(config_get_app_target_dir(config), 'scripts')

    copy_folder(src, dst)
 
#return: 'D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3'
def config_get_app_target_dir(config):
    return join_path(WEB_ROOT, config['name'])
        
def update_assets(config):
	#复制awtk-web的scripts文件夹到目标项目的webroot映像下
    prepare_update_res(config)
    #获取目标项目的webroot映像目录
    config_get_app_target_dir(config)
        
""" 
	运行update.res.py更新资源,相当于
    cd D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3
    本地系统python ./scripts/update_res.py res 
    本地系统python ./scripts/update_res.py json 
    本地系统python ./scripts/update_res.py web    
    cd D:\\Devtools\\awtk-web
"""
        
    cwd = os.getcwd()
    app_target_dir = config_get_app_target_dir(config)
    os.chdir(app_target_dir)
    os.system('\"'+sys.executable+'\"' + ' scripts/update_res.py res')
    # 此步生成映像的assets_web.js
    os.system('\"'+sys.executable+'\"' + ' scripts/update_res.py json')
    os.system('\"'+sys.executable+'\"' + ' scripts/update_res.py web')
    os.chdir(cwd)

2.build_awtk_js:为映像生成awtk.js,awtk_asm.js,awtk_asm.wasm

步骤一:将AWTK_SRC_DIR下所有c库文件(awtk.getWebFiles()获取), awtk-web目录下符合正则src/c/*.c的所有文件(web_files), gen/c/awtk_wrap.c(如果目标项目是由js构成),以及项目build.json的sources属性指定的所有c/cpp源文件,加入文件列表all_files,并用emscripten自带的emcc编译, 输出awtk.js和awtk_asm.js。

def build_awtk_js(src_app_root, config, flags):
    app_target_dir = config_get_app_target_dir(config)
    app_files = []
	
    #如果目标项目是js类型,将awtk-web的gen/c/awtk_wrap.c加入
    if(is_js_app(config)):
        app_files.append(join_path('./', 'gen/c/awtk_wrap.c'))
	
    #提取目标项目的所有c源文件加入到app_files列表供编译
    #源文件路径取自目标项目build.json的sources列表
    sources = config['sources']
    for f in sources:
        if f.endswith('.c') or f.endswith('.cpp'):
            app_files = app_files + glob.glob(f)
	
    #提取awtk-web的所有c源文件加入web_files列表供编译
    web_files = glob.glob('src/c/*.c')
    
    #awtk.getWebFiles()获取awtk目标下所有库文件依赖,包括tkc,base,widget等库
    #将所有编译文件加入列表
    files = awtk.getWebFiles() + web_files + app_files

    all_files = []
    for f in files:
        all_files.append(os.path.normpath(os.path.abspath(f)))
	
    # 将目标项目的res加入编译器的include选项
    # includes_path = -ID:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\res
    includes_path = ' -I' + join_path(app_target_dir, 'res') + ' '

    if 'includes' in config:
        includes_files = config['includes']
        for f in includes_files:
            includes_path += ('-I ' + f + " ")
	
    # 生成编译flag
    COMMON_FLAGS = ' ' + flags + ' '
    
    if 'cflags' in config:
        COMMON_FLAGS = COMMON_FLAGS + ' ' + ' '.join(config['cflags'])
    if 'cxxflags' in config:
        COMMON_FLAGS = COMMON_FLAGS + ' ' + ' '.join(config['cxxflags'])

    COMMON_FLAGS = COMMON_FLAGS + ' -DSAFE_HEAP=1 -DASSERTIONS=1 -DSTACK_OVERFLOW_CHECK=1 '
    COMMON_FLAGS = COMMON_FLAGS + \
        ' -s EXPORTED_RUNTIME_METHODS=@configs/export_runtime_funcs.json '
    COMMON_FLAGS = COMMON_FLAGS + '-s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2'

	# 如果目标项目是js类型将附加的编译选项
    if(is_js_app(config)):
        COMMON_FLAGS = COMMON_FLAGS + ' -DAWTK_WEB_JS '
        COMMON_FLAGS = COMMON_FLAGS + ' -s RESERVED_FUNCTION_POINTERS=1000 '

    COMMON_FLAGS = COMMON_FLAGS + ' -s EXPORTED_FUNCTIONS=@gen/export_all_funcs.json'

    COMMON_FLAGS = COMMON_FLAGS + ' -DWITH_DATA_READER_WRITER '
    COMMON_FLAGS = COMMON_FLAGS + ' -DHAS_STD_MALLOC -DNDEBUG -DAWTK_WEB -Isrc/c '
    COMMON_FLAGS = COMMON_FLAGS + ' -DWITH_WINDOW_ANIMATORS -DWITH_NANOVG_GPU '
   # COMMON_FLAGS = '  -g4 -gsource-map   -DSAFE_HEAP=1 -DASSERTIONS=1 -DSTACK_OVERFLOW_CHECK=1  -s EXPORTED_RUNTIME_METHODS=@configs/export_runtime_funcs.json -s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2 -s EXPORTED_FUNCTIONS=@gen/export_all_funcs.json -DWITH_DATA_READER_WRITER  -DHAS_STD_MALLOC -DNDEBUG -DAWTK_WEB -Isrc/c  -DWITH_WINDOW_ANIMATORS -DWITH_NANOVG_GPU '

#输出对应的js文件
#output=D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\js\\awtk.js
    output = join_path(config_get_js_dir(config), "awtk.js")
    CPPFLAGS_JS = ' -o ' + output + ' -s WASM=0 ' + COMMON_FLAGS + includes_path
    awtk.runArgsInFile('emcc -v ', CPPFLAGS_JS, all_files)
#output=D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\js\\awtk_asm.js
    output = join_path(config_get_js_dir(config), "awtk_asm.js")
    CPPFLAGS_ASM = ' -o ' + output + COMMON_FLAGS + includes_path
    awtk.runArgsInFile('emcc -v ', CPPFLAGS_ASM, all_files)

运行 awtk.runArgsInFile之后系统将输出一大堆文件编译,总共三百多个文件,耐心等待,日志看着一大坨很乱:

 -o D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\js\\awtk.js -s WASM=0   
 -g4 -gsource-map   
 -DSAFE_HEAP=1 -DASSERTIONS=1 
 -DSTACK_OVERFLOW_CHECK=1  
 -s EXPORTED_RUNTIME_METHODS=@configs/export_runtime_funcs.json 
 -s ALLOW_MEMORY_GROWTH=1 
 -s USE_SDL=2 -s EXPORTED_FUNCTIONS=@gen/export_all_funcs.json 
 -DWITH_DATA_READER_WRITER  
 -DHAS_STD_MALLOC 
 -DNDEBUG 
 -DAWTK_WEB 
 -Isrc/c  
 -DWITH_WINDOW_ANIMATORS 
 -DWITH_NANOVG_GPU  
 -ID:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\res  
 -ID:\\Devtools\\awtk/3rd 
 -ID:\\Devtools\\awtk 
 -ID:\\Devtools\\awtk\\src 
 -ID:\\Devtools\\awtk\\src/ext_widgets D:\\Devtools\\awtk\\src\\tkc\\action_darray_thread.c D:\\Devtools\\awtk\\src\\tkc\\action_queue.c D:\\Devtools\\awtk\\src\\tkc\\action_thread.c 
 ...
 (省略awtk库的一堆c文件)
emcc: warning: please replace -g4 with -gsource-map [-Wdeprecated]
"D:/Devtools/emsdk/upstream/bin\clang.exe" -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=D:\Devtools\emsdk\upstream\emscripten\cache\sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -isystem D:\Devtools\emsdk\upstream\emscripten\cache\sysroot\include\SDL2 -Xclang -iwithsysroot/include\compat -v -g3 -g -DSAFE_HEAP=1 -DASSERTIONS=1 -DSTACK_OVERFLOW_CHECK=1 -DWITH_DATA_READER_WRITER -DHAS_STD_MALLOC -DNDEBUG -DAWTK_WEB -Isrc/c -DWITH_WINDOW_ANIMATORS -DWITH_NANOVG_GPU -ID:\Devtools\awtk-web\webroot\AwtkApplication3\res -ID:\Devtools\awtk/3rd -ID:\Devtools\awtk -ID:\Devtools\awtk\src -ID:\Devtools\awtk\src/ext_widgets D:\Devtools\awtk\src\tkc\action_darray_thread.c -c -o C:\Users\nihaoa\AppData\Local\Temp\emscripten_temp_256cz5b6\action_darray_thread_0.o
clang version 19.0.0git (https:/github.com/llvm/llvm-project 6c7805d5d186a6d1263f90b8033ad85e2d2633d7)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: D:\Devtools\emsdk\upstream\bin
 (in-process)
 "D:\\Devtools\\emsdk\\upstream\\bin\\clang.exe" -cc1 -triple wasm32-unknown-emscripten -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name action_darray_thread.c -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb "-fdebug-compilation-dir=D:\\Devtools\\awtk-web" -v "-fcoverage-compilation-dir=D:\\Devtools\\awtk-web" -resource-dir "D:\\Devtools\\emsdk\\upstream\\lib\\clang\\19" -isystem "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot\\include\\SDL2" -D EMSCRIPTEN -D SAFE_HEAP=1 -D ASSERTIONS=1 -D STACK_OVERFLOW_CHECK=1 -D WITH_DATA_READER_WRITER -D HAS_STD_MALLOC -D NDEBUG -D AWTK_WEB -I src/c -D WITH_WINDOW_ANIMATORS -D WITH_NANOVG_GPU -I "D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\res" -I "D:\\Devtools\\awtk/3rd" -I "D:\\Devtools\\awtk" -I "D:\\Devtools\\awtk\\src" -I "D:\\Devtools\\awtk\\src/ext_widgets" -isysroot "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot" -internal-isystem "D:\\Devtools\\emsdk\\upstream\\lib\\clang\\19\\include" -internal-isystem "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot/include/wasm32-emscripten" -internal-isystem "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot/include" -Werror=implicit-function-declaration -ferror-limit 19 -fmessage-length=230 -fvisibility=default -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fignore-exceptions -fcolor-diagnostics "-iwithsysroot/include\\compat" -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -o "C:\\Users\\nihaoa\\AppData\\Local\\Temp\\emscripten_temp_256cz5b6\\action_darray_thread_0.o" -x c "D:\\Devtools\\awtk\\src\\tkc\\action_darray_thread.c"
clang -cc1 version 19.0.0git based upon LLVM 19.0.0git default target x86_64-pc-windows-msvc
ignoring nonexistent directory "D:\Devtools\emsdk\upstream\emscripten\cache\sysroot/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
 src/c
 D:\Devtools\awtk-web\webroot\AwtkApplication3\res
 D:\Devtools\awtk/3rd
 D:\Devtools\awtk
 D:\Devtools\awtk\src
 D:\Devtools\awtk\src/ext_widgets
 D:\Devtools\emsdk\upstream\emscripten\cache\sysroot\include\SDL2
 D:\Devtools\emsdk\upstream\emscripten\cache\sysroot/include\compat
 D:\Devtools\emsdk\upstream\lib\clang\19\include
 D:\Devtools\emsdk\upstream\emscripten\cache\sysroot/include
End of search list.
。。。(省略后面三百多个文件的编译)
 "D:/Devtools/emsdk/upstream/bin\clang.exe" -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=D:\Devtools\emsdk\upstream\emscripten\cache\sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -isystem D:\Devtools\emsdk\upstream\emscripten\cache\sysroot\include\SDL2 -Xclang -iwithsysroot/include\compat -v -g3 -g -DSAFE_HEAP=1 -DASSERTIONS=1 -DSTACK_OVERFLOW_CHECK=1 -DWITH_DATA_READER_WRITER -DHAS_STD_MALLOC -DNDEBUG -DAWTK_WEB -Isrc/c -DWITH_WINDOW_ANIMATORS -DWITH_NANOVG_GPU -ID:\Devtools\awtk-web\webroot\AwtkApplication3\res -ID:\Devtools\awtk/3rd -ID:\Devtools\awtk -ID:\Devtools\awtk\src -ID:\Devtools\awtk\src/ext_widgets D:\AWStudioProjects\Workspace\AwtkApplication3\src\main.c -c -o C:\Users\nihaoa\AppData\Local\Temp\emscripten_temp_vom058uh\main_313.o
clang version 19.0.0git (https:/github.com/llvm/llvm-project 6c7805d5d186a6d1263f90b8033ad85e2d2633d7)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: D:\Devtools\emsdk\upstream\bin
 (in-process)
 "D:\\Devtools\\emsdk\\upstream\\bin\\clang.exe" -cc1 -triple wasm32-unknown-emscripten -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.c -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb "-fdebug-compilation-dir=D:\\Devtools\\awtk-web" -v "-fcoverage-compilation-dir=D:\\Devtools\\awtk-web" -resource-dir "D:\\Devtools\\emsdk\\upstream\\lib\\clang\\19" -isystem "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot\\include\\SDL2" -D EMSCRIPTEN -D SAFE_HEAP=1 -D ASSERTIONS=1 -D STACK_OVERFLOW_CHECK=1 -D WITH_DATA_READER_WRITER -D HAS_STD_MALLOC -D NDEBUG -D AWTK_WEB -I src/c -D WITH_WINDOW_ANIMATORS -D WITH_NANOVG_GPU -I "D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\res" -I "D:\\Devtools\\awtk/3rd" -I "D:\\Devtools\\awtk" -I "D:\\Devtools\\awtk\\src" -I "D:\\Devtools\\awtk\\src/ext_widgets" -isysroot "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot" -internal-isystem "D:\\Devtools\\emsdk\\upstream\\lib\\clang\\19\\include" -internal-isystem "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot/include/wasm32-emscripten" -internal-isystem "D:\\Devtools\\emsdk\\upstream\\emscripten\\cache\\sysroot/include" -Werror=implicit-function-declaration -ferror-limit 19 -fmessage-length=230 -fvisibility=default -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fignore-exceptions -fcolor-diagnostics "-iwithsysroot/include\\compat" -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -o "C:\\Users\\nihaoa\\AppData\\Local\\Temp\\emscripten_temp_vom058uh\\main_313.o" -x c "D:\\AWStudioProjects\\Workspace\\AwtkApplication3\\src\\main.c"
clang -cc1 version 19.0.0git based upon LLVM 19.0.0git default target x86_64-pc-windows-msvc
ignoring nonexistent directory "D:\Devtools\emsdk\upstream\emscripten\cache\sysroot/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
 src/c
 D:\Devtools\awtk-web\webroot\AwtkApplication3\res
 D:\Devtools\awtk/3rd
 D:\Devtools\awtk
 D:\Devtools\awtk\src
 D:\Devtools\awtk\src/ext_widgets
 D:\Devtools\emsdk\upstream\emscripten\cache\sysroot\include\SDL2
 D:\Devtools\emsdk\upstream\emscripten\cache\sysroot/include\compat
 D:\Devtools\emsdk\upstream\lib\clang\19\include
 D:\Devtools\emsdk\upstream\emscripten\cache\sysroot/include
End of search list.
"D:/Devtools/emsdk/upstream/bin\clang.exe" --version
"D:/Devtools/emsdk/upstream/bin\wasm-ld.exe" @C:\Users\nihaoa\AppData\Local\Temp\emscripten_e9gcm659.rsp.utf-8
"D:\Devtools\emsdk\python\3.9.2-nuget_64bit\python.exe" -E D:\Devtools\emsdk\upstream\emscripten\tools\wasm-sourcemap.py D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm --dwarfdump=D:/Devtools/emsdk/upstream/bin\llvm-dwarfdump.exe -o D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm.map --basepath=D:\Devtools\awtk-web\webroot\AwtkApplication3\js
 "D:/Devtools/emsdk/upstream/bin\llvm-objcopy.exe" D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm --remove-section=.debug* --remove-section=producers
 "D:/Devtools/emsdk/upstream\bin\wasm-emscripten-finalize" -g --dyncalls-i64 --pass-arg=legalize-js-interface-exported-helpers --dwarf --output-source-map-url=awtk_asm.wasm.map D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm -o D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm --detect-features --input-source-map=D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm.map --output-source-map=D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm.map
emcc: warning: `main` is defined in the input files, but `_main` is not in `EXPORTED_FUNCTIONS`. Add it to this list if you want `main` to run. [-Wunused-main]
 "D:/Devtools/emsdk/node/16.20.0_64bit/bin/node.exe" D:\Devtools\emsdk\upstream\emscripten\src\compiler.mjs C:\Users\nihaoa\AppData\Local\Temp\tmpwpa968vp.json

awtk.runArgsInFile源代码:

def getIncludes():
    return '-I' + AWTK_ROOT_DIR + '/3rd ' + '-I' + AWTK_ROOT_DIR + ' -I' + AWTK_SRC_DIR +' -I' + AWTK_SRC_DIR +'/ext_widgets';


def writeArgs(filename, str):
    with open(filename, "w") as text_file:
        text_file.write(str);
	
def runArgsInFile(cmd, flags, files):
    cmd_args = flags + ' ' + getIncludes() + ' ' + ' '.join(files) 
    cmd_args = cmd_args.replace('\\', '\\\\');
    writeArgs("args.txt", cmd_args);
    print(cmd_args)
    os.system(cmd + ' @args.txt');

该步完成后会发现映像项目有一个js目录,多了3个文件:

PS D:\Devtools\awtk-web\webroot\AwtkApplication3\js> ls

目录: D:\Devtools\awtk-web\webroot\AwtkApplication3\js

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/5/28     17:05          82504 awtk_asm.js
-a----         2024/5/28     17:05        2226706 awtk_asm.wasm
-a----         2024/5/28     17:05         684260 awtk_asm.wasm.map

是以下指令生成的:

"D:/Devtools/emsdk/upstream/bin\wasm-ld.exe" 		@C:\Users\nihaoa\AppData\Local\Temp\emscripten_e9gcm659.rsp.utf-8

"D:\Devtools\emsdk\python\3.9.2-nuget_64bit\python.exe" 
-E 
	D:\Devtools\emsdk\upstream\emscripten\tools\wasm-sourcemap.py 
	D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm 
	--dwarfdump=D:/Devtools/emsdk/upstream/bin\llvm-dwarfdump.exe 
-o 
	D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm.map 
--basepath=D:\Devtools\awtk-web\webroot\AwtkApplication3\js

"D:/Devtools/emsdk/upstream/bin\llvm-objcopy.exe" 
D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm 
D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm 
--remove-section=.debug* 
--remove-section=producers

 "D:/Devtools/emsdk/upstream\bin\wasm-emscripten-finalize" 
 -g 
 	--dyncalls-i64 --pass-arg=legalize-js-interface-exported-helpers --dwarf --output-source-map-url=awtk_asm.wasm.map 
 	D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm
 -o 
 	D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm 
 	--detect-features --input-source-map=D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm.map 
 	--output-source-map=D:\Devtools\awtk-web\webroot\AwtkApplication3\js\awtk_asm.wasm.map
 	
emcc: warning: `main` is defined in the input files, but `_main` is not in `EXPORTED_FUNCTIONS`. Add it to this list if you want `main` to run. [-Wunused-main]
 "D:/Devtools/emsdk/node/16.20.0_64bit/bin/node.exe" D:\Devtools\emsdk\upstream\emscripten\src\compiler.mjs C:\Users\nihaoa\AppData\Local\Temp\tmpwpa968vp.json

3.build_awtk_web_js:为映像构建app.js和awtk_web.js

def build_awtk_web_js(config):
    # 生成目标项目webroot的app.js[本质是把原项目的源js文件所有内容暴力整合到一个js文件下]
    build_app_js(config)
    
    """
    app_target_dir= 'D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3'
    assets_js= 'D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\assets_web.js'
    outfile = 'D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\js\\awtk_web.js'
    """
    app_target_dir = config_get_app_target_dir(config)
    assets_js = join_path(app_target_dir, 'assets_web.js')
    outfile = join_path(config_get_js_dir(config), 'awtk_web.js')
   
	# 在awtk-web目录下生成app_config.js文件,与assets_web.js和下列js文件用于构建awtk_web.js
    gen_app_config(config, 'gen/app_config.js')
    awtk_web_js_files = [assets_js,
                         'src/js/browser.js',
                         'gen/app_config.js',
                         'src/js/webgl2d.js',
                         'src/js/image_cache.js',
                         'src/js/assets_manager.js',
                         'src/js/image_loader.js',
                         'src/js/input_method_web.js',
                         'src/js/utils.js',
                         'src/js/edit_element.js',
                         'src/js/vgcanvas_web.js',
                         'src/js/awtk_wrap.js',
                         'src/js/key_event.js',
                         'src/js/events_source.js',
                         'src/js/main_loop_web.js']
    merge_files(awtk_web_js_files, outfile)
def merge_files(srcs, dst):
    print(dst)
    with open(dst, 'w') as outfile:
        for fname in srcs:
            print(fname)
            with open(fname, encoding='utf-8-sig') as infile:
                outfile.write(infile.read())
                outfile.write("\n")

def need_awtk_api_js(config):
    return is_js_app(config) and not is_reactjs(config)

#将目标项目build.json下source选项指定的js文件合成一个新的app.js文件,放到webroot对应映像下
def build_app_js(config):
    app_files = []
    sources = config['sources']
    #output='D:\\Devtools\\awtk-web\\webroot\\AwtkApplication3\\js\\app.js'
    output = join_path(config_get_js_dir(config), 'app.js')
    #对于js类型项目须加入两个js文件
    if(need_awtk_api_js(config)):
        app_files.append('api/awtk_api_browser_prefix.js')
        app_files.append('api/awtk_api.js')
    #如果目标项目下有js文件,加入app_files列表
    for f in sources:
        if f.endswith('.js'):
            app_files = app_files + glob.glob(join_path(app_root, f))
    #app_files下所有js文件内容合并到app.js
    merge_files(app_files, output)
    print(app_files, output)
    

该步完成后映像项目下js目录将多出app.js和awtk_web.js两个文件:

PS D:\Devtools\awtk-web\webroot\AwtkApplication3\js> ls


    目录: D:\Devtools\awtk-web\webroot\AwtkApplication3\js


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/5/28     17:11              0 app.js
-a----         2024/5/28     17:05          82504 awtk_asm.js
-a----         2024/5/28     17:05        2226706 awtk_asm.wasm
-a----         2024/5/28     17:05         684260 awtk_asm.wasm.map
-a----         2024/5/28     17:11         140526 awtk_web.js

自此编译过程结束。

上面的例子是awtk c项目,如果是js项目,编译列表会略有变化,具体自己实验。

sudo apt install --fix-missing ros-galactic-usb-cam Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: ffmpeg ros-galactic-image-transport-plugins ros-galactic-theora-image-transport Suggested packages: ffmpeg-doc The following NEW packages will be installed: ffmpeg ros-galactic-image-transport-plugins ros-galactic-theora-image-transport ros-galactic-usb-cam 0 upgraded, 4 newly installed, 0 to remove and 150 not upgraded. Need to get 1,754 kB of archives. After this operation, 3,864 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 ffmpeg amd64 7:4.2.7-0ubuntu0.1 [1,453 kB] Err:2 http://packages.ros.org/ros2/ubuntu focal/main amd64 ros-galactic-theora-image-transport amd64 2.3.3-1focal.20220430.143745 404 Not Found [IP: 64.50.233.100 80] Err:3 http://packages.ros.org/ros2/ubuntu focal/main amd64 ros-galactic-image-transport-plugins amd64 2.3.3-1focal.20220430.172112 404 Not Found [IP: 64.50.233.100 80] Err:4 http://packages.ros.org/ros2/ubuntu focal/main amd64 ros-galactic-usb-cam amd64 0.4.2-1focal.20220430.172301 404 Not Found [IP: 64.50.233.100 80] Fetched 1,453 kB in 1s (1,062 kB/s) Unable to correct missing packages. E: Failed to fetch http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-galactic-theora-image-transport/ros-galactic-theora-image-transport_2.3.3-1focal.20220430.143745_amd64.deb 404 Not Found [IP: 64.50.233.100 80] E: Failed to fetch http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-galactic-image-transport-plugins/ros-galactic-image-transport-plugins_2.3.3-1focal.20220430.172112_amd64.deb 404 Not Found [IP: 64.50.233.100 80] E: Failed to fetch http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-galactic-usb-cam/ros-galactic-usb-cam_0.4.2-1focal.20220430.172301_amd64.deb 404 Not Found [IP: 64.50.233.100 80] E: Aborting install.
最新发布
07-11
AWTK开发手册-AWTK开发实践指南-中文手册.pdf AWTK = Toolkit AnyWhere 随着手机、智能手表等便携式设备的普及,用户对 GUI 的要求越来越高,嵌入式系统对高性能、高可靠性、低功耗、美观炫酷的 GUI 的需求也越来越迫切,ZLG开源 GUI 引擎 AWTK 应运而生。AWTK 全称为 Toolkit AnyWhere,是 ZLG 倾心打造的套基于 C 语言开发的 GUI 框架。旨在为用户提供个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎,并支持跨平台同步开发,次编程,终生使用。 最终目标: 支持开发嵌入式软件。 支持开发Linux应用程序。 支持开发MacOS应用程序。 支持开发Windows应用程序。 支持开发Android应用程序。 支持开发iOS应用程序。 支持开发2D游戏。 其主要特色有: 小巧。在精简配置下,不依赖第三方软件包,仅需要32K RAM + 256K FLASH即可开发些简单的图形应用程序。 高效。采用脏矩形裁剪算法,每次只绘制和更新变化的部分,极大提高运行效率和能源利用率。 稳定。通过良好的架构设计和编程风格、单元测试、动态(valgrind)检查和Code Review保证其运行的稳定性。 丰富的GUI组件。提供窗口、对话框和各种常用的组件(用户可以配置自己需要的组件,降低对运行环境的要求)。 支持多种字体格式。内置位图字体(并提供转换工具),也可以使用stb_truetype或freetype加载ttf字体。 支持多种图片格式。内置位图图片(并提供转换工具),也可以使用stb_image加载png/jpg等格式的图片。 紧凑的二进制界面描述格式。可以手工编辑的XML格式的界面描述文件,也可以使用Qt Designer设计界面,然后转换成紧凑的二进制界面描述格式,提高运行效率,减小内存开销。 支持主题并采用紧凑的二进制格式。开发时使用XML格式描述主题,然后转换成紧凑的二进制格式,提高运行效率,减小内存开销。 支持裸系统,无需OS和文件系统。字体、图片、主题和界面描述数据都编译到代码中,以常量数据的形式存放,运行时无需加载到内存。 内置nanovg实现高质量的矢量动画,并支持SVG矢量图。 支持窗口动画、控件动画、滑动动画和高清LCD等现代GUI常见特性。 支持国际化(Unicode、字符串翻译和输入法等)。 可移植。支持移植到各种RTOS和嵌入式Linux系统,并通过SDL在各种流行的PC/手机系统上运行。 脚本化。从API注释中提取API的描述信息,通过这些信息可以自动生成各种脚本的绑定代码。 支持硬件2D加速(目前支持STM32的DMA2D和NXP的PXP)和GPU加速(OpenGL/OpenGLES/DirectX/Metal),充分挖掘硬件潜能。 丰富的文档和示例代码。 采用LGPL协议开源发布,在商业软件中使用时无需付费。 目前核心功能已经完成,内部开始在实际项目中使用了,欢迎有兴趣的朋友评估和尝试,期待您的反馈。
/content Mounted at /content/drive env: PYTHONDONTWRITEBYTECODE=1 env: TF_CPP_MIN_LOG_LEVEL=1 41 packages can be upgraded. Run 'apt list --upgradable' to see them. W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?) --2025-07-10 10:19:00-- https://github.com/camenduru/gperftools/releases/download/v1.0/libtcmalloc_minimal.so.4 Resolving github.com (github.com)... 140.82.113.4 Connecting to github.com (github.com)|140.82.113.4|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/669786276/620e2e64-be9f-4599-904f-18ee3811e159?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250710%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250710T101901Z&X-Amz-Expires=1800&X-Amz-Signature=b5c26ca3d158bb5b88d2b09125b067e065003244102eeb42a1d86a5fc1b6c62e&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dlibtcmalloc_minimal.so.4&response-content-type=application%2Foctet-stream [following] --2025-07-10 10:19:01-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/669786276/620e2e64-be9f-4599-904f-18ee3811e159?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250710%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250710T101901Z&X-Amz-Expires=1800&X-Amz-Signature=b5c26ca3d158bb5b88d2b09125b067e065003244102eeb42a1d86a5fc1b6c62e&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dlibtcmalloc_minimal.so.4&response-content-type=application%2Foctet-stream Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ... Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 373960 (365K) [application/octet-stream] Saving to: ‘/content/libtcmalloc_minimal.so.4’ /content/libtcmallo 100%[===================>] 365.20K --.-KB/s in 0.02s 2025-07-10 10:19:01 (15.2 MB/s) - ‘/content/libtcmalloc_minimal.so.4’ saved [373960/373960] env: LD_PRELOAD=/content/libtcmalloc_minimal.so.4 libcairo2-dev is already the newest version (1.16.0-5ubuntu2). python3-dev is already the newest version (3.10.6-1~22.04.1). python3-dev set to manually installed. The following packages were automatically installed and are no longer required: libbz2-dev libpkgconf3 libreadline-dev Use 'apt autoremove' to remove them. The following packages will be REMOVED: pkgconf r-base-dev The following NEW packages will be installed: aria2 libaria2-0 libc-ares2 pkg-config 0 upgraded, 4 newly installed, 2 to remove and 41 not upgraded. Need to get 1,561 kB of archives. After this operation, 5,430 kB of additional disk space will be used. (Reading database ... 126281 files and directories currently installed.) Removing r-base-dev (4.5.1-1.2204.0) ... dpkg: pkgconf: dependency problems, but removing anyway as you requested: libsndfile1-dev:amd64 depends on pkg-config; however: Package pkg-config is not installed. Package pkgconf which provides pkg-config is to be removed. libopencv-dev depends on pkg-config; however: Package pkg-config is not installed. Package pkgconf which provides pkg-config is to be removed. libmkl-dev:amd64 depends on pkg-config; however: Package pkg-config is not installed. Package pkgconf which provides pkg-config is to be removed. libjack-dev depends on pkg-config; however: Package pkg-config is not installed. Package pkgconf which provides pkg-config is to be removed. libgphoto2-dev:amd64 depends on pkg-config; however: Package pkg-config is not installed. Package pkgconf which provides pkg-config is to be removed. libglib2.0-dev:amd64 depends on pkg-config; however: Package pkg-config is not installed. Package pkgconf which provides pkg-config is to be removed. libfontconfig-dev:amd64 depends on pkg-config; however: Package pkg-config is not installed. Package pkgconf which provides pkg-config is to be removed. Removing pkgconf (1.8.0-1) ... Removing 'diversion of /usr/bin/pkg-config to /usr/bin/pkg-config.real by pkgconf' Removing 'diversion of /usr/share/aclocal/pkg.m4 to /usr/share/aclocal/pkg.real.m4 by pkgconf' Removing 'diversion of /usr/share/man/man1/pkg-config.1.gz to /usr/share/man/man1/pkg-config.real.1.gz by pkgconf' Removing 'diversion of /usr/share/pkg-config-crosswrapper to /usr/share/pkg-config-crosswrapper.real by pkgconf' Selecting previously unselected package pkg-config. (Reading database ... 126257 files and directories currently installed.) Preparing to unpack .../pkg-config_0.29.2-1ubuntu3_amd64.deb ... Unpacking pkg-config (0.29.2-1ubuntu3) ... Selecting previously unselected package libc-ares2:amd64. Preparing to unpack .../libc-ares2_1.18.1-1ubuntu0.22.04.3_amd64.deb ... Unpacking libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ... Selecting previously unselected package libaria2-0:amd64. Preparing to unpack .../libaria2-0_1.36.0-1_amd64.deb ... Unpacking libaria2-0:amd64 (1.36.0-1) ... Selecting previously unselected package aria2. Preparing to unpack .../aria2_1.36.0-1_amd64.deb ... Unpacking aria2 (1.36.0-1) ... Setting up libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ... Setting up pkg-config (0.29.2-1ubuntu3) ... Setting up libaria2-0:amd64 (1.36.0-1) ... Setting up aria2 (1.36.0-1) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for libc-bin (2.35-0ubuntu3.8) ... /sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero_v2.so.0 is not a symbolic link /sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link The following packages were automatically installed and are no longer required: libbz2-dev libpkgconf3 libreadline-dev Use 'apt autoremove' to remove them. The following NEW packages will be installed: unionfs-fuse 0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded. Need to get 48.7 kB of archives. After this operation, 146 kB of additional disk space will be used. Selecting previously unselected package unionfs-fuse. (Reading database ... 126346 files and directories currently installed.) Preparing to unpack .../unionfs-fuse_1.0-1ubuntu2_amd64.deb ... Unpacking unionfs-fuse (1.0-1ubuntu2) ... Setting up unionfs-fuse (1.0-1ubuntu2) ... Processing triggers for man-db (2.10.2-1) ... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 GB 444.7 kB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.1/6.1 MB 89.3 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 76.9 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 16.6 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.6/4.6 MB 78.7 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.3/63.3 MB 11.3 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.4/96.4 kB 3.0 MB/s eta 0:00:00 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. torchtune 0.6.1 requires torchdata==0.11.0, but you have torchdata 0.6.0 which is incompatible. ERROR: Could not find a version that satisfies the requirement xformers==0.0.19 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.16rc424, 0.0.16rc425, 0.0.16, 0.0.20, 0.0.21, 0.0.22, 0.0.22.post7, 0.0.23, 0.0.23.post1, 0.0.24, 0.0.25, 0.0.25.post1, 0.0.26.post1, 0.0.27, 0.0.27.post1, 0.0.27.post2, 0.0.28, 0.0.28.post1, 0.0.28.post2, 0.0.28.post3, 0.0.29, 0.0.29.post1, 0.0.29.post2, 0.0.29.post3, 0.0.30, 0.0.31, 0.0.31.post1, 0.0.32.dev1062, 0.0.32.dev1064) ERROR: No matching distribution found for xformers==0.0.19 Failed to open /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/models/lora/: No such file or directory. Aborting! /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui Updating files: 100% (203/203), done. HEAD is now at 22bcc7be attempted fix for infinite loading for settings that some people experience Updating files: 100% (135/135), done. HEAD is now at cf1d67a Update modelcard.md HEAD is now at c202932 GRADIO_TUNNEL online Already up to date. Download Results: gid |stat|avg speed |path/URI ======+====+===========+======================================================= 20d2be|OK | 0B/s|/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/models/CLIP/ViT-L-14.pt Status Legend: (OK):download completed. Python 3.11.13 (main, Jun 4 2025, 08:57:29) [GCC 11.4.0] Commit hash: 22bcc7be428c94e9408f589966c2040187245d81 Installing gfpgan Installing clip Installing open_clip Installing xformers Traceback (most recent call last): File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/launch.py", line 355, in <module> prepare_environment() File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/launch.py", line 281, in prepare_environment run_pip(f"install {xformers_package}", "xformers") File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/launch.py", line 129, in run_pip return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/launch.py", line 97, in run raise RuntimeError(message) RuntimeError: Couldn't install xformers. Command: "/usr/bin/python3" -m pip install xformers==0.0.16rc425 --prefer-binary Error code: 1 stdout: Collecting xformers==0.0.16rc425 Downloading xformers-0.0.16rc425.tar.gz (7.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.3/7.3 MB 81.4 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: torch>=1.12 in /usr/local/lib/python3.11/dist-packages (from xformers==0.0.16rc425) (2.0.0+cu118) Requirement already satisfied: numpy in /usr/local/lib/python3.11/dist-packages (from xformers==0.0.16rc425) (2.0.2) Collecting pyre-extensions==0.0.23 (from xformers==0.0.16rc425) Downloading pyre_extensions-0.0.23-py3-none-any.whl.metadata (4.0 kB) Collecting typing-inspect (from pyre-extensions==0.0.23->xformers==0.0.16rc425) Downloading typing_inspect-0.9.0-py3-none-any.whl.metadata (1.5 kB) Requirement already satisfied: typing-extensions in /usr/local/lib/python3.11/dist-packages (from pyre-extensions==0.0.23->xformers==0.0.16rc425) (4.14.1) Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from torch>=1.12->xformers==0.0.16rc425) (3.18.0) Requirement already satisfied: sympy in /usr/local/lib/python3.11/dist-packages (from torch>=1.12->xformers==0.0.16rc425) (1.13.1) Requirement already satisfied: networkx in /usr/local/lib/python3.11/dist-packages (from torch>=1.12->xformers==0.0.16rc425) (3.5) Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/dist-packages (from torch>=1.12->xformers==0.0.16rc425) (3.1.6) Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.11/dist-packages (from torch>=1.12->xformers==0.0.16rc425) (2.0.0) Requirement already satisfied: cmake in /usr/local/lib/python3.11/dist-packages (from triton==2.0.0->torch>=1.12->xformers==0.0.16rc425) (3.31.6) Requirement already satisfied: lit in /usr/local/lib/python3.11/dist-packages (from triton==2.0.0->torch>=1.12->xformers==0.0.16rc425) (18.1.8) Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2->torch>=1.12->xformers==0.0.16rc425) (3.0.2) Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from sympy->torch>=1.12->xformers==0.0.16rc425) (1.3.0) Collecting mypy-extensions>=0.3.0 (from typing-inspect->pyre-extensions==0.0.23->xformers==0.0.16rc425) Downloading mypy_extensions-1.1.0-py3-none-any.whl.metadata (1.1 kB) Downloading pyre_extensions-0.0.23-py3-none-any.whl (11 kB) Downloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB) Downloading mypy_extensions-1.1.0-py3-none-any.whl (5.0 kB) Building wheels for collected packages: xformers Building wheel for xformers (setup.py): started Building wheel for xformers (setup.py): finished with status 'error' Running setup.py clean for xformers Failed to build xformers stderr: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for xformers ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (xformers)
07-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值