diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 3d502547a7f6..adc75b417b4f 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -42,6 +42,7 @@ USE_CLANG="${USE_CLANG:-false}" export INSTALL_PREFIX=${INSTALL_PREFIX:-"/usr/local"} DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download} VERSION=$(cat /etc/os-release | grep VERSION_ID) +PYTHON_VENV=${PYTHON_VENV:-"${SCRIPTDIR}/../.venv"} # On Ubuntu 20.04 dependencies need to be built using gcc11. # On Ubuntu 22.04 gcc11 is already the system gcc installed. @@ -93,7 +94,12 @@ function install_build_prerequisites { git \ pkg-config \ wget - + + if [ ! -f ${PYTHON_VENV}/pyvenv.cfg ]; then + echo "Creating Python Virtual Environment at ${PYTHON_VENV}" + python3 -m venv ${PYTHON_VENV} + fi + source ${PYTHON_VENV}/bin/activate; # Install to /usr/local to make it available to all users. ${SUDO} pip3 install cmake==3.28.3 @@ -105,6 +111,14 @@ function install_build_prerequisites { } +# Install packages required to fix format +function install_format_prerequisites { + pip3 install regex + ${SUDO} apt install -y \ + clang-format \ + cmake-format +} + # Install packages required for build. function install_velox_deps_from_apt { ${SUDO} apt update @@ -286,6 +300,7 @@ function install_velox_deps { function install_apt_deps { install_build_prerequisites + install_format_prerequisites install_velox_deps_from_apt }