Skip to content

Fixes for oneapi #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions script/download-and-extract/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,19 @@ variations:
default: 'true'
env:
MLC_EXTRACT_REMOVE_EXTRACTED: 'no'
adr:
extract-script:
tags:
_keep
group: keep
no-remove-extracted:
remove-extracted:
env:
MLC_EXTRACT_REMOVE_EXTRACTED: 'no'
MLC_EXTRACT_REMOVE_EXTRACTED: 'yes'
group: keep
adr:
extract-script:
tags:
_remove-extracted
rclone:
add_deps:
download-script:
Expand Down
4 changes: 2 additions & 2 deletions script/extract-file/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ variations:
default: true
env:
MLC_EXTRACT_REMOVE_EXTRACTED: 'no'
no-remove-extracted:
remove-extracted:
group: keep
env:
MLC_EXTRACT_REMOVE_EXTRACTED: 'no'
MLC_EXTRACT_REMOVE_EXTRACTED: 'yes'
path.#:
env:
MLC_EXTRACT_FILEPATH: '#'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,30 @@ def preprocess(i):
'run_script_input': i['run_script_input'],
'recursion_spaces': recursion_spaces})
if r['return'] > 0:
# Uncomment when MLC script for installing oneapi compiler is integrated
# Initial finding suggests that oneapi could be installed without
# hastle in linux using apt, but is tricky in windows

# if r['return'] == 16:
# if env.get('MLC_TMP_FAIL_IF_NOT_FOUND','').lower() == 'yes':
# return r
#
# print (recursion_spaces+' # {}'.format(r['error']))
#
# # Attempt to run installer
# r = {'return':0, 'skip':True, 'script':{'tags':'install,gcc,src'}}

return r
r = i['automation'].run_native_script(
{'run_script_input': i['run_script_input'], 'env': env, 'script_name': 'install'})
if r['return'] > 0:
return r
version_prefix = env['MLC_ONEAPI_INSTALL_VERSION_PREFIX']
env['MLC_TMP_PATH'] = os.path.join(
os.getcwd(), "install", version_prefix, "bin")

r = i['automation'].find_artifact({'file_name': file_name_c,
'env': env,
'os_info': os_info,
'default_path_env_key': 'PATH',
'detect_version': True,
'env_path_key': 'MLC_ICX_BIN_WITH_PATH',
'run_script_input': i['run_script_input'],
'recursion_spaces': recursion_spaces})
if r['return'] > 0:
return r

return {'return': 0}


def detect_version(i):
r = i['automation'].parse_version({'match_text': r'oneAPI\s+.*\(([\d.]+)\)',
r = i['automation'].parse_version({'match_text': r'oneAPI\s+.* Compiler\s+([\d+.]+)',
'group_number': 1,
'env_key': 'MLC_ONEAPI_VERSION',
'which_env': i['env']})
Expand Down Expand Up @@ -90,6 +94,16 @@ def postprocess(i):
env['MLC_ONEAPI_COMPILER_WITH_PATH'] = found_file_path
env['MLC_ONEAPI_COMPILER_FLAG_VERSION'] = 'version'

env['MLC_DEPENDENT_CACHED_PATH'] = found_file_path

list_keys = ['+LD_LIBRARY_PATH']
for key in list_keys:
if not env.get(key):
env[key] = []

env['+LD_LIBRARY_PATH'].append(os.path.join(
env['MLC_ONEAPI_INSTALLED_PATH'], "lib"))

# env['MLC_COMPILER_FLAGS_FAST'] = "-O3"
# env['MLC_LINKER_FLAGS_FAST'] = "-O3"
# env['MLC_COMPILER_FLAGS_DEBUG'] = "-O0"
Expand Down
9 changes: 9 additions & 0 deletions script/get-oneapi/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
wget -nc ${MLC_ONEAPI_INSTALL_URL_BASE}/${MLC_ONEAPI_INSTALL_FILENAME}
rm -rf install
mkdir install
cmd="bash ./${MLC_ONEAPI_INSTALL_FILENAME} -a --silent --cli --eula accept --install-dir ${PWD}/install"

echo $cmd
eval $cmd
12 changes: 12 additions & 0 deletions script/get-one-api/meta.yaml → script/get-oneapi/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ automation_uid: 5b4e0237da074764
cache: true
category: Compiler automation
clean_files: []
default_version: 2025.1.1
deps:
- tags: detect,os
name: Detect or install OneAPI compiler
Expand All @@ -12,6 +13,8 @@ new_env_keys:
- MLC_ONEAPI_COMPILER_*
- MLC_COMPILER_*
- MLC_LINKER_*
- +PATH
- +LD_LIBRARY_PATH

input_mapping:
oneapi_dir: MLC_ONEAPI_DIR_PATH
Expand All @@ -25,6 +28,15 @@ tags:
- compiler
- get-oneapi
uid: 1af872e81ef54742

versions:
2025.1.1:
env:
MLC_ONEAPI_INSTALL_URL_BASE: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/6bfca885-4156-491e-849b-1cd7da9cc760
MLC_ONEAPI_INSTALL_FILENAME: intel-oneapi-base-toolkit-2025.1.1.36_offline.sh
MLC_ONEAPI_INSTALL_VERSION_PREFIX: '2025.1'
MLC_VERSION: '2025.1.1'

variations:
path.#:
env:
Expand Down
File renamed without changes.
File renamed without changes.
Loading