Skip to content

Commit 5e859c6

Browse files
committed
Windows build dependencies updated
Basic support while building Adreno on Windows
1 parent e3665ae commit 5e859c6

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@
3131
[submodule "3rdparty/flashinfer"]
3232
path = 3rdparty/flashinfer
3333
url = https://github.com/flashinfer-ai/flashinfer.git
34+
[submodule "3rdparty/zlib"]
35+
path = 3rdparty/zlib
36+
url = https://github.com/madler/zlib.git

Diff for: 3rdparty/zlib

Submodule zlib added at d476828

Diff for: LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ The Unlicense
242242
-------------
243243

244244
3rdparty/rang
245+
3rdparty/zlib
245246

246247
BSD 3-Clause "New" or "Revised" License
247248
---------------------------------------

Diff for: apps/cpp_rtvm/CMakeLists.txt

+13-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ set(TVM_RUNNER_SOURCES
1313
set(RTVM_LINKER_LIBS "")
1414

1515
if(WIN32)
16-
list(APPEND RTVM_SOURCES ../cpp_rpc/win32_process.cc)
17-
list(APPEND TVM_RUNNER_SOURCES ../cpp_rpc/win32_process.cc)
16+
file(GLOB ZLIB_SRC
17+
"../../3rdparty/zlib/*.c"
18+
)
19+
list(APPEND RTVM_SOURCES ${ZLIB_SRC})
20+
list(APPEND TVM_RUNNER_SOURCES ${ZLIB_SRC})
1821
endif()
1922

2023
# Set output to same directory as the other TVM libs
@@ -55,6 +58,7 @@ target_include_directories(
5558
rtvm
5659
PUBLIC "../../include"
5760
PUBLIC "../../3rdparty/cnpy"
61+
PUBLIC "../../3rdparty/zlib"
5862
PUBLIC DLPACK_PATH
5963
PUBLIC DMLC_PATH
6064
)
@@ -80,9 +84,13 @@ if(USE_ETHOSN)
8084
endif()
8185

8286
if(BUILD_STATIC_RUNTIME)
83-
list(APPEND RTVM_LINKER_LIBS -Wl,--whole-archive tvm_runtime -Wl,--no-whole-archive z)
87+
list(APPEND RTVM_LINKER_LIBS -Wl,--whole-archive tvm_runtime -Wl,--no-whole-archive)
8488
else()
85-
list(APPEND RTVM_LINKER_LIBS tvm_runtime z)
89+
list(APPEND RTVM_LINKER_LIBS tvm_runtime)
90+
endif()
91+
92+
if(NOT WIN32)
93+
list(APPEND RTVM_LINKER_LIBS z)
8694
endif()
8795

8896
target_link_libraries(rtvm ${RTVM_LINKER_LIBS})
@@ -92,6 +100,7 @@ target_include_directories(
92100
tvm_runner_objs
93101
PUBLIC "../../include"
94102
PUBLIC "../../3rdparty/cnpy"
103+
PUBLIC "../../3rdparty/zlib"
95104
PUBLIC DLPACK_PATH
96105
PUBLIC DMLC_PATH
97106
)

Diff for: apps/cpp_rtvm/main.cc

-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
#include "../../src/support/utils.h"
4040
#include "tvm_runner.h"
4141

42-
#if defined(_WIN32)
43-
#include "../cpp_rpc/win32_process.h"
44-
#endif
45-
4642
using namespace std;
4743
using namespace tvm::runtime;
4844
using namespace tvm::support;

Diff for: apps/cpp_rtvm/tvm_runner.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ void TVMRunner::UsePreCompiledPrograms(std::string file_name) {
154154
if (f_get != nullptr && f_set != nullptr) {
155155
std::ifstream ifs(file_name, std::ios::in | std::ios::binary);
156156
if (ifs.fail()) {
157-
auto bytes = String(f_get());
157+
std::string ss = f_get();
158+
auto bytes = tvm::String(ss);
158159
std::ofstream fs(file_name, std::ofstream::binary);
159160
fs.write(bytes.c_str(), bytes.size());
160161
} else {

Diff for: python/tvm/driver/tvmc/config_options.py

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ def get_configs_json_dir() -> str:
5959
candidate_paths.extend(
6060
[os.path.abspath(os.path.join(lib_path, "..")) for lib_path in libinfo.find_lib_path()]
6161
)
62+
candidate_paths.extend(
63+
[
64+
os.path.abspath(os.path.join(lib_path, "../.."))
65+
for lib_path in libinfo.find_lib_path()
66+
]
67+
)
6268
for path in candidate_paths:
6369
configs_path = os.path.join(os.path.dirname(path), "configs")
6470
if os.path.isdir(configs_path):

0 commit comments

Comments
 (0)