From 65e268902901ebd224e9def1b038d546a28bbcbb Mon Sep 17 00:00:00 2001 From: anhurion Date: Fri, 13 Dec 2024 19:46:27 +0200 Subject: [PATCH 1/2] Fixes in the Ubuntu Installation script The ub_version taken from lsb_release could be changed to simplify the process. Changes to uv_v_major and *minor correctly split the ub_version that comes as e. g. 22.04. Moved numpy installation to the major controlled if statement to allow for the latest numpy library (allows the usage of libraries such as pandas without the need for requirement freezing) --- scripts/install_ubuntu.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/install_ubuntu.sh b/scripts/install_ubuntu.sh index 3063e160..abfa6347 100755 --- a/scripts/install_ubuntu.sh +++ b/scripts/install_ubuntu.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e CLEAN=0 @@ -6,22 +8,21 @@ CLEAN=${1:-$CLEAN} sudo apt install -y lsb-release -ub_version=$(cut -f2 <<< "$(lsb_release -r)") -ub_v_list=$(echo $ub_version | tr ";" "\n") -uv_v_major=$(echo $ub_v_list | awk '{print $1}') -uv_v_minor=$(echo $ub_v_list | awk '{print $2}') +ub_version=$(lsb_release -r | cut -d: -f2 | tr -d '[:space:]') +uv_v_major=$(echo "$ub_version" | cut -d. -f1) +uv_v_minor=$(echo "$ub_version" | cut -d. -f2) sudo apt install -y software-properties-common sudo apt install -y build-essential cmake pkg-config git -sudo apt install -y python3-numpy python-is-python3 python3-setuptools +sudo apt install -y python-is-python3 python3-setuptools if [ $uv_v_major -lt 22 ]; then sudo apt-add-repository -y ppa:dartsim/ppa sudo apt update sudo apt install -y python3-pip - pip3 install dartpy + pip3 install numpy dartpy else - sudo apt install -y python3-dartpy + sudo apt install -y python3-numpy python3-dartpy fi sudo apt install -y libboost-regex-dev libboost-system-dev libboost-test-dev From 48ecdaadfcabdd27181df80a9d4b975c17b6ab93 Mon Sep 17 00:00:00 2001 From: anhurion Date: Fri, 13 Dec 2024 20:19:19 +0200 Subject: [PATCH 2/2] Changed last OS version that uses pip for numpy and dartpy to be 22.04 (inclusive) --- scripts/install_ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_ubuntu.sh b/scripts/install_ubuntu.sh index abfa6347..b3cf56d0 100755 --- a/scripts/install_ubuntu.sh +++ b/scripts/install_ubuntu.sh @@ -16,7 +16,7 @@ sudo apt install -y software-properties-common sudo apt install -y build-essential cmake pkg-config git sudo apt install -y python-is-python3 python3-setuptools -if [ $uv_v_major -lt 22 ]; then +if [ $uv_v_major -le 22 ]; then sudo apt-add-repository -y ppa:dartsim/ppa sudo apt update sudo apt install -y python3-pip