Skip to content

Commit a5b0596

Browse files
committed
Fix aocc detect
1 parent 854c511 commit a5b0596

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

script/get-aocc/customize.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,13 @@ def preprocess(i):
2020

2121
exe_c = 'clang.exe' if os_info['platform'] == 'windows' else 'clang'
2222

23-
if env.get('MLC_AOCC_DIR_PATH', '') != '' and env.get(
24-
'MLC_AOCC_BIN_WITH_PATH', '') == '':
25-
for f in os.listdir(env['MLC_AOCC_DIR_PATH']):
26-
if os.path.exists(os.path.join(
27-
env['MLC_AOCC_DIR_PATH'], f, "bin", exe_c)):
28-
env['MLC_AOCC_BIN_WITH_PATH'] = os.path.join(
29-
env['MLC_AOCC_DIR_PATH'], f, "bin", exe_c)
30-
31-
if env.get('MLC_HOST_OS_FLAVOR', '') == 'rhel':
32-
if "12" in env.get('MLC_VERSION', '') or "12" in env.get(
33-
'MLC_VERSION_MIN', ''):
34-
if env.get('MLC_TMP_PATH', '') == '':
35-
env['MLC_TMP_PATH'] = ''
36-
env['MLC_TMP_PATH'] += "/opt/rh/aocc/root/usr/bin"
37-
env['MLC_TMP_PATH_IGNORE_NON_EXISTANT'] = 'yes'
3823

3924
if 'MLC_AOCC_BIN_WITH_PATH' not in env:
25+
if env.get('MLC_AOCC_DIR_PATH', '') != '':
26+
aocc_path = env['MLC_AOCC_DIR_PATH']
27+
if os.path.exists(os.path.join(aocc_path, 'bin', 'clang')):
28+
env['MLC_TMP_PATH'] = os.path.join(aocc_path, 'bin')
29+
4030
r = i['automation'].find_artifact({'file_name': exe_c,
4131
'env': env,
4232
'os_info': os_info,

script/get-aocc/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ deps:
2020

2121
input_mapping:
2222
tar_file_path: MLC_AOCC_TAR_FILE_PATH
23+
aocc_dir: MLC_AOCC_DIR_PATH
2324

2425
name: Detect or install AOCC compiler
2526
new_env_keys:

0 commit comments

Comments
 (0)