Skip to content

Commit

Permalink
add envsetup_pre.sh to allow user config script
Browse files Browse the repository at this point in the history
Signed-off-by: Mika Laitio <[email protected]>
  • Loading branch information
lamikr committed Jul 14, 2024
1 parent 1b4442a commit 7340ad6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ docs/examples/hipcc/hello_world/hello_world.o
docs/examples/opencl/check_opencl_caps/check_opencl_caps
docs/examples/opencl/hello_world/hello_world
packages
envsetup_pre.sh
4 changes: 4 additions & 0 deletions babs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
#

# user configuration menu functionality
source binfo/user_config.sh

# allow enable doing some user specific extra actions before the build start
source ./envsetup_pre.sh

func_is_user_in_dev_kfd_render_group() {
if [ -e /dev/kfd ]; then
test -w /dev/kfd || {
Expand Down
2 changes: 1 addition & 1 deletion binfo/build_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export ROCM_SDK_RELEASE_VERSION=1

# Set BABS version information
# Stored in /opt/rocm_sdk_xyz/.info/rocm_sdk_builder
export BABS_VERSION=2024_07_05_01
export BABS_VERSION=2024_07_14_01

# Get git hash used to build the system
# Stored in /opt/rocm_sdk_xyz/.info/rocm_sdk_builder
Expand Down
6 changes: 6 additions & 0 deletions binfo/envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@

SDK_ROOT_DIR="$PWD"

# user configuration menu functionality
source binfo/user_config.sh

# allow enable doing some user specific extra actions before the build start
# like setting the INSTALL_DIR_PREFIX_SDK_ROOT
source ../envsetup_pre.sh

# check the linux distribution for the target triplet
export ROCM_TARGET_TRIPLED=x86_64-rocm-linux-gnu
if [[ -e "/etc/os-release" ]]; then
Expand All @@ -33,6 +38,7 @@ echo "ROCM_TARGET_TRIPLED: ${ROCM_TARGET_TRIPLED}"
# set INSTALL_DIR_PREFIX_SDK_ROOT only if it not already set in the user environment variable or user_config.sh
INSTALL_DIR_PREFIX_SDK_ROOT="${INSTALL_DIR_PREFIX_SDK_ROOT:-/opt/rocm_sdk_${ROCM_MAJOR_VERSION}${ROCM_MINOR_VERSION}${ROCM_PATCH_VERSION}}"
export INSTALL_DIR_PREFIX_SDK_ROOT
echo "INSTALL_DIR_PREFIX_SDK_ROOT: $INSTALL_DIR_PREFIX_SDK_ROOT"

export ROCM_PATH=${INSTALL_DIR_PREFIX_SDK_ROOT}
export BUILD_RULE_ROOT_DIR=${SDK_ROOT_DIR}/binfo
Expand Down

0 comments on commit 7340ad6

Please sign in to comment.