Commit 304b4465 authored by penguin_wwy's avatar penguin_wwy Committed by LeiWang1999
Browse files

[Dev] Correcting cxx compiler (#294)

parent 5079e2a5
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # under the License.
"""Util to invoke C/C++ compilers in the system.""" """Util to invoke C/C++ compilers in the system."""
import functools
import os import os
import shutil import shutil
import subprocess import subprocess
...@@ -62,6 +63,7 @@ def get_cc(): ...@@ -62,6 +63,7 @@ def get_cc():
return None return None
@functools.lru_cache(maxsize=None)
def get_cplus_compiler(): def get_cplus_compiler():
"""Return the path to the default C/C++ compiler. """Return the path to the default C/C++ compiler.
......
...@@ -67,10 +67,11 @@ class LibraryGenerator(object): ...@@ -67,10 +67,11 @@ class LibraryGenerator(object):
src.name, src.name,
] ]
elif is_cpu_target(target): elif is_cpu_target(target):
from tilelang.contrib.cc import get_cplus_compiler
src = tempfile.NamedTemporaryFile(mode="w", suffix=".cpp", delete=False) src = tempfile.NamedTemporaryFile(mode="w", suffix=".cpp", delete=False)
libpath = src.name.replace(".cpp", ".so") libpath = src.name.replace(".cpp", ".so")
command = ["g++", "-std=c++17", "-fPIC", "-shared", src.name] command = [get_cplus_compiler(), "-std=c++17", "-fPIC", "-shared", src.name]
with_tl = False with_tl = False
command += [ command += [
"-I" + TILELANG_TEMPLATE_PATH, "-I" + TILELANG_TEMPLATE_PATH,
......
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