From b06f6a6911cd15bf4c2db09d49b5ee9485c4da2a Mon Sep 17 00:00:00 2001 From: Martin Boos Date: Tue, 5 Mar 2019 16:48:03 +0100 Subject: [PATCH] use LLVM linker (#2713) * use LLVM linker * error message improved in case of filenotfound * linting error fixed --- python/tvm/contrib/cc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python/tvm/contrib/cc.py b/python/tvm/contrib/cc.py index 0ffa6c420243..ee84da820902 100644 --- a/python/tvm/contrib/cc.py +++ b/python/tvm/contrib/cc.py @@ -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: @@ -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)