-
Notifications
You must be signed in to change notification settings - Fork 9
cleanup-CI-scripts-and-update-modules-to-2025b #46
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
Open
prasad-sawantdesai
wants to merge
8
commits into
iterorganization:develop
Choose a base branch
from
prasad-sawantdesai:cleanup-CI-scripts-and-update-modules-to-2025b
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
895ae92
cleanup ci scripts and update to 2025b
prasad-sawantdesai b94cc04
fixed unbound variable and loading IDStools modu;e
prasad-sawantdesai 883f627
fixed ENVIRONEMNT_NAME: unbound variable
prasad-sawantdesai 98c209e
fix unbound variable issue
prasad-sawantdesai 6007605
exit if variables are not set
prasad-sawantdesai 737da2f
fixed string issue in waves
prasad-sawantdesai 845fe17
formatted with black
prasad-sawantdesai 719170b
added coverage junit xml export
prasad-sawantdesai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,145 +1,41 @@ | ||
| #!/bin/bash | ||
| source /etc/profile.d/modules.sh | ||
| source ./ci-sdcc/utils.sh | ||
| ########################################################################################## | ||
| # Set environment based on toolchain # | ||
| ########################################################################################## | ||
|
|
||
| module use /work/imas/etc/modules/all | ||
|
|
||
| # expand aliases | ||
| shopt -s expand_aliases | ||
|
|
||
| #print hostname | ||
| hostname -f | ||
|
|
||
| IMAS_EXISTS=$(module -r -t list 2>&1 | grep -E "IMAS-Core" | head -n 1) | ||
| if [ -n "$IMAS_EXISTS" ]; then | ||
| echo "> Found already loaded IMAS Module : $IMAS_EXISTS" | ||
| ACCESS_LAYER_VERSION=$(echo "$AL_VERSION" | cut -d '.' -f 1) | ||
| TOOLCHAIN_VERSION=$(echo "$IMAS_EXISTS" | awk -F '-' '{print $(NF-1)"-"$NF}') | ||
| else | ||
| echo "> IMAS Module is not loaded" | ||
| fi | ||
|
|
||
| if [ -n "$1" ] || [ -n "$2" ]; then | ||
| echo "> Compiling with $1 and Access Layer $2 with latest version of installed modules.Previously loaded modules will be purged.." | ||
| module purge | ||
| # If toolchain version is passed then purge all modules | ||
| if [ -n "$1" ]; then | ||
| TOOLCHAIN_VERSION="$1" | ||
| fi | ||
|
|
||
| # Get AL version | ||
| if [ -n "$2" ]; then | ||
| ACCESS_LAYER_VERSION="$2" | ||
| else | ||
| ACCESS_LAYER_VERSION="5" | ||
| fi | ||
| fi | ||
|
|
||
| if [ -z "$TOOLCHAIN_VERSION" ]; then | ||
| echo "> No toolchain found, Setting it to default : intel-2023b" | ||
| TOOLCHAIN_VERSION="intel-2023b" | ||
| fi | ||
|
|
||
| if [ -z "$ACCESS_LAYER_VERSION" ]; then | ||
| ACCESS_LAYER_VERSION="5" | ||
| fi | ||
|
|
||
| if [ -z "$DD_VERSION" ]; then | ||
| DD_VERSION="3" | ||
| else | ||
| DD_VERSION="$3" | ||
| fi | ||
|
|
||
| echo "> Building for $TOOLCHAIN_VERSION and Access Layer $ACCESS_LAYER_VERSION" | ||
|
|
||
| if [[ $TOOLCHAIN_VERSION == *"intel"* ]]; then | ||
| FCOMPILER="ifort" | ||
| fi | ||
| if [[ $TOOLCHAIN_VERSION == *"foss"* ]]; then | ||
| FCOMPILER="gfortran" | ||
| fi | ||
|
|
||
|
|
||
| CORE_MODULE_VERSION=$(getIMASCoreModuleName "$TOOLCHAIN_VERSION" "$ACCESS_LAYER_VERSION" "$DD_VERSION") | ||
| # load IMAS module first | ||
|
|
||
| if [ -z "$IMAS_EXISTS" ]; then | ||
| echo "> IMAS is not loaded.. Loading Module $CORE_MODULE_VERSION" | ||
| module load "$CORE_MODULE_VERSION" | ||
| fi | ||
|
|
||
| GCCcore_VERSION=$(getGCCcoreVersion) | ||
| module purge | ||
|
|
||
| dependencies="./ci-sdcc/dependencies.txt" | ||
|
|
||
| # Check if the file exists | ||
| if [ ! -f "$dependencies" ]; then | ||
| echo "File $dependencies not found." | ||
| return 1 | ||
| fi | ||
|
|
||
| declare -a RUNMODULES=() | ||
| declare -a EBBRUNMODULES=() | ||
|
|
||
| echo "-------------------------------------------------------" | ||
| echo "> dependency modules" | ||
| counter=0 | ||
| while IFS= read -r line || [[ -n $line ]]; do | ||
| line="${line// /}" | ||
| # for empty string continue | ||
| if [[ -z "$line" ]]; then | ||
| counter=$(("$counter" + 1)) | ||
| continue | ||
| fi | ||
| # fix module version | ||
| if [[ $line == *"/"* ]]; then | ||
| echo "using fix module $line" | ||
| RUNMODULES["$counter"]="$line" | ||
| EBBRUNMODULES["$counter"]="('$line', EXTERNAL_MODULE)," | ||
| counter=$(("$counter" + 1)) | ||
| continue | ||
| fi | ||
| # latest module version as it is not given | ||
| # if [[ $line == *"IMAS"* ]]; then | ||
| # echo " IMAS $CORE_MODULE_VERSION" | ||
| # RUNMODULES["$counter"]="$CORE_MODULE_VERSION" | ||
| # EBBRUNMODULES["$counter"]="('$CORE_MODULE_VERSION', EXTERNAL_MODULE)," | ||
| # else | ||
| module_version=$(getModuleName "$line" "$TOOLCHAIN_VERSION" "$GCCcore_VERSION") | ||
| echo " $line $module_version" | ||
| RUNMODULES["$counter"]="$module_version" | ||
| EBBRUNMODULES["$counter"]=$(getModuleNameAndVersion "$module_version") | ||
|
|
||
| # fi | ||
| counter=$(("$counter" + 1)) | ||
| done <"$dependencies" | ||
| echo "-------------------------------------------------------" | ||
|
|
||
| echo "> Details of environment" | ||
| echo " TOOLCHAIN_VERSION : $TOOLCHAIN_VERSION" | ||
| echo " GCCcore_VERSION : $GCCcore_VERSION" | ||
| echo " IMAS VERSION : $CORE_MODULE_VERSION" | ||
| echo " RUNMODULES : " "${RUNMODULES[@]}" | ||
| echo " EBRUNMODULES : " "${EBBRUNMODULES[@]}" | ||
| echo " Compiler : $FCOMPILER" | ||
| echo "-------------------------------------------------------" | ||
|
|
||
|
|
||
| echo "> Loading run time modules" | ||
| # Load build modules if they exist | ||
| for imodule in "${RUNMODULES[@]}"; do | ||
| IFS='/' read -r iname iversion <<< "$imodule" | ||
| MODULE_EXISTS=$(module -r -t list 2>&1 | grep -E "$iname/") | ||
| if [ -z "$MODULE_EXISTS" ]; then | ||
| echo " $iname not available, Loading $imodule" | ||
| module load "$imodule" | ||
| else | ||
| echo " $MODULE_EXISTS already loaded" | ||
| fi | ||
| # Check which modules env var is set | ||
| if [ -n "${INTEL_MODULES:-}" ]; then | ||
| MODULES_LIST="$INTEL_MODULES" | ||
| export ENVIRONEMNT_NAME="intel" | ||
| elif [ -n "${FOSS_MODULES:-}" ]; then | ||
| MODULES_LIST="$FOSS_MODULES" | ||
| export ENVIRONEMNT_NAME="foss" | ||
| else | ||
| echo "" | ||
| echo "ERROR: Neither INTEL_MODULES nor FOSS_MODULES is set" | ||
| echo "" | ||
| echo "Please set one of these environment variables and run the script." | ||
| echo "" | ||
| echo "Examples:" | ||
| echo "" | ||
| echo " For intel-2023b:" | ||
| echo " export INTEL_MODULES=\"IMAS-Core/5.7.1-intel-2023b Tkinter/3.11.5-GCCcore-13.2.0 IMAS-Python/2.3.0-intel-2023b PyYAML/6.0.1-GCCcore-13.2.0\"" | ||
| echo "" | ||
| echo " For intel-2025b:" | ||
| echo " export INTEL_MODULES=\"IMAS-Core/5.7.1-intel-2025b Tkinter/3.13.5-GCCcore-14.3.0 IMAS-Python/2.3.0-intel-2025b PyYAML/6.0.2-GCCcore-14.3.0\"" | ||
| echo "" | ||
| echo " For foss-2023b:" | ||
| echo " export FOSS_MODULES=\"IMAS-Core/5.7.1-foss-2023b Tkinter/3.11.5-GCCcore-13.2.0 IMAS-Python/2.3.0-foss-2023b PyYAML/6.0.1-GCCcore-13.2.0\"" | ||
| echo "" | ||
| echo " For foss-2025b:" | ||
| echo " export FOSS_MODULES=\"IMAS-Core/5.7.1-foss-2025b Tkinter/3.13.5-GCCcore-14.3.0 IMAS-Python/2.3.0-foss-2025b PyYAML/6.0.2-GCCcore-14.3.0\"" | ||
| echo "" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Load all modules | ||
| for module in $MODULES_LIST; do | ||
| module load "$module" | ||
| done | ||
| echo "> Done" | ||
| echo "-------------------------------------------------------" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
antenna_nameis a string, this is not a proper way to check existence, and can you explain the reason for the addition below?