From a327902ab46345f8d6c7c5d61d120218c8d3c6c9 Mon Sep 17 00:00:00 2001 From: Arjun Date: Sat, 10 May 2025 19:58:41 +0530 Subject: [PATCH 1/5] Improvements for gcc install from src --- .../customize.py | 7 +--- script/get-generic-sys-util/meta.yaml | 14 ++++++++ script/get-git-repo/meta.yaml | 2 +- script/install-gcc-src/customize.py | 9 ----- script/install-gcc-src/meta.yaml | 35 +++++++++++++++++-- script/install-gcc-src/run.sh | 15 ++++---- 6 files changed, 58 insertions(+), 24 deletions(-) diff --git a/script/get-dataset-cognata-mlcommons/customize.py b/script/get-dataset-cognata-mlcommons/customize.py index 1a070e0ab..be725599d 100644 --- a/script/get-dataset-cognata-mlcommons/customize.py +++ b/script/get-dataset-cognata-mlcommons/customize.py @@ -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() @@ -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( diff --git a/script/get-generic-sys-util/meta.yaml b/script/get-generic-sys-util/meta.yaml index 8f75171de..5f366d775 100644 --- a/script/get-generic-sys-util/meta.yaml +++ b/script/get-generic-sys-util/meta.yaml @@ -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 diff --git a/script/get-git-repo/meta.yaml b/script/get-git-repo/meta.yaml index 962b9281f..efdf3bf63 100644 --- a/script/get-git-repo/meta.yaml +++ b/script/get-git-repo/meta.yaml @@ -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 diff --git a/script/install-gcc-src/customize.py b/script/install-gcc-src/customize.py index dba1f0d56..eff37dfe6 100644 --- a/script/install-gcc-src/customize.py +++ b/script/install-gcc-src/customize.py @@ -17,15 +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') diff --git a/script/install-gcc-src/meta.yaml b/script/install-gcc-src/meta.yaml index c463860ed..587d2c9e3 100644 --- a/script/install-gcc-src/meta.yaml +++ b/script/install-gcc-src/meta.yaml @@ -3,9 +3,26 @@ automation_alias: script automation_uid: 5b4e0237da074764 cache: true category: Compiler automation -default_version: '12' deps: - tags: detect,os +- 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: @@ -19,7 +36,21 @@ tags: - gcc - src-gcc uid: faae0ebd6e1242db -versions: +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: + - '#' diff --git a/script/install-gcc-src/run.sh b/script/install-gcc-src/run.sh index c3631255d..c8b1ca291 100644 --- a/script/install-gcc-src/run.sh +++ b/script/install-gcc-src/run.sh @@ -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 @@ -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} From 03fc70b0450e0f173f9480d8394b41a17f5583eb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 10 May 2025 14:29:41 +0000 Subject: [PATCH 2/5] [Automated Commit] Format Codebase [skip ci] --- script/install-gcc-src/customize.py | 1 - 1 file changed, 1 deletion(-) diff --git a/script/install-gcc-src/customize.py b/script/install-gcc-src/customize.py index eff37dfe6..7edf5103b 100644 --- a/script/install-gcc-src/customize.py +++ b/script/install-gcc-src/customize.py @@ -17,7 +17,6 @@ def preprocess(i): recursion_spaces = i['recursion_spaces'] - env['MLC_GCC_INSTALLED_PATH'] = os.path.join(os.getcwd(), 'install', 'bin') return {'return': 0} From 3149bc6356f69305128fbdd26dfe2d35a3574f32 Mon Sep 17 00:00:00 2001 From: Arjun Date: Sat, 10 May 2025 22:04:40 +0530 Subject: [PATCH 3/5] Added detect-cpu deps for install-gcc-src --- script/install-gcc-src/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/script/install-gcc-src/meta.yaml b/script/install-gcc-src/meta.yaml index 587d2c9e3..c1e06fa47 100644 --- a/script/install-gcc-src/meta.yaml +++ b/script/install-gcc-src/meta.yaml @@ -5,6 +5,7 @@ cache: true category: Compiler automation 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 From 1ad5f338351f84e49bd82fa9dfccc658f94edea5 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sun, 11 May 2025 00:48:52 +0100 Subject: [PATCH 4/5] Update meta.yaml --- script/install-gcc-src/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/install-gcc-src/meta.yaml b/script/install-gcc-src/meta.yaml index c1e06fa47..605490669 100644 --- a/script/install-gcc-src/meta.yaml +++ b/script/install-gcc-src/meta.yaml @@ -37,6 +37,8 @@ tags: - gcc - src-gcc uid: faae0ebd6e1242db +tests: +- {} variations: master: group: version From 1a8737e57b2484d44478dce9d87b9d900ad893a6 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sun, 11 May 2025 00:50:34 +0100 Subject: [PATCH 5/5] Update meta.yaml --- script/install-gcc-src/meta.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/install-gcc-src/meta.yaml b/script/install-gcc-src/meta.yaml index 605490669..741ab39b6 100644 --- a/script/install-gcc-src/meta.yaml +++ b/script/install-gcc-src/meta.yaml @@ -38,7 +38,8 @@ tags: - src-gcc uid: faae0ebd6e1242db tests: -- {} + run_inputs: + - {} variations: master: group: version