Skip to content

Commit

Permalink
use LLVM linker (apache#2713)
Browse files Browse the repository at this point in the history
* use LLVM linker

* error message improved in case of filenotfound

* linting error fixed
  • Loading branch information
mnboos authored and wweic committed Mar 12, 2019
1 parent 35bcb73 commit b5eb1de
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions python/tvm/contrib/cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def _windows_shared(output, objects, options):
cl_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(out, _) = proc.communicate()
except FileNotFoundError:
raise RuntimeError("can not found cl.exe,"
raise RuntimeError("Can not find cl.exe,"
"please run this in Vistual Studio Command Prompt.")
if proc.returncode != 0:
msg = "Compilation error:\n"
msg += py_str(out)
raise RuntimeError(msg)
link_cmd = ["link"]
link_cmd = ["lld-link"]
link_cmd += ["-dll", "-FORCE:MULTIPLE"]

for obj in objects:
Expand All @@ -111,8 +111,11 @@ def _windows_shared(output, objects, options):
link_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(out, _) = proc.communicate()
except FileNotFoundError:
raise RuntimeError("can not found link.exe,"
"please run this in Vistual Studio Command Prompt.")
raise RuntimeError("Can not find the LLVM linker for Windows (lld-link.exe)."
"Make sure it's installed"
" and the installation directory is in the %PATH% environment "
"variable. Prebuilt binaries can be found at: https://llvm.org/"
"For building the linker on your own see: https://lld.llvm.org/#build")
if proc.returncode != 0:
msg = "Compilation error:\n"
msg += py_str(out)
Expand Down

0 comments on commit b5eb1de

Please sign in to comment.