From e78771daa779c84e3c57a88739e1cfe1d111decd Mon Sep 17 00:00:00 2001 From: Rahul Bramandlapalli <54270708+rbramand-xilinx@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:16:29 +0530 Subject: [PATCH] Minor changes in boost.sh script (#8202) (#8212) (cherry picked from commit 66506c7c4209654811ea1d6dd30f0103c183d0b4) Signed-off-by: rbramand Co-authored-by: rbramand --- .gitignore | 8 +++++- src/runtime_src/tools/scripts/boost.sh | 35 ++++++++++++++++++-------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 53038158cc7..039654f2536 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,11 @@ build/Debug* build/WDebug* build/Release* build/WRelease* +build/aarch64 +build/versal +build/deb_arm32 +build/deb_arm64 +build/boost docs/.buildinfo docs/.doctrees tests/xrt/build/Debug* @@ -23,4 +28,5 @@ a.out a.xclbin vivado.log vivado.jou -/.vs +.vs +.vscode diff --git a/src/runtime_src/tools/scripts/boost.sh b/src/runtime_src/tools/scripts/boost.sh index 65e09d07fc0..d0d10bb77c5 100755 --- a/src/runtime_src/tools/scripts/boost.sh +++ b/src/runtime_src/tools/scripts/boost.sh @@ -4,6 +4,11 @@ # Copyright (C) 2019-2021 Xilinx, Inc. All rights reserved. # +# Get directory path of this XRT ROOT +THIS_SCRIPT=`readlink -f ${BASH_SOURCE[0]}` +THIS_SCRIPT_DIR=$(dirname "$THIS_SCRIPT") +XRT_BUILD_DIR=`readlink -f $THIS_SCRIPT_DIR/../../../../build` + usage() { echo "Usage: boost.sh [options] []" @@ -16,11 +21,12 @@ usage() echo "Version defaults to boost-1.71.0" echo "" echo "[-help] List this help" - echo "[-prefix ] Prefix for install and srcdir (default: $PWD/boost)" - echo "[-install ] Path to install directory (default: $PWD/boost/xrt)" - echo "[-srcdir ] Directory for boost sources (default: $PWD/boost/build)" + echo "[-prefix ] Prefix for install and srcdir (default: $XRT_BUILD_DIR/boost)" + echo "[-install ] Path to install directory (default: $XRT_BUILD_DIR/boost/xrt)" + echo "[-srcdir ] Directory for boost sources (default: $XRT_BUILD_DIR/boost/build)" echo "[-noclone] Don't clone fresh, use exist 'srcdir'" echo "[-nobuild] Don't build boost, just exit with message" + echo "[-force] Run script in non interactive mode" echo "" echo "Clone, build, and install boost" echo "% boost.sh -prefix $HOME/tmp/boost" @@ -35,11 +41,12 @@ usage() } version="boost-1.71.0" -prefix=$PWD/boost +prefix=$XRT_BUILD_DIR/boost srcdir=$prefix/build install=$prefix/xrt noclone=0 nobuild=0 +force=0 while [ $# -gt 0 ]; do case "$1" in @@ -71,6 +78,10 @@ while [ $# -gt 0 ]; do nobuild=1 shift ;; + -force) + force=1 + shift + ;; *) version=$1 shift @@ -101,12 +112,14 @@ if [[ $nobuild == 0 ]] ; then echo "Building Boost from '$srcdir' and installing in '$install'" fi -read -p "Ok to continue (Y/n): " answer -answer=${answer:-Y} -echo $answer -if [[ $answer != "Y" ]]; then - echo "exiting ..." - exit 1 +if [[ $force == 0 ]] ; then + read -p "Ok to continue (Y/n): " answer + answer=${answer:-Y} + echo $answer + if [[ $answer != "Y" ]]; then + echo "exiting ..." + exit 1 + fi fi # Clone @@ -126,7 +139,7 @@ if [[ $nobuild == 0 ]]; then fi ./bootstrap.sh > /dev/null - ./b2 -a -d+2 cxxflags="-std=gnu++14 -fPIC" -j6 install --prefix=$install link=static --with-filesystem --with-program_options --with-system --layout=tagged + ./b2 -a -d+2 cxxflags="-std=c++17 -fPIC" -j6 install --prefix=$install link=static --with-filesystem --with-program_options --with-system --layout=tagged # copy _mt-x64.a to .a, to faciliate linking with -lboost_ for f in $(find $install/lib -type f -name *-mt-x64.a); do