diff options
author | XenHat | 2022-12-09 00:15:16 -0500 |
---|---|---|
committer | XenHat | 2022-12-09 00:15:16 -0500 |
commit | 79e204162c6a6dd3106826c6974150a7d09f7e65 (patch) | |
tree | 9c40fe409289b63754b3fa9a5d33776aef0cae00 | |
parent | 8ed22a6033147bb8793d32764e3ec1882687ee58 (diff) | |
download | aur-79e204162c6a6dd3106826c6974150a7d09f7e65.tar.gz |
cosmetic build script tweaks
-rwxr-xr-x | compile.bash | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compile.bash b/compile.bash index 33bf25b0c985..08e8752febec 100755 --- a/compile.bash +++ b/compile.bash @@ -32,8 +32,8 @@ build() { ulimit -n 20000 build_jobs=$(nproc) if [[ ${build_jobs} -gt 1 ]]; then - # The viewer requires an average of 4GB of memory per core to link mempercorekb=$((4 * 1048576)) + # The viewer requires an average of 4GB of memory per core to link requiredmemorykb=$(($(nproc) * mempercorekb)) # Source: Total Used Free free_output="$(free --kilo --total | tr -s ' ')" @@ -48,11 +48,13 @@ build() { if [[ ${requiredmemorykb} -gt ${freememorykb} ]]; then jobs=1 echo "Allocating build jobs according to available memory (${freememorykb}/${requiredmemorykb})..." + # FIXME: Goes one iteration beyond what it should while [[ $((jobs * mempercorekb)) -lt ${freememorykb} ]]; do jobs=$((jobs+1)) echo -e "${jobs}...$(((jobs * mempercorekb)/1024/1024))GB" done build_jobs=${jobs} + echo "Computed job count: ${build_jobs}" fi fi fi |