Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
18 changes: 0 additions & 18 deletions host-configs/lc-builds/toss4/icpc-classic_X.cmake

This file was deleted.

16 changes: 0 additions & 16 deletions host-configs/lc-builds/toss4/icpc_X.cmake

This file was deleted.

31 changes: 22 additions & 9 deletions scripts/lc-builds/corona_sycl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,38 @@
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

if [[ $# -lt 1 ]]; then
echo
echo "You must pass 1 argument to the script: "
echo " 1) SYCL compiler installation path"
# Default CMake version if not provided
DEFAULT_CMAKE_VER=3.25.2

# Require compiler version
if [ "$1" == "" ]; then
echo
echo "For example: "
echo " corona_sycl.sh /usr/workspace/raja-dev/clang_sycl_16b7bcb09915_hip_gcc10.3.1_rocm6.4.2"
exit
echo "You must pass a SYCL compiler path to script. For example,"
echo " corona_sycl.sh /usr/workspace/raja-dev/clang_sycl_16b7bcb09915_hip_gcc10.3.1_rocm6.4.2 [3.27.4]"
echo "An optional second argument can be given to set the CMake version to load."
echo "If no CMake version is provided, version ${DEFAULT_CMAKE_VER} will be used."
exit 1
fi

SYCL_PATH=$1
shift 1

# Detect optional second positional argument as a CMake version if it looks like N.M or N.M.P
# Otherwise, treat it as a normal CMake argument.
if [ -n "$2" ] && [[ "$2" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to have an additional clause like this

elif [ -n "$2" ] && [[ "$2" !=~ ^[0-9]+(\.[0-9]+)*$ ]]; then
echo "Unable to parse CMake version number"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this argument won't be used widely I think this help message is not strictly necessary

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we can make the scripts much more helpful. However, they are specific to LC systems and used mostly for our own development purposes. Sometimes, I point people to them for examples.

CMAKE_VER=$2
shift 2
else
CMAKE_VER=$DEFAULT_CMAKE_VER
shift 1
fi
Comment on lines +27 to +35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more clear if the cmake version was an optional named argument like script compiler_ver [--cmake ver] [cmake args...]? Would putting it first be more uniform script [--cmake ver] compiler_ver [cmake args...]?

Copy link
Member Author

@rhornung67 rhornung67 Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but we don't use named args for input to any of the scripts.

I put it last because it's optional and in most cases, it probably won't be needed.

This PR is intended to deal with the specific issue that the CMake version is currently hard-coded in the scripts and we need to be more flexible and it's a pain to modify the scripts for minor changes like that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in general named arguments are better, and that it would be better if all the build scripts had only named arguments (ideally in Python). However, given that these scripts are used primarily internally, I think it would probably be better to make this as minimal of a change as possible.

In terms of improving usability of these scripts, I think the best thing would probably be a Python driver that calls the shell scripts automatically, and provides users with a nice --help description.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with that. If you feel inclined to pursue that, please do so.

My intent with this PR was to do a quick, simple change to make the scripts more useful w.r.t. a particular issue.


BUILD_SUFFIX=corona-sycl
: ${BUILD_TYPE:=RelWithDebInfo}
RAJA_HOSTCONFIG=../host-configs/lc-builds/toss4/corona_sycl.cmake

echo
echo "Creating build directory build_${BUILD_SUFFIX} and generating configuration in it"
echo "Using CMake version: ${CMAKE_VER}"
echo "Configuration extra arguments:"
echo " $@"
echo
Expand All @@ -40,7 +53,7 @@ DATE=$(printf '%(%Y-%m-%d)T\n' -1)
export PATH=${SYCL_PATH}/bin:$PATH
export LD_LIBRARY_PATH=${SYCL_PATH}/lib:${SYCL_PATH}/lib64:$LD_LIBRARY_PATH

module load cmake/3.23.1
module load cmake/${CMAKE_VER}

cmake \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
Expand Down
24 changes: 19 additions & 5 deletions scripts/lc-builds/toss4_amdclang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,34 @@
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

# Default CMake version if not provided
DEFAULT_CMAKE_VER=3.24.2

if [[ $# -lt 2 ]]; then
echo
echo "You must pass 2 or more arguments to the script (in the following order): "
echo " 1) compiler version number"
echo " 2) HIP compute architecture"
echo " 3...) optional arguments to cmake"
echo " 3) optional CMake version to load."
echo
echo "For example: "
echo " toss4_amdclang.sh 4.1.0 gfx906"
exit
echo " toss4_amdclang.sh 4.1.0 gfx906 [3.27.4]"
echo "If no CMake version is provided, version ${DEFAULT_CMAKE_VER} will be used."
exit 1
fi

COMP_VER=$1
COMP_ARCH=$2
shift 2

# Detect optional third positional argument as a CMake version if it looks like N.M or N.M.P
# Otherwise, treat it as a normal CMake argument.
if [ -n "$3" ] && [[ "$3" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
CMAKE_VER=$3
shift 3
else
CMAKE_VER=$DEFAULT_CMAKE_VER
shift 2
fi

HOSTCONFIG="hip_3_X"

Expand All @@ -42,6 +55,7 @@ BUILD_SUFFIX=lc_toss4-amdclang-${COMP_VER}-${COMP_ARCH}

echo
echo "Creating build directory build_${BUILD_SUFFIX} and generating configuration in it"
echo "Using CMake version: ${CMAKE_VER}"
echo "Configuration extra arguments:"
echo " $@"
echo
Expand All @@ -53,7 +67,7 @@ rm -rf build_${BUILD_SUFFIX} >/dev/null
mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX}


module load cmake/3.24.2
module load cmake/${CMAKE_VER}

# unload rocm to avoid configuration problems where the loaded rocm and COMP_VER
# are inconsistent causing the rocprim from the module to be used unexpectedly
Expand Down
26 changes: 20 additions & 6 deletions scripts/lc-builds/toss4_amdclang_asan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,34 @@
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

# Default CMake version if not provided
DEFAULT_CMAKE_VER=3.24.2

if [[ $# -lt 2 ]]; then
echo
echo "You must pass 2 or more arguments to the script (in this order): "
echo "You must pass 2 or more arguments to the script (in the following order): "
echo " 1) compiler version number"
echo " 2) HIP compute architecture"
echo " 3...) optional arguments to cmake"
echo " 3) optional CMake version to load."
echo
echo "For example: "
echo " toss4_amdclang_asan.sh 5.7.0 gfx90a"
exit
echo " toss4_amdclang.sh 4.1.0 gfx906 [3.27.4]"
echo "If no CMake version is provided, version ${DEFAULT_CMAKE_VER} will be used."
exit 1
fi

COMP_VER=$1
COMP_ARCH=$2
shift 2

# Detect optional third positional argument as a CMake version if it looks like N.M or N.M.P
# Otherwise, treat it as a normal CMake argument.
if [ -n "$3" ] && [[ "$3" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
CMAKE_VER=$3
shift 3
else
CMAKE_VER=$DEFAULT_CMAKE_VER
shift 2
fi

HOSTCONFIG="hip_3_X"

Expand All @@ -42,6 +55,7 @@ BUILD_SUFFIX=lc_toss4-amdclang-${COMP_VER}-${COMP_ARCH}-asan

echo
echo "Creating build directory build_${BUILD_SUFFIX} and generating configuration in it"
echo "Using CMake version: ${CMAKE_VER}"
echo "Configuration extra arguments:"
echo " $@"
echo
Expand All @@ -56,7 +70,7 @@ rm -rf build_${BUILD_SUFFIX} >/dev/null
mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX}


module load cmake/3.24.2
module load cmake/${CMAKE_VER}

# unload rocm to avoid configuration problems where the loaded rocm and COMP_VER
# are inconsistent causing the rocprim from the module to be used unexpectedly
Expand Down
24 changes: 19 additions & 5 deletions scripts/lc-builds/toss4_cce_hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,44 @@
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

# Default CMake version if not provided
DEFAULT_CMAKE_VER=3.24.2

if [[ $# -lt 3 ]]; then
echo
echo "You must pass 3 or more arguments to the script (in this order): "
echo " 1) compiler version number"
echo " 2) HIP version"
echo " 3) HIP compute architecture"
echo " 4...) optional arguments to cmake"
echo " 4) optional CMake version to load."
echo
echo "For example: "
echo " toss4_cce_hip.sh 14.0.3 5.2.3 gfx90a"
exit
echo " toss4_cce_hip.sh 14.0.3 5.2.3 gfx90a [3.27.4]"
echo "If no CMake version is provided, version ${DEFAULT_CMAKE_VER} will be used."
exit 1
fi

COMP_VER=$1
HIP_VER=$2
HIP_ARCH=$3
shift 3

# Detect optional fourth positional argument as a CMake version if it looks like N.M or N.M.P
# Otherwise, treat it as a normal CMake argument.
if [ -n "$4" ] && [[ "$4" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
CMAKE_VER=$4
shift 4
else
CMAKE_VER=$DEFAULT_CMAKE_VER
shift 3
fi

HOSTCONFIG="hip_3_X"

BUILD_SUFFIX=lc_toss4-cce-${COMP_VER}-hip-${HIP_VER}-${HIP_ARCH}

echo
echo "Creating build directory build_${BUILD_SUFFIX} and generating configuration in it"
echo "Using CMake version: ${CMAKE_VER}"
echo "Configuration extra arguments:"
echo " $@"
echo
Expand All @@ -44,7 +58,7 @@ rm -rf build_${BUILD_SUFFIX} >/dev/null
mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX}


module load cmake/3.24.2
module load cmake/${CMAKE_VER}

cmake \
-DCMAKE_BUILD_TYPE=Release \
Expand Down
26 changes: 20 additions & 6 deletions scripts/lc-builds/toss4_cce_omptarget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,42 @@
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

# Default CMake version if not provided
DEFAULT_CMAKE_VER=3.24.2

if [[ $# -lt 2 ]]; then
echo
echo "You must pass 3 or more arguments to the script (in this order): "
echo "You must pass 2 or more arguments to the script (in this order): "
echo " 1) compiler version number"
echo " 2) HIP compute architecture"
echo " 3...) optional arguments to cmake"
echo " 3) optional CMake version to load."
echo
echo "For example: "
echo " toss4_cce_omptarget.sh 20.0.0-magic gfx942"
exit
echo " toss4_cce_omptarget.sh 20.0.0-magic gfx942 [3.27.4]"
echo "If no CMake version is provided, version ${DEFAULT_CMAKE_VER} will be used."
exit 1"
fi

COMP_VER=$1
HIP_ARCH=$2
shift 2

# Detect optional third positional argument as a CMake version if it looks like N.M or N.M.P
# Otherwise, treat it as a normal CMake argument.
if [ -n "$3" ] && [[ "$3" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
CMAKE_VER=$3
shift 3
else
CMAKE_VER=$DEFAULT_CMAKE_VER
shift 2
fi

HOSTCONFIG="cce_omptarget_X"

BUILD_SUFFIX=lc_toss4-cce-${COMP_VER}-${HIP_ARCH}-omptarget

echo
echo "Creating build directory build_${BUILD_SUFFIX} and generating configuration in it"
echo "Using CMake version: ${CMAKE_VER}"
echo "Configuration extra arguments:"
echo " $@"
echo
Expand All @@ -39,7 +53,7 @@ rm -rf build_${BUILD_SUFFIX} >/dev/null
mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX}


module load cmake/3.24.2
module load cmake/${CMAKE_VER}

cmake \
-DCMAKE_BUILD_TYPE=Release \
Expand Down
26 changes: 19 additions & 7 deletions scripts/lc-builds/toss4_clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,43 @@
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

# Default CMake version if not provided
DEFAULT_CMAKE_VER=3.25.2

if [ "$1" == "" ]; then
echo
echo "You must pass a compiler version number to script. For example,"
echo " toss4_clang.sh 14.0.6"
echo
echo "The compiler MAJOR VERSION must be 14, or CMake will complain"
echo "and you will not be able to run 'make style' to format the code."
exit
echo " toss4_clang.sh 14.0.6 [3.27.4]"
echo "An optional second argument can be given to set the CMake version to load."
echo "If no CMake version is provided, version ${DEFAULT_CMAKE_VER} will be used."
exit 1
fi

COMP_VER=$1
shift 1

# Detect optional second positional argument as a CMake version if it looks like N.M or N.M.P
# Otherwise, treat it as a normal CMake argument.
if [ -n "$2" ] && [[ "$2" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
CMAKE_VER=$2
shift 2
else
CMAKE_VER=$DEFAULT_CMAKE_VER
shift 1
fi

BUILD_SUFFIX=lc_toss4-clang-${COMP_VER}

echo
echo "Creating build directory build_${BUILD_SUFFIX} and generating configuration in it"
echo "Using CMake version: ${CMAKE_VER}"
echo "Configuration extra arguments:"
echo " $@"
echo

rm -rf build_${BUILD_SUFFIX} 2>/dev/null
mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX}

module load cmake/3.23.1
module load cmake/${CMAKE_VER}

cmake \
-DCMAKE_BUILD_TYPE=Release \
Expand Down
Loading