Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
40 changes: 40 additions & 0 deletions projects/rocshmem/scripts/build_configs/_common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
###############################################################################
# Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
#
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
###############################################################################
#
# Shared setup sourced by scripts/build_configs/*. Not meant to be executed
# directly.

if [[ "${ASAN}" == true ]]; then
export HSA_XNACK=1
fi

generator_args=()
if command -v ninja >/dev/null 2>&1; then
Comment thread
Copilot marked this conversation as resolved.
Resolved
generator_args=(-G Ninja)
fi

build_jobs=$(nproc)
if (( build_jobs > 32 )); then
build_jobs=32
fi
11 changes: 5 additions & 6 deletions projects/rocshmem/scripts/build_configs/all_backends
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@

set -e

src_path=$(dirname "$(realpath $0)")/../../

if [[ "${ASAN}" == true ]]; then
export HSA_XNACK=1
fi
script_dir=$(dirname "$(realpath $0)")
src_path=${script_dir}/../../
source "${script_dir}/_common.sh"

cmake \
"${generator_args[@]}" \
-DBUILD_CODE_COVERAGE=${CODE_COV:-OFF} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-~/rocshmem} \
Expand All @@ -54,6 +53,6 @@ cmake \
-DUSE_HDP_FLUSH_HOST_SIDE=OFF \
-DASAN=${ASAN:-OFF} \
$* $src_path
cmake --build . --parallel 8
cmake --build . --parallel ${BUILD_JOBS:-$build_jobs}
cmake --install .

10 changes: 5 additions & 5 deletions projects/rocshmem/scripts/build_configs/gda
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

set -e

src_path=$(dirname "$(realpath $0)")/../../
if [[ "${ASAN}" == true ]]; then
export HSA_XNACK=1
fi
script_dir=$(dirname "$(realpath $0)")
src_path=${script_dir}/../../
source "${script_dir}/_common.sh"

cmake \
"${generator_args[@]}" \
-DBUILD_CODE_COVERAGE=${CODE_COV:-OFF} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-~/rocshmem} \
Expand All @@ -50,5 +50,5 @@ cmake \
-DUSE_HDP_FLUSH_HOST_SIDE=OFF \
-DASAN=${ASAN:-OFF} \
$* $src_path
cmake --build . --parallel 8
cmake --build . --parallel ${BUILD_JOBS:-$build_jobs}
cmake --install .
10 changes: 5 additions & 5 deletions projects/rocshmem/scripts/build_configs/ipc_single
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

set -e

src_path=$(dirname "$(realpath $0)")/../../
if [[ "${ASAN}" == true ]]; then
export HSA_XNACK=1
fi
script_dir=$(dirname "$(realpath $0)")
src_path=${script_dir}/../../
source "${script_dir}/_common.sh"

cmake \
"${generator_args[@]}" \
-DBUILD_CODE_COVERAGE=${CODE_COV:-OFF} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-~/rocshmem} \
Expand All @@ -51,5 +51,5 @@ cmake \
-DUSE_SINGLE_NODE=ON \
-DASAN=${ASAN:-OFF} \
$* $src_path
cmake --build . --parallel 8
cmake --build . --parallel ${BUILD_JOBS:-$build_jobs}
cmake --install .
10 changes: 5 additions & 5 deletions projects/rocshmem/scripts/build_configs/ipc_tests_only
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

set -e

src_path=$(dirname "$(realpath $0)")/../../
if [[ "${ASAN}" == true ]]; then
export HSA_XNACK=1
fi
script_dir=$(dirname "$(realpath $0)")
src_path=${script_dir}/../../
source "${script_dir}/_common.sh"

cmake \
"${generator_args[@]}" \
-DBUILD_CODE_COVERAGE=${CODE_COV:-OFF} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-~/rocshmem} \
Expand All @@ -51,4 +51,4 @@ cmake \
-DUSE_HDP_FLUSH_HOST_SIDE=OFF \
-DBUILD_TESTS_ONLY=ON \
$* $src_path
cmake --build . --parallel 8
cmake --build . --parallel ${BUILD_JOBS:-$build_jobs}
10 changes: 5 additions & 5 deletions projects/rocshmem/scripts/build_configs/ro_ipc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

set -e

src_path=$(dirname "$(realpath $0)")/../../
if [[ "${ASAN}" == true ]]; then
export HSA_XNACK=1
fi
script_dir=$(dirname "$(realpath $0)")
src_path=${script_dir}/../../
source "${script_dir}/_common.sh"

cmake \
"${generator_args[@]}" \
-DBUILD_CODE_COVERAGE=${CODE_COV:-OFF} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-~/rocshmem} \
Expand All @@ -50,5 +50,5 @@ cmake \
-DUSE_HDP_FLUSH_HOST_SIDE=OFF \
-DASAN=${ASAN:-OFF} \
$* $src_path
cmake --build . --parallel 8
cmake --build . --parallel ${BUILD_JOBS:-$build_jobs}
cmake --install .
10 changes: 5 additions & 5 deletions projects/rocshmem/scripts/build_configs/ro_net
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

set -e

src_path=$(dirname "$(realpath $0)")/../../
if [[ "${ASAN}" == true ]]; then
export HSA_XNACK=1
fi
script_dir=$(dirname "$(realpath $0)")
src_path=${script_dir}/../../
source "${script_dir}/_common.sh"

cmake \
"${generator_args[@]}" \
-DBUILD_CODE_COVERAGE=${CODE_COV:-OFF} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX:-~/rocshmem} \
Expand All @@ -50,5 +50,5 @@ cmake \
-DUSE_HDP_FLUSH_HOST_SIDE=OFF \
-DASAN=${ASAN:-OFF} \
$* $src_path
cmake --build . --parallel 8
cmake --build . --parallel ${BUILD_JOBS:-$build_jobs}
cmake --install .
Loading