Skip to content

Commit aefdde0

Browse files
committed
Fixes oneapi detect
1 parent adec331 commit aefdde0

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

script/get-aocc/customize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def postprocess(i):
7272

7373
found_path = os.path.dirname(found_file_path)
7474

75-
env['MLC_AOCC_INSTALLED_PATH'] = found_path
75+
env['MLC_AOCC_BIN_PATH'] = found_path
76+
env['MLC_AOCC_INSTALLED_PATH'] = os.path.dirname(found_path)
7677

7778
file_name_c = os.path.basename(found_file_path)
7879
file_name_cpp = file_name_c.replace('clang', 'clang++')

script/get-aocc/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ new_env_keys:
3535
- + LDFLAGS
3636
- +MLC_HOST_OS_DEFAULT_INCLUDE_PATH
3737
- +PATH
38-
post_depsq:
38+
post_deps_off:
3939
- tags: get,compiler-flags
4040
sort: 500
4141
tags:

script/get-one-api/customize.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from mlc import utils
22
import os
3+
from utils import *
34

45

56
def preprocess(i):
@@ -9,12 +10,12 @@ def preprocess(i):
910
env = i['env']
1011

1112
recursion_spaces = i['recursion_spaces']
12-
file_name_c = 'oneapi.exe' if os_info['platform'] == 'windows' else 'oneapi-cli'
13+
file_name_c = 'icx.exe' if os_info['platform'] == 'windows' else 'icx'
1314

14-
if 'MLC_ONEAPI_BIN_WITH_PATH' not in env:
15+
if 'MLC_ICX_BIN_WITH_PATH' not in env:
1516
if env.get('MLC_ONEAPI_DIR_PATH', '') != '':
1617
oneapi_path = env['MLC_ONEAPI_DIR_PATH']
17-
if os.path.exists(os.path.join(oneapi_path, 'bin', 'oneapi-cli')):
18+
if os.path.exists(os.path.join(oneapi_path, 'bin', 'icx')):
1819
env['MLC_TMP_PATH'] = os.path.join(oneapi_path, 'bin')
1920

2021
if 'MLC_ONEAPI_BIN_WITH_PATH' not in env:
@@ -23,7 +24,7 @@ def preprocess(i):
2324
'os_info': os_info,
2425
'default_path_env_key': 'PATH',
2526
'detect_version': True,
26-
'env_path_key': 'MLC_ONEAPI_BIN_WITH_PATH',
27+
'env_path_key': 'MLC_ICX_BIN_WITH_PATH',
2728
'run_script_input': i['run_script_input'],
2829
'recursion_spaces': recursion_spaces})
2930
if r['return'] > 0:
@@ -46,8 +47,8 @@ def preprocess(i):
4647

4748

4849
def detect_version(i):
49-
r = i['automation'].parse_version({'match_text': r'^.*$',
50-
'group_number': 0,
50+
r = i['automation'].parse_version({'match_text': r'oneAPI\s+.*\(([\d.]+)\)',
51+
'group_number': 1,
5152
'env_key': 'MLC_ONEAPI_VERSION',
5253
'which_env': i['env']})
5354
if r['return'] > 0:
@@ -70,14 +71,14 @@ def postprocess(i):
7071
env['MLC_COMPILER_FAMILY'] = 'ONEAPI'
7172
version = r['version']
7273
env['MLC_COMPILER_VERSION'] = env['MLC_ONEAPI_VERSION']
73-
env['MLC_GCC_CACHE_TAGS'] = 'version-' + version
74+
env['MLC_ONEAPI_CACHE_TAGS'] = 'version-' + version
7475
env['MLC_COMPILER_CACHE_TAGS'] = 'version-' + version + ',family-oneapi'
7576

76-
found_file_path = env['MLC_ONEAPI_BIN_WITH_PATH']
77+
found_file_path = env['MLC_ICX_BIN_WITH_PATH']
7778

7879
found_path = os.path.dirname(found_file_path)
7980

80-
env['MLC_ONEAPI_INSTALLED_PATH'] = found_path
81+
env['MLC_ONEAPI_INSTALLED_PATH'] = os.path.dirname(found_path)
8182

8283
file_name_c = os.path.basename(found_file_path)
8384

script/get-one-api/meta.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ new_env_keys:
1212
- MLC_ONEAPI_COMPILER_*
1313
- MLC_COMPILER_*
1414
- MLC_LINKER_*
15-
post_deps:
15+
16+
input_mapping:
17+
oneapi_dir: MLC_ONEAPI_DIR_PATH
18+
19+
post_deps_off:
1620
- tags: get,compiler-flags
1721
sort: 500
1822
tags:
@@ -24,4 +28,4 @@ uid: 1af872e81ef54742
2428
variations:
2529
_path.#:
2630
env:
27-
MLC_ONEAPI_DIR_PATH: null
31+
MLC_ONEAPI_DIR_PATH: "#"

script/get-one-api/run.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
2-
oneapi_bin=${MLC_ONEAPI_BIN_WITH_PATH}
3-
echo "${oneapi_bin} version"
2+
icx_bin=${MLC_ICX_BIN_WITH_PATH}
3+
echo "${icx_bin} --version"
44

5-
${oneapi_bin} version > tmp-ver.out
6-
test $? -eq 0 || exit 1
7-
8-
cat tmp-ver.out
5+
${icx_bin} --version > tmp-ver.out
6+
test $? -eq 0 || exit $?

0 commit comments

Comments
 (0)