Commit c6c287bf by Tianqi Chen Committed by GitHub

[SETUP] Always use relpath for setup (#421)

* [SETUP] Always use relpath for setup

* [CMAKE] Fix cmake llvm build
parent 3c9e262f
...@@ -129,7 +129,10 @@ if(USE_LLVM) ...@@ -129,7 +129,10 @@ if(USE_LLVM)
message(STATUS "Build with LLVM support...") message(STATUS "Build with LLVM support...")
include_directories(${LLVM_INCLUDE_DIRS}) include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS}) add_definitions(${LLVM_DEFINITIONS})
add_definitions(-DTVM_LLVM_VERSION=${LLVM_PACKAGE_VERSION}) string(REPLACE "." "" TVM_LLVM_VERSION ${LLVM_PACKAGE_VERSION})
string(SUBSTRING ${TVM_LLVM_VERSION} 0 2 TVM_LLVM_VERSION)
message(STATUS "TVM_LLVM_VERSION=" ${TVM_LLVM_VERSION})
add_definitions(-DTVM_LLVM_VERSION=${TVM_LLVM_VERSION})
llvm_map_components_to_libnames(LLVM_LIBS all) llvm_map_components_to_libnames(LLVM_LIBS all)
list(REMOVE_ITEM LLVM_LIBS LTO) list(REMOVE_ITEM LLVM_LIBS LTO)
list(APPEND TVM_LINKER_LIBS ${LLVM_LIBS}) list(APPEND TVM_LINKER_LIBS ${LLVM_LIBS})
......
...@@ -88,9 +88,11 @@ if "bdist_wheel" in sys.argv: ...@@ -88,9 +88,11 @@ if "bdist_wheel" in sys.argv:
"include_package_data": True "include_package_data": True
} }
else: else:
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
rpath = os.path.relpath(LIB_PATH[0], curr_path)
setup_kwargs = { setup_kwargs = {
"include_package_data": True, "include_package_data": True,
"data_files": [('tvm', [LIB_PATH[0]])] "data_files": [('tvm', [rpath])]
} }
setup(name='tvm', setup(name='tvm',
......
...@@ -1151,7 +1151,7 @@ void CodeGenLLVM::VisitStmt_(const AssertStmt* op) { ...@@ -1151,7 +1151,7 @@ void CodeGenLLVM::VisitStmt_(const AssertStmt* op) {
// TODO(tqchen) move these pattern to a generic scope info visitor. // TODO(tqchen) move these pattern to a generic scope info visitor.
if (const EQ* eq = op->condition.as<EQ>()) { if (const EQ* eq = op->condition.as<EQ>()) {
const Mod* mod = eq->a.as<Mod>(); const Mod* mod = eq->a.as<Mod>();
int64_t factor, offset; int64_t factor = 0, offset = 0;
if (mod && arith::GetConst(eq->b, &offset)) { if (mod && arith::GetConst(eq->b, &offset)) {
const Variable *var = mod->a.as<Variable>(); const Variable *var = mod->a.as<Variable>();
if (var && arith::GetConst(mod->b, &factor)) { if (var && arith::GetConst(mod->b, &factor)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment