cleaned up the behavior for standalone build vs rocm integrated standalone build
AOMP_VERSION=${AOMP_VERSION:-"0.7"}
AOMP_VERSION_MOD=${AOMP_VERSION_MOD:-"6"}
AOMP_VERSION_STRING=${AOMP_VERSION_STRING:-"$AOMP_VERSION-$AOMP_VERSION_MOD"}
-ROCM_VERSION="2.9.22"
export AOMP_VERSION_STRING AOMP_VERSION AOMP_VERSION_MOD ROCM_VERSION
# set install directory and the link directory
@@ -26,10 +25,6 @@ AOMP_REPOS_TEST=${AOMP_REPOS_TEST:-$HOME/git/aomp-test}
# See build_from_release_tarball.sh
AOMP_CHECK_GIT_BRANCH=${AOMP_CHECK_GIT_BRANCH:-1}
AOMP_APPLY_ROCM_PATCHES=${AOMP_APPLY_ROCM_PATCHES:-1}
-AOMP_STANDALONE_BUILD=${AOMP_STANDALONE_BUILD:-1}
-if [ $AOMP_STANDALONE_BUILD != 1 ] ; then
- AOMP_CHECK_GIT_BRANCHES=0
-fi
CUDA=${CUDA:-/usr/local/cuda}
CUDAT=${CUDAT:-$CUDA/targets}
@@ -158,12 +153,40 @@ BUILD_DIR=$BUILD_AOMP
# access to BUILD_AOMP is fast or 2) lots of updates and test code
# is planned that are not desired in his git repository.
# This COPYSOURCE flag is used by build scripts to conditianlly rsync
-# source code to the BUILD_AOMP directory.
+# source code to the BUILD_AOMP/build/<component> directory.
if [ "$BUILD_DIR" != "$AOMP_REPOS" ] ; then
COPYSOURCE=true
fi
-if [ $AOMP_STANDALONE_BUILD != 1 ] ; then
+
+# Here is where we define different behaviors for STANDALONE build
+# and the new ROCm integrated build. The default is STANDALONE build.
+AOMP_STANDALONE_BUILD=${AOMP_STANDALONE_BUILD:-1}
+if [ $AOMP_STANDALONE_BUILD == 1 ] ; then
+ # Standalone build gets ROCm components from the AOMP Installation.
+ # As a result their is an order to component builds.
+ ROCM_DIR=${ROCM_DIR:-$AOMP_INSTALL_DIR}
+ # We hardcode the ROCM_VERSION here for standalone builds
+ ROCM_VERSION="2.9.22"
+else
+ # ROCm integrated build gets ROCm pieces from installed ROCm
+ ROCM_DIR=${ROCM_DIR:-/opt/rocm}
+ # Jenkins builds may not use the current development branches.
+ # So we turn off git branch checking.
+ AOMP_CHECK_GIT_BRANCHES=0
+ # Jenkins build will set the build directory BUILD_DIR to its own work area.
+ # And since that is not $AOMP_REPOS/build COPYSOURCE will be turned on above.
+ # We don't want that. So for now, turn it off for ROCm integrated builds.
unset COPYSOURCE
+
+ # Find the ROCM_VERSION
+ vfile=$ROCM_DIR/.info/version-dev
+ if [ -f $vfile ] ; then
+ ROCM_VERSION=`cat $vfile | cut -d" " -f1`
+ echo ROCM_VERSION=$ROCM_VERSION
+ else
+ echo "ERROR: ROCM_DIR is missing version file $vfile"
+ exit 1
+ fi
fi
# Check the repositories exist and are on the correct branch
