update ceph.spec.

This commit is contained in:
wangzengliang 2022-03-16 04:01:23 +00:00 committed by Gitee
parent 8a016a4d06
commit c715e2d9e8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1240,7 +1240,7 @@ export CXXFLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g')
%endif %endif
# Parallel build settings ... # Parallel build settings ...
CEPH_MFLAGS_JOBS="-j32" CEPH_MFLAGS_JOBS="-j20"
CEPH_SMP_NCPUS=$(echo "$CEPH_MFLAGS_JOBS" | sed 's/-j//') CEPH_SMP_NCPUS=$(echo "$CEPH_MFLAGS_JOBS" | sed 's/-j//')
%if 0%{?__isa_bits} == 32 %if 0%{?__isa_bits} == 32
# 32-bit builds can use 3G memory max, which is not enough even for -j2 # 32-bit builds can use 3G memory max, which is not enough even for -j2
@ -1252,7 +1252,7 @@ free -h
echo "System limits:" echo "System limits:"
ulimit -a ulimit -a
if test -n "$CEPH_SMP_NCPUS" -a "$CEPH_SMP_NCPUS" -gt 1 ; then if test -n "$CEPH_SMP_NCPUS" -a "$CEPH_SMP_NCPUS" -gt 1 ; then
mem_per_process=3000 mem_per_process=2500
max_mem=$(LANG=C free -m | sed -n "s|^Mem: *\([0-9]*\).*$|\1|p") max_mem=$(LANG=C free -m | sed -n "s|^Mem: *\([0-9]*\).*$|\1|p")
max_jobs="$(($max_mem / $mem_per_process))" max_jobs="$(($max_mem / $mem_per_process))"
test "$CEPH_SMP_NCPUS" -gt "$max_jobs" && CEPH_SMP_NCPUS="$max_jobs" && echo "Warning: Reducing build parallelism to -j$max_jobs because of memory limits" test "$CEPH_SMP_NCPUS" -gt "$max_jobs" && CEPH_SMP_NCPUS="$max_jobs" && echo "Warning: Reducing build parallelism to -j$max_jobs because of memory limits"