aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/make
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/software/make')
-rw-r--r--reproduce/software/make/basic.mk77
-rw-r--r--reproduce/software/make/high-level.mk33
2 files changed, 54 insertions, 56 deletions
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index 628a0e2..cf155f0 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -273,46 +273,10 @@ $(ibidir)/gzip-$(gzip-version): | $(ibdir) $(ildir) $(lockdir)
$(call gbuild, gzip-$(gzip-version), static, , V=1)
echo "GNU Gzip $(gzip-version)" > $@
-# 2022-07-14 B Roukema
-#
-# xz-5.2.5 fails on (at least) CentOS 7 (Redhat) systems while trying
-# to compile 'cmake' in Maneage - this is Maneage bug 62700 [1].
-#
-# The fix appears to be just a few lines, although it's not clear
-# how robust or long-term it is. Since we don't yet have 'patch' in
-# 'basic.mk', this file has to be copied into place rather than patched.
-
-# xz-5.2.5_src_liblzma_liblzma.map is a patched
-# version of xz-5.2.5/src/liblzma/liblzma.map based on discussion at
-# [1] + [2] + the patch file [3].
-#
-# [1] https://savannah.nongnu.org/bugs/index.php?62700
-# [2] https://github.com/easybuilders/easybuild-easyconfigs/issues/14991
-# [3] https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/bcebb3320ffb63f9804ca8d4d64d1822ec7c9792/easybuild/easyconfigs/x/XZ/XZ-5.2.5_compat-libs.patch
$(ibidir)/xz-$(xz-version): $(ibidir)/gzip-$(gzip-version)
-
-# Prepare the tarball.
tarball=xz-$(xz-version).tar.lz
$(call import-source, $(xz-url), $(xz-checksum))
-
-# Until the bug mentioned above is fixed, we'll can't use the generic
-# rule.
-# $(call gbuild, xz-$(xz-version), static)
-
-# Configure and build with patched file.
- srcdir=$$(pwd)
- unpackdir=xz-$(xz-version)
- patchedfile=xz-5.2.5_src_liblzma_liblzma.map
- cd $(ddir)
- rm -rf $$unpackdir
- tar -x -f $(tdir)/$$tarball
- cd $$unpackdir
- cp -pv $$srcdir/reproduce/software/patches/$$patchedfile \
- src/liblzma/liblzma.map # copy the fixed file into place
- ./configure --prefix=$(idir)
- make install
- cd ..
- rm -rf $$unpackdir
+ $(call gbuild, xz-$(xz-version), static)
echo "XZ Utils $(xz-version)" > $@
$(ibidir)/bzip2-$(bzip2-version): $(ibidir)/gzip-$(gzip-version)
@@ -1247,7 +1211,8 @@ $(ibidir)/binutils-$(binutils-version): \
# Build binutils with the standard 'gbuild' function.
$(call gbuild, binutils-$(binutils-version), static, \
- --with-lib-path=$(sys_library_path), \
+ --with-lib-path=$(sys_library_path) \
+ --enable-gprofng=no, \
-j$(numthreads) V=1)
# The 'ld' linker of Binutils needs several '*crt*.o' files from
@@ -1375,21 +1340,35 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
# to avoid building so many small/temporary files and possibly
# harming the hard-drive or SSD. But if the RAM doesn't have enough
# space, we should use the hard-drive or SSD. During its build,
-# GCC's build directory will become about 7GiB (in units of 1024^3
-# bytes, for GCC 12.1.0, which corresponds to 7.5GB, in units of
-# 1000^3 bytes). So at this step, we make sure that we have more
-# than 12GiB before GCC starts to build. See the figure in the link
-# below for GCC's RAM consumption as a function of time:
+# GCC's build directory will become several gigabytes and the build
+# also needs RAM. You can track the RAM usage of the system with a
+# 1-second resolution (if no other RAM consuming program is running
+# while building GCC) with the command below (example outputs can
+# be seen in https://savannah.nongnu.org/task/index.php?16623).
#
-# https://savannah.nongnu.org/task/?16244#comment12
+# c=1; while true; do POSIXLY_CORRECT=1 df -P /dev/shm/maneage-* | awk 'NR==2{print '$c', $3}'; c=$((c+1)); sleep 1; done > mem-usage.txt
+# asttable mem-usage.txt -c1,'arith $2 512 x 1024 / 1024 / 1024 /' -o mem.fits
#
# For POSIX portability and longevity (default sizes might change),
# we use the '-P' option, and we use the environment variable
-# POSIXLY_CORRECT=1, so the 'block size' is 512 bytes. We'll also
-# allow for about ~0.5 GB at the start.
+# POSIXLY_CORRECT=1, so the 'block size' is 512 bytes. In this way,
+# to get the actual GiB amount, multiply the value returned above
+# by 512 (B/block), then divide by 1024^3 (B/GiB).
+#
+# To get the final value to use here, get the maximum used value
+# after GCC is fully built and you have stopped the 'while true'
+# command above. You can do this with the command below (assumes
+# you have Gnuastro).
+#
+# aststatistics mem-usage.txt -c2 --maximum | asttable -c'arith $1 7000000 +' -Afixed -B0
+#
+# The extra space is because we will assume an extra 3 GiB = 3GiB *
+# 1024^3 (B/GiB) / 512 (B/block) = 6291456 blocks are necessary for
+# the building (let's round it to 7000000!).
#
-# So we need 8 GiB * 1024^3 (B/GiB) / 512 blocks/B = 16777216
-# blocks, in blocks of 512 bytes.
+# Therefore, we need to make sure that the running system more than
+# the necessary amount of space in the RAM. To do this, we use 'df'
+# below.
#
# The 4th column of 'df' is the "available" space at the time of
# running, not the full space. So the 'RAM disk' that the OS
@@ -1399,7 +1378,7 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
# alone - no other Maneage software is built at the same time as
# GCC - so this amount of RAM should be enough.
in_ram=$$(POSIXLY_CORRECT=1 df -P $(ddir) \
- | awk 'NR==2{print ($$4>16777216) ? "yes" : "no"}'); \
+ | awk 'NR==2{print ($$4>26613216) ? "yes" : "no"}'); \
if [ $$in_ram = "yes" ]; then odir=$(ddir)
else
odir=$(BDIR)/software/build-tmp-gcc-due-to-lack-of-space
diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk
index fdab193..928d0a2 100644
--- a/reproduce/software/make/high-level.mk
+++ b/reproduce/software/make/high-level.mk
@@ -1098,18 +1098,28 @@ $(ibidir)/cmake-$(cmake-version):
# SHELL=$(SHELL) and we have defined this script.
export MAKE="$(makewshell)"
-# Go into the unpacked directory and build CMake.
+# Go into the unpacked directory and prepare CMake.
cd $(ddir)
rm -rf cmake-$(cmake-version)
tar -xf $(tdir)/$$tarball
cd cmake-$(cmake-version)
$(shsrcdir)/prep-source.sh $(ibdir)
- ./bootstrap --prefix=$(idir) --system-curl --system-zlib \
- --system-bzip2 --system-liblzma --no-qt-gui \
+
+# Bootstrap, build and install CMake:
+# - With the '--no-system-libs' option, CMake builds and statically
+# links all the libraries it needs. Even though some of those (like
+# liblzma, libcurl, zlib or bzip2) are within Maneage, we
+# discovered that CMake can get confused and use out-of-Maneage
+# libraries (https://savannah.nongnu.org/bugs/?63043).
+ ./bootstrap --no-qt-gui \
+ --prefix=$(idir) \
+ --no-system-libs \
--parallel=$(numthreads)
$(makewshell) VERBOSE=1 LIBS="$$LIBS -lssl -lcrypto -lz" \
-j$(numthreads)
$(makewshell) install
+
+# Clean up.
cd ..
rm -rf cmake-$(cmake-version)
echo "CMake $(cmake-version)" > $@
@@ -1960,10 +1970,19 @@ $(itidir)/texlive-ready-tlmgr: reproduce/software/config/texlive.conf
# Live itself (only very basic TeX and LaTeX) and the installation of its
# necessary packages into two packages.
#
-# Note that Biber needs to link with libraries like libnsl. However, we
-# don't currently build biber from source. So we can't choose the library
-# version. But we have the source and build instructions for the 'nsl'
-# library. When we later build biber from source, we can easily use them.
+# Note that we do not build the TeXLive executables (like Biber) from
+# source. So in case they need special libraries, we can't choose the
+# library version here (for example see [1] and [2]). In such cases there
+# is no solution but to manually add the location necessary library to
+# LD_LIBRARY_PATH when calling the respective LaTeX command in
+# 'reproduce/analysis/make/paper.mk'. Fortunately as of Biber 2.20, it does
+# not depend on anything except the C library (all dependencies are now
+# statically linked), so problems [1] and [2] will not happen. But this can
+# generally happen for any other tool/OS, so it is important to build
+# TeXLive from source as soon as possible [3].
+# [1] https://github.com/plk/biber/issues/445
+# [2] https://savannah.nongnu.org/bugs/index.php?63175
+# [3] https://savannah.nongnu.org/task/?15267
$(itidir)/texlive: reproduce/software/config/texlive-packages.conf \
$(itidir)/texlive-ready-tlmgr