Committed by
GitHub
Use a single static lib file for onnxruntime on Windows (#404)
正在显示
6 个修改的文件
包含
19 行增加
和
84 行删除
| @@ -15,18 +15,18 @@ if(BUILD_SHARED_LIBS) | @@ -15,18 +15,18 @@ if(BUILD_SHARED_LIBS) | ||
| 15 | message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") | 15 | message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") |
| 16 | endif() | 16 | endif() |
| 17 | 17 | ||
| 18 | -set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.16.0/onnxruntime-win-x64-static-1.16.0.tar.bz2") | ||
| 19 | -set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x64-static-1.16.0.tar.bz2") | ||
| 20 | -set(onnxruntime_HASH "SHA256=d1b87e8a438a7e31b46bf13a194c5ac38fdf60ebeefef82692008e42e3242776") | 18 | +set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.16.0/onnxruntime-win-x64-static_lib-1.16.0.tar.bz2") |
| 19 | +set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x64-static_lib-1.16.0.tar.bz2") | ||
| 20 | +set(onnxruntime_HASH "SHA256=7b28a694178d075e6836d618613e2a0fd0046ccd9fd66bbf6a46d22e96db33b8") | ||
| 21 | 21 | ||
| 22 | # If you don't have access to the Internet, | 22 | # If you don't have access to the Internet, |
| 23 | # please download onnxruntime to one of the following locations. | 23 | # please download onnxruntime to one of the following locations. |
| 24 | # You can add more if you want. | 24 | # You can add more if you want. |
| 25 | set(possible_file_locations | 25 | set(possible_file_locations |
| 26 | - $ENV{HOME}/Downloads/onnxruntime-win-x64-static-1.16.0.tar.bz2 | ||
| 27 | - ${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-static-1.16.0.tar.bz2 | ||
| 28 | - ${PROJECT_BINARY_DIR}/onnxruntime-win-x64-static-1.16.0.tar.bz2 | ||
| 29 | - /tmp/onnxruntime-win-x64-static-1.16.0.tar.bz2 | 26 | + $ENV{HOME}/Downloads/onnxruntime-win-x64-static_lib-1.16.0.tar.bz2 |
| 27 | + ${PROJECT_SOURCE_DIR}/onnxruntime-win-x64-static_lib-1.16.0.tar.bz2 | ||
| 28 | + ${PROJECT_BINARY_DIR}/onnxruntime-win-x64-static_lib-1.16.0.tar.bz2 | ||
| 29 | + /tmp/onnxruntime-win-x64-static_lib-1.16.0.tar.bz2 | ||
| 30 | ) | 30 | ) |
| 31 | 31 | ||
| 32 | foreach(f IN LISTS possible_file_locations) | 32 | foreach(f IN LISTS possible_file_locations) |
| @@ -57,6 +57,7 @@ message(STATUS "onnxruntime is downloaded to ${onnxruntime_SOURCE_DIR}") | @@ -57,6 +57,7 @@ message(STATUS "onnxruntime is downloaded to ${onnxruntime_SOURCE_DIR}") | ||
| 57 | include_directories(${onnxruntime_SOURCE_DIR}/include) | 57 | include_directories(${onnxruntime_SOURCE_DIR}/include) |
| 58 | 58 | ||
| 59 | file(GLOB onnxruntime_lib_files "${onnxruntime_SOURCE_DIR}/lib/*.lib") | 59 | file(GLOB onnxruntime_lib_files "${onnxruntime_SOURCE_DIR}/lib/*.lib") |
| 60 | + | ||
| 60 | set(onnxruntime_lib_files ${onnxruntime_lib_files} PARENT_SCOPE) | 61 | set(onnxruntime_lib_files ${onnxruntime_lib_files} PARENT_SCOPE) |
| 61 | 62 | ||
| 62 | message(STATUS "onnxruntime lib files: ${onnxruntime_lib_files}") | 63 | message(STATUS "onnxruntime lib files: ${onnxruntime_lib_files}") |
| @@ -15,18 +15,18 @@ if(BUILD_SHARED_LIBS) | @@ -15,18 +15,18 @@ if(BUILD_SHARED_LIBS) | ||
| 15 | message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") | 15 | message(FATAL_ERROR "This file is for building static libraries. BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") |
| 16 | endif() | 16 | endif() |
| 17 | 17 | ||
| 18 | -set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.16.0/onnxruntime-win-x86-static-1.16.0.tar.bz2") | ||
| 19 | -set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x86-static-1.16.0.tar.bz2") | ||
| 20 | -set(onnxruntime_HASH "SHA256=aedb6b5275f7832ac5117db8e40328a0842ae8ce6749a0c99bcb4218c53fdc60") | 18 | +set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.16.0/onnxruntime-win-x86-static_lib-1.16.0.tar.bz2") |
| 19 | +set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/onnxruntime-libs/resolve/main/onnxruntime-win-x86-static_lib-1.16.0.tar.bz2") | ||
| 20 | +set(onnxruntime_HASH "SHA256=fe78775b222244bbcb512631719a94336391b645edb23c314201a6991ddecb58") | ||
| 21 | 21 | ||
| 22 | # If you don't have access to the Internet, | 22 | # If you don't have access to the Internet, |
| 23 | # please download onnxruntime to one of the following locations. | 23 | # please download onnxruntime to one of the following locations. |
| 24 | # You can add more if you want. | 24 | # You can add more if you want. |
| 25 | set(possible_file_locations | 25 | set(possible_file_locations |
| 26 | - $ENV{HOME}/Downloads/onnxruntime-win-x86-static-1.16.0.tar.bz2 | ||
| 27 | - ${PROJECT_SOURCE_DIR}/onnxruntime-win-x86-static-1.16.0.tar.bz2 | ||
| 28 | - ${PROJECT_BINARY_DIR}/onnxruntime-win-x86-static-1.16.0.tar.bz2 | ||
| 29 | - /tmp/onnxruntime-win-x86-static-1.16.0.tar.bz2 | 26 | + $ENV{HOME}/Downloads/onnxruntime-win-x86-static_lib-1.16.0.tar.bz2 |
| 27 | + ${PROJECT_SOURCE_DIR}/onnxruntime-win-x86-static_lib-1.16.0.tar.bz2 | ||
| 28 | + ${PROJECT_BINARY_DIR}/onnxruntime-win-x86-static_lib-1.16.0.tar.bz2 | ||
| 29 | + /tmp/onnxruntime-win-x86-static_lib-1.16.0.tar.bz2 | ||
| 30 | ) | 30 | ) |
| 31 | 31 | ||
| 32 | foreach(f IN LISTS possible_file_locations) | 32 | foreach(f IN LISTS possible_file_locations) |
| @@ -13,29 +13,7 @@ | @@ -13,29 +13,7 @@ | ||
| 13 | sherpa-onnx-kaldifst-core.lib; | 13 | sherpa-onnx-kaldifst-core.lib; |
| 14 | sherpa-onnx-fst.lib; | 14 | sherpa-onnx-fst.lib; |
| 15 | kaldi-native-fbank-core.lib; | 15 | kaldi-native-fbank-core.lib; |
| 16 | - absl_base.lib; | ||
| 17 | - absl_city.lib; | ||
| 18 | - absl_hash.lib; | ||
| 19 | - absl_low_level_hash.lib; | ||
| 20 | - absl_raw_hash_set.lib; | ||
| 21 | - absl_raw_logging_internal.lib; | ||
| 22 | - absl_throw_delegate.lib; | ||
| 23 | - clog.lib; | ||
| 24 | - cpuinfo.lib; | ||
| 25 | - flatbuffers.lib; | ||
| 26 | - libprotobuf-lite.lib; | ||
| 27 | - onnx.lib; | ||
| 28 | - onnx_proto.lib; | ||
| 29 | - onnxruntime_common.lib; | ||
| 30 | - onnxruntime_flatbuffers.lib; | ||
| 31 | - onnxruntime_framework.lib; | ||
| 32 | - onnxruntime_graph.lib; | ||
| 33 | - onnxruntime_mlas.lib; | ||
| 34 | - onnxruntime_optimizer.lib; | ||
| 35 | - onnxruntime_providers.lib; | ||
| 36 | - onnxruntime_session.lib; | ||
| 37 | - onnxruntime_util.lib; | ||
| 38 | - re2.lib; | 16 | + onnxruntime.lib; |
| 39 | </SherpaOnnxLibraries> | 17 | </SherpaOnnxLibraries> |
| 40 | </PropertyGroup> | 18 | </PropertyGroup> |
| 41 | <ItemDefinitionGroup> | 19 | <ItemDefinitionGroup> |
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <PlatformToolset>v143</PlatformToolset> | 39 | <PlatformToolset>v143</PlatformToolset> |
| 40 | <WholeProgramOptimization>true</WholeProgramOptimization> | 40 | <WholeProgramOptimization>true</WholeProgramOptimization> |
| 41 | <CharacterSet>Unicode</CharacterSet> | 41 | <CharacterSet>Unicode</CharacterSet> |
| 42 | - <UseOfMfc>Dynamic</UseOfMfc> | 42 | + <UseOfMfc>Static</UseOfMfc> |
| 43 | </PropertyGroup> | 43 | </PropertyGroup> |
| 44 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | 44 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
| 45 | <ConfigurationType>Application</ConfigurationType> | 45 | <ConfigurationType>Application</ConfigurationType> |
| @@ -13,29 +13,7 @@ | @@ -13,29 +13,7 @@ | ||
| 13 | sherpa-onnx-kaldifst-core.lib; | 13 | sherpa-onnx-kaldifst-core.lib; |
| 14 | sherpa-onnx-fst.lib; | 14 | sherpa-onnx-fst.lib; |
| 15 | kaldi-native-fbank-core.lib; | 15 | kaldi-native-fbank-core.lib; |
| 16 | - absl_base.lib; | ||
| 17 | - absl_city.lib; | ||
| 18 | - absl_hash.lib; | ||
| 19 | - absl_low_level_hash.lib; | ||
| 20 | - absl_raw_hash_set.lib; | ||
| 21 | - absl_raw_logging_internal.lib; | ||
| 22 | - absl_throw_delegate.lib; | ||
| 23 | - clog.lib; | ||
| 24 | - cpuinfo.lib; | ||
| 25 | - flatbuffers.lib; | ||
| 26 | - libprotobuf-lite.lib; | ||
| 27 | - onnx.lib; | ||
| 28 | - onnx_proto.lib; | ||
| 29 | - onnxruntime_common.lib; | ||
| 30 | - onnxruntime_flatbuffers.lib; | ||
| 31 | - onnxruntime_framework.lib; | ||
| 32 | - onnxruntime_graph.lib; | ||
| 33 | - onnxruntime_mlas.lib; | ||
| 34 | - onnxruntime_optimizer.lib; | ||
| 35 | - onnxruntime_providers.lib; | ||
| 36 | - onnxruntime_session.lib; | ||
| 37 | - onnxruntime_util.lib; | ||
| 38 | - re2.lib; | 16 | + onnxruntime.lib; |
| 39 | </SherpaOnnxLibraries> | 17 | </SherpaOnnxLibraries> |
| 40 | </PropertyGroup> | 18 | </PropertyGroup> |
| 41 | <ItemDefinitionGroup> | 19 | <ItemDefinitionGroup> |
| @@ -13,29 +13,7 @@ | @@ -13,29 +13,7 @@ | ||
| 13 | sherpa-onnx-kaldifst-core.lib; | 13 | sherpa-onnx-kaldifst-core.lib; |
| 14 | sherpa-onnx-fst.lib; | 14 | sherpa-onnx-fst.lib; |
| 15 | kaldi-native-fbank-core.lib; | 15 | kaldi-native-fbank-core.lib; |
| 16 | - absl_base.lib; | ||
| 17 | - absl_city.lib; | ||
| 18 | - absl_hash.lib; | ||
| 19 | - absl_low_level_hash.lib; | ||
| 20 | - absl_raw_hash_set.lib; | ||
| 21 | - absl_raw_logging_internal.lib; | ||
| 22 | - absl_throw_delegate.lib; | ||
| 23 | - clog.lib; | ||
| 24 | - cpuinfo.lib; | ||
| 25 | - flatbuffers.lib; | ||
| 26 | - libprotobuf-lite.lib; | ||
| 27 | - onnx.lib; | ||
| 28 | - onnx_proto.lib; | ||
| 29 | - onnxruntime_common.lib; | ||
| 30 | - onnxruntime_flatbuffers.lib; | ||
| 31 | - onnxruntime_framework.lib; | ||
| 32 | - onnxruntime_graph.lib; | ||
| 33 | - onnxruntime_mlas.lib; | ||
| 34 | - onnxruntime_optimizer.lib; | ||
| 35 | - onnxruntime_providers.lib; | ||
| 36 | - onnxruntime_session.lib; | ||
| 37 | - onnxruntime_util.lib; | ||
| 38 | - re2.lib; | 16 | + onnxruntime.lib; |
| 39 | </SherpaOnnxLibraries> | 17 | </SherpaOnnxLibraries> |
| 40 | </PropertyGroup> | 18 | </PropertyGroup> |
| 41 | <ItemDefinitionGroup> | 19 | <ItemDefinitionGroup> |
-
请 注册 或 登录 后发表评论