Skip to content

Improvements for install-gcc-src #405

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 5 commits into from
May 10, 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
7 changes: 1 addition & 6 deletions script/get-dataset-cognata-mlcommons/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ def preprocess(i):
env['MLC_DATASET_COGNATA_POC_TEXT_MD5_FILE_PATH'] = os.path.join(
i['run_script_input']['path'], 'checksums', 'cognata_poc.txt')

# Check if user requests path not in CM cache
#
# --path (env MLC_TMP_PATH) shows where to store Cognata data set instead of CM cahe
# --import tells CM to import existing Cognata from a given path and skip further download/processing
#
import_path = env.get(
'MLC_DATASET_MLCOMMONS_COGNATA_IMPORT_PATH',
'').strip()
Expand Down Expand Up @@ -75,7 +70,7 @@ def postprocess(i):

if not os.path.isdir(mlc_cache_dataset_path):
return {
'return': 1, 'error': 'Dataset corrupted - CM cache path not found: {}'.format(mlc_cache_dataset_path)}
'return': 1, 'error': 'Dataset corrupted - MLC cache path not found: {}'.format(mlc_cache_dataset_path)}

if env.get('MLC_DATASET_MLCOMMONS_COGNATA_FILE_NAMES', '') == '':
env['MLC_DATASET_MLCOMMONS_COGNATA_PATH'] = os.path.dirname(
Expand Down
14 changes: 14 additions & 0 deletions script/get-generic-sys-util/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ variations:
brew: ''
dnf: dmidecode
yum: dmidecode
flex:
env:
MLC_SYS_UTIL_NAME: flex
MLC_SYS_UTIL_VERSION_CMD: flex --version # tbd: regular expression for version
MLC_TMP_VERSION_DETECT_GROUP_NUMBER: 0
new_env_keys:
- MLC_FLEX_VERSION
state:
flex: # tbd: complete for other flavours of linux
apt: flex
brew: flex
dnf: flex
yum: flex

ffmpeg:
env:
MLC_SYS_UTIL_NAME: ffmpeg
Expand Down
2 changes: 1 addition & 1 deletion script/get-git-repo/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ post_deps:
- pull-git-repo
tags: pull,git,repo
print_env_at_the_end:
MLC_GIT_CHECKOUT_PATH: CM cache path to the Git repo
MLC_GIT_CHECKOUT_PATH: MLC cache path to the Git repo
tags:
- get
- git
Expand Down
10 changes: 0 additions & 10 deletions script/install-gcc-src/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ def preprocess(i):

recursion_spaces = i['recursion_spaces']

need_version = env.get('MLC_VERSION', '')
if need_version == '':
return {'return': 1,
'error': 'internal problem - MLC_VERSION is not defined in env'}

logger.info(f"{recursion_spaces} # Requested version: {need_version}")

if 'MLC_GIT_CHECKOUT' not in env:
env['MLC_GIT_CHECKOUT'] = 'releases/gcc-' + need_version

env['MLC_GCC_INSTALLED_PATH'] = os.path.join(os.getcwd(), 'install', 'bin')

return {'return': 0}
39 changes: 37 additions & 2 deletions script/install-gcc-src/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@ automation_alias: script
automation_uid: 5b4e0237da074764
cache: true
category: Compiler automation
default_version: '12'
deps:
- tags: detect,os
- tags: detect,cpu
- tags: get,generic-sys-util,_flex
- env:
MLC_GIT_CHECKOUT_PATH_ENV_NAME: MLC_GCC_SRC_REPO_PATH
extra_cache_tags: gcc,src,gcc-src,gcc-src-repo
force_env_keys:
- MLC_GIT_*
names:
- gcc-src-repo
tags: get,git,repo
update_tags_from_env_with_prefix:
_branch.:
- MLC_GIT_CHECKOUT
_repo.:
- MLC_GIT_URL
_sha.:
- MLC_GIT_CHECKOUT_SHA
_tag.:
- MLC_GIT_CHECKOUT_TAG
env:
MLC_GIT_URL: git://gcc.gnu.org/git/gcc.git
post_deps:
Expand All @@ -19,7 +37,24 @@ tags:
- gcc
- src-gcc
uid: faae0ebd6e1242db
versions:
tests:
run_inputs:
- {}
variations:
master:
group: version
default: true
env:
MLC_GIT_CHECKOUT: master
version.#:
group: version
env:
MLC_GIT_CHECKOUT: releases/gcc-#
branch.#:
group: version
env:
MLC_GIT_CHECKOUT: '#'
lang.#:
env:
+MLC_GCC_ENABLED_LANGUAGES:
- '#'
15 changes: 9 additions & 6 deletions script/install-gcc-src/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ CUR_DIR=$PWD

echo "******************************************************"

echo ${MLC_GCC_SRC_REPO_PATH}

if [ ! -d "src" ]; then
echo "Cloning GCC from ${MLC_GIT_URL} with branch ${MLC_GIT_CHECKOUT}..."
git clone -b "${MLC_GIT_CHECKOUT}" ${MLC_GIT_URL} src
if [ "${?}" != "0" ]; then exit 1; fi
cp -r ${MLC_GCC_SRC_REPO_PATH} src
test $? -eq 0 || exit $?
fi


mkdir -p install
mkdir -p build

Expand All @@ -22,16 +24,17 @@ cd ../build

../src/configure --prefix="${INSTALL_DIR}" --with-gcc-major-version-only --disable-multilib

if [ "${?}" != "0" ]; then exit 1; fi
test $? -eq 0 || exit $?

echo "******************************************************"
MLC_MAKE_CORES=${MLC_MAKE_CORES:-${MLC_HOST_CPU_TOTAL_CORES}}
MLC_MAKE_CORES=${MLC_MAKE_CORES:-2}

make -j${MLC_MAKE_CORES}
if [ "${?}" != "0" ]; then exit 1; fi
test $? -eq 0 || exit $?

make install
if [ "${?}" != "0" ]; then exit 1; fi
test $? -eq 0 || exit $?

# Clean build directory (too large)
cd ${CUR_DIR}
Expand Down
Loading