adding --extra option and correction pathes to ispc compiler

This commit is contained in:
Ilia Filippov
2013-10-10 15:38:08 +04:00
parent b2cf0209b1
commit 0d9594354a
3 changed files with 60 additions and 30 deletions

View File

@@ -70,7 +70,7 @@ def try_do_LLVM(text, command, from_validation):
error("can't " + text, 1)
print_debug("DONE.\n", from_validation, alloy_build)
def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, from_validation, force, make):
def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, extra, from_validation, force, make):
print_debug("Building LLVM. Version: " + version_LLVM + ". ", from_validation, alloy_build)
if revision != "":
print_debug("Revision: " + revision + ".\n", from_validation, alloy_build)
@@ -121,6 +121,15 @@ def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, from_v
try_do_LLVM("load clang from http://llvm.org/svn/llvm-project/cfe/" + SVN_PATH + " ",
"svn co " + revision + " http://llvm.org/svn/llvm-project/cfe/" + SVN_PATH + " clang",
from_validation)
if extra == True:
os.chdir("./clang/tools")
try_do_LLVM("load extra clang extra tools ",
"svn co " + revision + " http://llvm.org/svn/llvm-project/clang-tools-extra/" + SVN_PATH + " extra",
from_validation)
os.chdir("../../../projects")
try_do_LLVM("load extra clang compiler-rt ",
"svn co " + revision + " http://llvm.org/svn/llvm-project/compiler-rt/" + SVN_PATH + " compiler-rt",
from_validation)
os.chdir("../")
else:
tar = tarball.split(" ")
@@ -286,6 +295,8 @@ def run_special_tests():
i = 5
def validation_run(only, only_targets, reference_branch, number, notify, update, make):
if os.environ["ISPC_HOME"] != os.getcwd():
error("you ISPC_HOME and your current pass are different!\n", 2)
os.chdir(os.environ["ISPC_HOME"])
os.environ["PATH"] = os.environ["ISPC_HOME"] + ":" + os.environ["PATH"]
if options.notify != "":
@@ -387,7 +398,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
gen_archs = ["x86-64"]
need_LLVM = check_LLVM(LLVM)
for i in range(0,len(need_LLVM)):
build_LLVM(need_LLVM[i], "", "", "", False, False, True, False, make)
build_LLVM(need_LLVM[i], "", "", "", False, False, False, True, False, make)
# begin validation run for stabitily
common.remove_if_exists(stability.in_file)
R = [[[],[]],[[],[]],[[],[]],[[],[]]]
@@ -465,7 +476,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
# prepare LLVM 3.3 as newest LLVM
need_LLVM = check_LLVM(["3.3"])
if len(need_LLVM) != 0:
build_LLVM(need_LLVM[i], "", "", "", False, False, True, False, make)
build_LLVM(need_LLVM[i], "", "", "", False, False, False, True, False, make)
# prepare reference point. build both test and reference compilers
try_do_LLVM("apply git", "git branch", True)
temp4 = take_lines("git branch", "all")
@@ -552,7 +563,7 @@ def Main():
try:
if options.build_llvm:
build_LLVM(options.version, options.revision, options.folder, options.tarball,
options.debug, options.selfbuild, False, options.force, make)
options.debug, options.selfbuild, options.extra, False, options.force, make)
if options.validation_run:
validation_run(options.only, options.only_targets, options.branch,
options.number_for_performance, options.notify, options.update, make)
@@ -628,6 +639,8 @@ llvm_group.add_option('--selfbuild', dest='selfbuild',
help='make selfbuild of LLVM and clang', default=False, action="store_true")
llvm_group.add_option('--force', dest='force',
help='rebuild LLVM', default=False, action='store_true')
llvm_group.add_option('--extra', dest='extra',
help='load extra clang tools', default=False, action='store_true')
parser.add_option_group(llvm_group)
# options for activity "validation run"
run_group = OptionGroup(parser, "Options for validation run",

47
perf.py
View File

@@ -299,6 +299,22 @@ def perf(options1, args):
if cpu_percent > 20:
error("CPU Usage is very high.\nClose other applications.\n", 2)
# prepare build.log, perf_temp and perf.log files
global perf_log
if options.in_file:
perf_log = pwd + options.in_file
common.remove_if_exists(perf_log)
else:
perf_log = ""
global build_log
build_log = pwd + os.sep + "logs" + os.sep + "perf_build.log"
common.remove_if_exists(build_log)
if os.path.exists(pwd + os.sep + "logs") == False:
os.makedirs(pwd + os.sep + "logs")
global perf_temp
perf_temp = pwd + "perf_temp"
global ispc_test
global ispc_ref
global ref_compiler
@@ -325,15 +341,21 @@ def perf(options1, args):
ispc_ref = options.ref
if options.ref != "":
options.ref = True
for counter in PATH_dir:
if os.path.exists(counter + os.sep + ispc_test):
if os.environ.get("ISPC_HOME") != None:
if os.path.exists(os.environ["ISPC_HOME"] + os.sep + ispc_test):
ispc_test_exists = True
ispc_test = os.environ["ISPC_HOME"] + os.sep + ispc_test
for counter in PATH_dir:
if ispc_test_exists == False:
if os.path.exists(counter + os.sep + ispc_test):
ispc_test_exists = True
ispc_test = counter + os.sep + ispc_test
if os.path.exists(counter + os.sep + ref_compiler):
ref_compiler_exists = True
if os.path.exists(counter + os.sep + ispc_ref):
ispc_ref_exists = True
if not ispc_test_exists:
error("ISPC compiler not found.\nAdded path to ispc compiler to your PATH variable.\n", 1)
error("ISPC compiler not found.\nAdded path to ispc compiler to your PATH variable or ISPC_HOME variable\n", 1)
if not ref_compiler_exists:
error("C/C++ compiler %s not found.\nAdded path to %s compiler to your PATH variable.\n" % (ref_compiler, ref_compiler), 1)
if options.ref:
@@ -355,26 +377,11 @@ def perf(options1, args):
if f_lines[i][0] != "%":
lines.append(f_lines[i])
length = len(lines)
# prepare build.log, perf_temp and perf.log files
global perf_log
if options.in_file:
perf_log = pwd + options.in_file
common.remove_if_exists(perf_log)
else:
perf_log = ""
global build_log
build_log = pwd + os.sep + "logs" + os.sep + "perf_build.log"
common.remove_if_exists(build_log)
if os.path.exists(pwd + os.sep + "logs") == False:
os.makedirs(pwd + os.sep + "logs")
global perf_temp
perf_temp = pwd + "perf_temp"
# end of preparations
print_debug("Okey go go go!\n\n", s, perf_log)
print_debug("Testing ispc: " + ispc_test + "\n", s, perf_log)
#print compilers versions
common.print_version(ispc_test, ispc_ref, ref_compiler, False, perf_log, is_windows)

View File

@@ -498,16 +498,26 @@ def run_tests(options1, args, print_version):
# use relative path to not depend on host directory, which may possibly
# have white spaces and unicode characters.
global ispc_exe
ispc_exe = ""
if not is_windows:
ispc_exe = "./ispc"
if os.environ.get("ISPC_HOME") != None:
if os.path.exists(os.environ["ISPC_HOME"] + os.sep + "ispc"):
ispc_exe = os.environ["ISPC_HOME"] + os.sep + "ispc"
else:
PATH_dir = string.split(os.getenv("PATH"), os.pathsep)
for counter in PATH_dir:
if os.path.exists(counter + os.sep + "ispc"):
ispc_exe = counter + os.sep + "ispc"
else:
ispc_exe = ".\\Release\\ispc.exe"
if os.path.exists(".\\Release\\ispc.exe"):
ispc_exe = ".\\Release\\ispc.exe"
else:
error("You don't have ispc.exe compiler in .\\Release.\n", 1)
# checks the required ispc compiler otherwise prints an error message
if not os.path.exists(ispc_exe):
error("missing ispc compiler: %s\n" % ispc_exe, 1)
if ispc_exe == "":
error("ISPC compiler not found.\nAdded path to ispc compiler to your PATH variable or ISPC_HOME variable\n", 1)
print_debug("Testing ispc: " + ispc_exe + "\n", s, run_tests_log)
ispc_exe += " " + options.ispc_flags
print_debug("ispc compiler: %s\n" % ispc_exe, s, run_tests_log)
global is_generic_target
is_generic_target = (options.target.find("generic-") != -1 and