Skip to content

Commit

Permalink
Support g++-12 for rhel
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Mar 4, 2024
1 parent eb3d502 commit f8a9fef
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions cm-mlops/script/get-gcc/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"+CM_HOST_OS_DEFAULT_INCLUDE_PATH",
"+PATH"
],
"deps": [
{
"tags": "detect,os"
}
],
"post_deps": [
{
"tags": "get,compiler-flags"
Expand Down
9 changes: 8 additions & 1 deletion cm-mlops/script/get-gcc/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ def preprocess(i):
env = i['env']

recursion_spaces = i['recursion_spaces']

file_name_c = 'gcc.exe' if os_info['platform'] == 'windows' else 'gcc'

if env.get('CM_HOST_OS_FLAVOR', '') == 'rhel':
if "12" in env.get('CM_VERSION', '') or "12" in env.get('CM_VERSION_MIN', ''):
if env.get('CM_TMP_PATH', '') == '':
env['CM_TMP_PATH'] = ''
env['CM_TMP_PATH'] += "/opt/rh/gcc-toolset-12/root/usr/bin"
env['CM_TMP_PATH_IGNORE_NON_EXISTANT'] = 'yes'

if 'CM_GCC_BIN_WITH_PATH' not in env:
r = i['automation'].find_artifact({'file_name': file_name_c,
'env': env,
Expand Down
4 changes: 3 additions & 1 deletion cm-mlops/script/get-generic-sys-util/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"CM_SUDO": "sudo"
},
"new_env_keys": [
"+PATH"
],
"tags": [
"get",
Expand Down Expand Up @@ -296,7 +297,8 @@
},
"state": {
"g++12": {
"apt": "g++-12"
"apt": "g++-12",
"dnf": "gcc-toolset-12-gcc-c++"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions cm-mlops/script/get-generic-sys-util/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ def preprocess(i):
env['CM_SYS_UTIL_INSTALL_CMD'] = sudo + ' ' +install_cmd + ' ' + package_name


if env.get('CM_HOST_OS_FLAVOR', '') == 'rhel':
if env['CM_SYS_UTIL_NAME'] == "g++12":
env['+PATH'] = "/opt/rh/gcc-toolset-12/root/usr/bin"
return {'return':0}
2 changes: 1 addition & 1 deletion cm-mlops/script/install-llvm-src/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
},
{
"tags": "get,gcc",
"version_min": "12.3"
"version_min": "12.1"
},
{
"tags": "get,conda,_name.gptj-pt",
Expand Down

0 comments on commit f8a9fef

Please sign in to comment.