aboutsummaryrefslogtreecommitdiff
path: root/reproduce/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/analysis')
-rwxr-xr-xreproduce/analysis/bash/download-multi-try.sh85
-rw-r--r--reproduce/analysis/config/INPUTS.conf2
-rw-r--r--reproduce/analysis/config/delete-me-squared-num.conf2
-rw-r--r--reproduce/analysis/config/metadata.conf2
-rw-r--r--reproduce/analysis/config/pdf-build.conf2
-rw-r--r--reproduce/analysis/config/verify-outputs.conf2
-rw-r--r--reproduce/analysis/make/delete-me.mk16
-rw-r--r--reproduce/analysis/make/initialize.mk167
-rw-r--r--reproduce/analysis/make/paper.mk79
-rw-r--r--reproduce/analysis/make/prepare.mk4
-rw-r--r--reproduce/analysis/make/top-make.mk8
-rw-r--r--reproduce/analysis/make/top-prepare.mk16
-rw-r--r--reproduce/analysis/make/verify.mk43
13 files changed, 286 insertions, 142 deletions
diff --git a/reproduce/analysis/bash/download-multi-try.sh b/reproduce/analysis/bash/download-multi-try.sh
index bea88d5..2df8aab 100755
--- a/reproduce/analysis/bash/download-multi-try.sh
+++ b/reproduce/analysis/bash/download-multi-try.sh
@@ -31,7 +31,7 @@
# reason, you don't want to use a lock file, set the 'lockfile' name to
# 'nolock'.
#
-# Copyright (C) 2019-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2019-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -90,6 +90,61 @@ urlfile=$(echo "$inurl" | awk -F "/" '{print $NF}')
+# Function for downloading
+download_func () {
+
+ # Set the arguments.
+ inurl="$1"
+
+ # During the installation of basic software, the dependencies of the
+ # downloaders that are installed in Maneage can conflict with the
+ # downloader that is not yet installed in Maneage. To avoid this, we
+ # check if the downloader works (with '--version') and remove the
+ # Maneage library temporarily in case it does not.
+ lpathorig=""
+ dprog=$(echo $downloader | awk '{print $1}')
+ if ! $dprog --version > /dev/null 2> /dev/null; then
+ echo "NOTE: the segmentation fault is expected, is not a problem"
+ basedir=$(echo $outname \
+ | sed -e's|\/tarballs\/| |' \
+ | awk '{print $1}')
+ libdir=$basedir/installed/lib
+ lpathorig=$LD_LIBRARY_PATH
+ lpath=$(echo $LD_LIBRARY_PATH \
+ | sed -e's|'$libdir':||')
+ export LD_LIBRARY_PATH=$lpath
+ fi
+
+ # Attempt downloading the file. Note that the 'downloader' ends with
+ # the respective option to specify the output name. For example "wget
+ # -O" (so 'outname', that comes after it) will be the name of the
+ # downloaded file.
+ if [ x"$lockfile" = xnolock ]; then
+ if ! $downloader $outname $inurl; then rm -f $outname; fi
+ else
+ flock "$lockfile" sh -c \
+ "if ! $downloader $outname \"$inurl\"; then rm -f $outname; fi"
+ fi
+
+ # In case the LD_LIBRARY_PATH was changed, set it back to normal.
+ if ! [ x"$lpathorig" = x ]; then
+ export LD_LIBRARY_PATH=$lpathorig
+ fi
+
+ # Some servers return HTTP 4xx/5xx errors as an HTML page with a 200
+ # status, so the downloader exits 0 and saves the HTML body to disk.
+ # Detect this by checking whether the response starts with an HTML tag
+ # and treat it as a failed download so backup servers will be tried.
+ if [ -f "$outname" ] \
+ && head -c 500 "$outname" 2>/dev/null | grep -qi '<html'; then
+ rm -f "$outname"
+ fi
+}
+
+
+
+
+
# Try downloading multiple times before crashing.
counter=0
maxcounter=10
@@ -119,30 +174,22 @@ while [ ! -f "$outname" ]; do
sleep $tstep
fi
- # Attempt downloading the file. Note that the 'downloader' ends with
- # the respective option to specify the output name. For example "wget
- # -O" (so 'outname', that comes after it) will be the name of the
- # downloaded file.
- if [ x"$lockfile" = xnolock ]; then
- if ! $downloader $outname $inurl; then rm -f $outname; fi
- else
- # Try downloading from the requested URL.
- flock "$lockfile" sh -c \
- "if ! $downloader $outname \"$inurl\"; then rm -f $outname; fi"
- fi
+ # First attempt at the download.
+ download_func "$inurl"
# If the download failed, try the backup server(s).
if [ ! -f "$outname" ]; then
if [ x"$backupservers" != x ]; then
for bs in $backupservers; do
- # Use this backup server.
- if [ x"$lockfile" = xnolock ]; then
- if ! $downloader $outname $bs/$urlfile; then rm -f $outname; fi
- else
- flock "$lockfile" sh -c \
- "if ! $downloader $outname $bs/$urlfile; then rm -f $outname; fi"
- fi
+ # For Zenodo backup servers, append '?download=1' as well.
+ bsurl="$bs/$urlfile"
+ case "$bsurl" in
+ *zenodo.org*) bsurl="${bsurl}?download=1" ;;
+ esac
+
+ # Download the file.
+ download_func "$bsurl"
# If the file was downloaded, break out of the loop that
# parses over the backup servers.
diff --git a/reproduce/analysis/config/INPUTS.conf b/reproduce/analysis/config/INPUTS.conf
index 5860806..7373503 100644
--- a/reproduce/analysis/config/INPUTS.conf
+++ b/reproduce/analysis/config/INPUTS.conf
@@ -105,7 +105,7 @@
# also called '%' (if your local copy of the input dataset and the only
# repository names are the same, be sure to set '%' accordingly).
#
-# Copyright (C) 2018-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2018-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
diff --git a/reproduce/analysis/config/delete-me-squared-num.conf b/reproduce/analysis/config/delete-me-squared-num.conf
index ba8c960..80eb60a 100644
--- a/reproduce/analysis/config/delete-me-squared-num.conf
+++ b/reproduce/analysis/config/delete-me-squared-num.conf
@@ -1,6 +1,6 @@
# Number of samples in the demonstration analysis (to be deleted).
#
-# Copyright (C) 2019-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2019-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
diff --git a/reproduce/analysis/config/metadata.conf b/reproduce/analysis/config/metadata.conf
index 1ab7de1..4c95c2f 100644
--- a/reproduce/analysis/config/metadata.conf
+++ b/reproduce/analysis/config/metadata.conf
@@ -15,7 +15,7 @@
# and the copyright license name and standard link to the fully copyright
# license.
#
-# Copyright (C) 2020-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2020-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
diff --git a/reproduce/analysis/config/pdf-build.conf b/reproduce/analysis/config/pdf-build.conf
index 7821306..e0400d3 100644
--- a/reproduce/analysis/config/pdf-build.conf
+++ b/reproduce/analysis/config/pdf-build.conf
@@ -12,7 +12,7 @@
# LaTeX. Otherwise, a notice will just printed that, no PDF will be
# created.
#
-# Copyright (C) 2018-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2018-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
diff --git a/reproduce/analysis/config/verify-outputs.conf b/reproduce/analysis/config/verify-outputs.conf
index 031085d..09cca90 100644
--- a/reproduce/analysis/config/verify-outputs.conf
+++ b/reproduce/analysis/config/verify-outputs.conf
@@ -1,6 +1,6 @@
# To enable verification of output datasets set this variable to 'yes'.
#
-# Copyright (C) 2019-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2019-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
diff --git a/reproduce/analysis/make/delete-me.mk b/reproduce/analysis/make/delete-me.mk
index a20abc6..6bba8ba 100644
--- a/reproduce/analysis/make/delete-me.mk
+++ b/reproduce/analysis/make/delete-me.mk
@@ -1,6 +1,6 @@
# Dummy Makefile to create a random dataset for plotting.
#
-# Copyright (C) 2018-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2018-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,9 +26,9 @@
# and X^2 and draw its plot.
#
# Note that this dataset is directly read by LaTeX to generate a plot, so
-# we need to put it in the $(tex-publish-dir) directory.
-dm-squared = $(tex-publish-dir)/squared.txt
-$(dm-squared): $(pconfdir)/delete-me-squared-num.conf | $(tex-publish-dir)
+# we need to put it in the $(figdir) directory.
+dm-squared = $(figdir)/squared.txt
+$(dm-squared): $(pconfdir)/delete-me-squared-num.conf | $(figdir)
# When the plotted values are re-made, it is necessary to also delete
# the TiKZ externalized files so the plot is also re-made by
@@ -87,10 +87,10 @@ $(dm-img-pdf): $(dm-histdir)/%.pdf: $(indir)/%.fits | $(dm-histdir)
#
# For an example plot, we'll show the pixel value histogram also. IMPORTANT
# NOTE: because this histogram contains data that is included in a plot, we
-# should publish it, so it will go into the $(tex-publish-dir).
-dm-img-histogram = $(tex-publish-dir)/wfpc2-histogram.txt
-$(dm-img-histogram): $(tex-publish-dir)/%-histogram.txt: $(indir)/%.fits \
- | $(tex-publish-dir)
+# should publish it, so it will go into the $(figdir).
+dm-img-histogram = $(figdir)/wfpc2-histogram.txt
+$(dm-img-histogram): $(figdir)/%-histogram.txt: $(indir)/%.fits \
+ | $(figdir)
# When the plotted values are re-made, it is necessary to also delete
# the TiKZ externalized files so the plot is also re-made.
diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk
index 92e5eff..250cb25 100644
--- a/reproduce/analysis/make/initialize.mk
+++ b/reproduce/analysis/make/initialize.mk
@@ -1,6 +1,6 @@
# Project initialization.
#
-# Copyright (C) 2018-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2018-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ bsdir=$(BDIR)/software
# Derived directories (the locks directory can be shared with software
# which already has this directory.).
texdir = $(badir)/tex
-lockdir = $(bsdir)/locks
+lockdir = $(badir)/.locks
indir = $(badir)/inputs
prepdir = $(badir)/prepare
mtexdir = $(texdir)/macros
@@ -53,6 +53,45 @@ pconfdir = reproduce/analysis/config
+# Directories for to-be-published data
+# ------------------------------------
+#
+# Its good practice (so you don't forget in the last moment!) to have all
+# the plot/figure/table data that you ultimately want to publish in a
+# single directory.
+#
+# There are two types of to-publish data in the project.
+#
+# 1. Those data that also go into your figures/plots (for example to give
+# to LateX's PGFPlots package to create the plot internally) should be
+# under the '$(texdir)' directory (because other LaTeX producers may
+# also need it for example when using './project make dist', or you may
+# want to publish the raw data behind the plots, for example see
+# Appendix E of [1]). The contents of this directory are also directly
+# taken into the tarball. As you see in [1], it is best to keep these
+# files in plain-text format.
+#
+# 2. The data that are not included directly in the paper's figures and
+# can be seen as supplements, or a "data release" associated to the
+# report. A good place to keep them is under your build-directory
+# (since the data may be large). These files can be custom formats like
+# FITS files.
+#
+# RECOMMENDATION: don't put the figure/plot/table number in the names of
+# your to-be-published datasets! Given them a descriptive/short name that
+# would be clear to anyone who has read the paper. Later, in the caption
+# (or paper's tex/appendix), you will put links to the dataset on servers
+# like Zenodo (see the "Publication checklist" in 'README-hacking.md').
+#
+# [1] https://scixplorer.org/abs/2026A&A...709A.210E
+drdir = $(badir)/data-release
+figdir = $(texdir)/figures-data
+$(figdir) $(drdir):; mkdir $@
+
+
+
+
+
# Preparation phase
# -----------------
#
@@ -73,7 +112,7 @@ pconfdir = reproduce/analysis/config
ifeq (x$(project-phase),xprepare)
$(prepdir):; mkdir $@
else
--include $(bsdir)/preparation-done.mk
+-include $(badir)/preparation-done.mk
ifeq (x$(include-prepare-results),xyes)
-include $(prepdir)/*.mk $(prepdir)/*.conf
endif
@@ -145,6 +184,7 @@ curdir := $(shell echo $$(pwd))
# avoid conflicts with existing TeX Live solutions. Later (in 'paper.mk'),
# we are also going to overwrite 'TEXINPUTS' just before 'pdflatex'.
.ONESHELL:
+export LC_ALL := C
export TEXINPUTS :=
export CCACHE_DISABLE := 1
export PATH := $(installdir)/bin
@@ -265,16 +305,8 @@ clean:
# executing 'build'.
rm -f *.aux *.log *.synctex *.auxlock *.dvi *.out *.run.xml *.bcf
-# Delete all the built outputs except the dependency programs. We'll
-# use Bash's extended options builtin ('shopt') to enable "extended
-# glob" (for listing of files). It allows extended features like
-# ignoring the listing of a file with '!()' that we are using
-# afterwards.
- shopt -s extglob
- rm -rf $(texdir)/macros/!(dependencies.tex|dependencies-bib.tex|hardware-parameters.tex)
- rm -rf $(badir)/!(tex) $(texdir)/!(macros|$(texbtopdir))
- rm -rf $(texdir)/build/!(tikz) $(texdir)/build/tikz/*
- rm -rf $(bsdir)/preparation-done.mk
+# Delete the full 'badir' (containing all analysis outputs).
+ rm -rf $(badir)
distclean: clean
# Without cleaning the Git hooks, we won't be able to easily commit
@@ -285,7 +317,7 @@ distclean: clean
# 'rm' program. So for this recipe, we'll use the host system's 'rm',
# not our own.
$$sys_rm -rf $(BDIR)
- $$sys_rm -f .local .build $(pconfdir)/LOCAL.conf
+ $$sys_rm -f .local .build
@@ -329,12 +361,11 @@ $(project-package-contents): paper.pdf | $(texdir)
paper.tex > $$dir/paper.tex
# Copy ONLY the version-controlled files in 'reproduce' and
-# 'tex/src'. This is important because files like 'LOCAL.conf' (in
-# 'reproduce/software/config') should not be archived, they contain
-# information about the host computer and are irrelevant for
-# others. Also some project authors may have temporary files here
-# that are not under version control and thus shouldn't be archived
-# (although this is bad practice, but that is up to the user).
+# 'tex/src'. This is important because the git commit hash goes in
+# the tarball name (should correspond to it) and some project authors
+# may have temporary files here that are not under version control
+# and thus shouldn't be archived (although this is bad practice, but
+# that is up to the user).
#
# To keep the sub-directory structure, we are packaging the files
# with Tar, piping it, and unpacking it in the archive directory. So
@@ -362,17 +393,20 @@ $(project-package-contents): paper.pdf | $(texdir)
rm -rf $$dir/tex/build/build*
# If the project has any PDFs in its 'tex/tikz' directory (TiKZ or
-# PGFPlots was used to generate them), copy them too.
+# PGFPlots was used to generate them), copy them too. Note that in
+# the main project source, 'tex/tikz' is just a symbolic link to
+# 'tex/build/tikz'. But inside the tarball we do not want to have
+# symbolic links and they should be independent.
if ls tex/tikz/*.pdf &> /dev/null; then
cp tex/tikz/*.pdf $$dir/tex/tikz
fi
# When submitting to places like arXiv, they will just run LaTeX once
-# and won't run 'biber'. So we need to also keep the '.bbl' file into
-# the distributing tarball. However, BibLaTeX is particularly
-# sensitive to versioning (a '.bbl' file has to be read by the same
-# BibLaTeX version that created it). This is hard to do with
-# non-up-to-date places like arXiv. Therefore, we thus just copy the
+# and won't run 'biber' or 'biblatex'. So we need to also keep the
+# '.bbl' file into the distributing tarball. However, BibLaTeX is
+# particularly sensitive to versioning (a '.bbl' file has to be read
+# by the same BibLaTeX version that created it). This is hard to do
+# with non-up-to-date places like arXiv. Therefore, we just copy the
# whole of BibLaTeX's source (the version we are using) into the top
# tarball directory. In this way, arXiv's LaTeX engine will use the
# same BibLaTeX version to interpret the '.bbl' file. TIP: you can
@@ -521,7 +555,10 @@ $(inputdatasets): $(indir)/%: | $(indir) $(lockdir)
# Unrecognized format.
*)
- echo "Maneage: 'DATABASEAUTHTYPE' format not recognized! Please see the description of this variable in 'reproduce/software/config/LOCAL.conf' for the acceptable values."; exit 1;;
+ printf "Maneage: 'DATABASEAUTHTYPE' format not recognized! "
+ printf "Please see the description of this variable in "
+ printf "'$(bsdir)/config/LOCAL.conf' for the acceptable "
+ printf "values."; exit 1;;
esac
fi
@@ -597,41 +634,6 @@ $(inputdatasets): $(indir)/%: | $(indir) $(lockdir)
-# Directory containing to-be-published datasets
-# ---------------------------------------------
-#
-# Its good practice (so you don't forget in the last moment!) to have all
-# the plot/figure/table data that you ultimately want to publish in a
-# single directory.
-#
-# There are two types of to-publish data in the project.
-#
-# 1. Those data that also go into LaTeX (for example to give to LateX's
-# PGFPlots package to create the plot internally) should be under the
-# '$(texdir)' directory (because other LaTeX producers may also need it
-# for example when using './project make dist', or you may want to
-# publish the raw data behind the plots, like:
-# https://zenodo.org/record/4291207/files/tools-per-year.txt). The
-# contents of this directory are also directly taken into the tarball.
-#
-# 2. The data that aren't included directly in the LaTeX run of the paper,
-# can be seen as supplements. A good place to keep them is under your
-# build-directory.
-#
-# RECOMMENDATION: don't put the figure/plot/table number in the names of
-# your to-be-published datasets! Given them a descriptive/short name that
-# would be clear to anyone who has read the paper. Later, in the caption
-# (or paper's tex/appendix), you will put links to the dataset on servers
-# like Zenodo (see the "Publication checklist" in 'README-hacking.md').
-tex-publish-dir = $(texdir)/to-publish
-data-publish-dir = $(badir)/data-to-publish
-$(tex-publish-dir):; mkdir $@
-$(data-publish-dir):; mkdir $@
-
-
-
-
-
# Print Copyright statement
# -------------------------
#
@@ -688,27 +690,40 @@ $(mtexdir)/initialize.tex:
# Calculate the latest Maneage commit used to build this project:
# - The project may not have the 'maneage' branch (for example
# after cloning from a fork that didn't include it!). In this
-# case, we'll print a descriptive warning, telling the user what
-# should be done (reporting the last merged commit and its date
-# is very useful for the future).
+# case, if a PDF is to be created, print a descriptive warning,
+# telling the user what should be done (reporting the last merged
+# commit and its date is very useful for the future).
+# - This is not relevant when no PDF is requested because we only
+# use this to print the latest Maneage commit as a LaTeX macro.
# - The '--dirty' option (used in 'project-commit-hash') isn't
# applicable to "commit-ishes" (direct quote from Git's error
-# message!).
+# message!), so no need to include it here.
if git log maneage -1 &> /dev/null; then
c=$$(git merge-base HEAD maneage)
v=$$(git describe --always --long $$c)
d=$$(git show -s --format=%aD $$v | awk '{print $$2, $$3, $$4}')
+
+# No 'maneage' branch found
else
- echo
- echo "WARNING: no 'maneage' branch found! Without it, the latest merge of "
- echo "this project with Maneage can't be reported in the paper (which is bad "
- echo "for your readers; that includes yourself in a few years). Please run "
- echo "the commands below to fetch the 'maneage' branch from its own server "
- echo "and remove this warning (these commands will not affect your project):"
- echo " $ git remote add origin-maneage http://git.maneage.org/project.git"
- echo " $ git fetch origin-maneage"
- echo " $ git branch maneage --track origin-maneage/maneage"
- echo
+
+# Only print a warning if a PDF is to be created.
+ if [ x$(pdf-build-final) = xyes ]; then
+ echo
+ printf "WARNING: no 'maneage' branch found! Without it, "
+ printf "the latest merge of this project with Maneage can't "
+ printf "be reported in the paper (which is bad for your "
+ printf "readers; that includes yourself in a few years). "
+ printf "Please run the commands below to fetch the "
+ printf "'maneage' branch from its own server and remove "
+ printf "this warning (these commands will not affect your "
+ printf "project):\n"
+ printf " $ git remote add origin-maneage "
+ printf "http://git.maneage.org/project.git\n"
+ printf " $ git fetch origin-maneage\n"
+ printf " $ git branch maneage --track "
+ printf "origin-maneage/maneage\n"
+ echo
+ fi
v="\textcolor{red}{NO-MANEAGE-BRANCH (see printed warning to fix this)}"
d="\textcolor{red}{NO-MANEAGE-DATE}"
fi
diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk
index 66c6859..c218cdd 100644
--- a/reproduce/analysis/make/paper.mk
+++ b/reproduce/analysis/make/paper.mk
@@ -1,6 +1,6 @@
# Build the final PDF paper/report.
#
-# Copyright (C) 2018-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2018-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,6 +18,22 @@
+
+# Software info in TeX
+# --------------------
+#
+# The information of the installed software is placed in the
+# '.build/software' directory (which the TeX build should not depend
+# on). Therefore, we should copy those macros here in the LaTeX build
+# directory, so the TeX directory is completely independent from each
+# other.
+$(mtexdir)/dependencies.tex: $(bsdir)/config/dependencies.tex
+ cp $(bsdir)/config/*.tex $(mtexdir)/
+
+
+
+
+
# LaTeX macros for paper
# ----------------------
#
@@ -39,19 +55,36 @@
# Note that if you don't want the final PDF and just want the processing
# and file outputs, you can give any value other than 'yes' to
# 'pdf-build-final' in 'reproduce/analysis/config/pdf-build.conf'.
-$(mtexdir)/project.tex: $(mtexdir)/verify.tex
+$(mtexdir)/project.tex: $(mtexdir)/verify.tex $(mtexdir)/dependencies.tex
# If no PDF is requested, or if LaTeX isn't available, don't continue
# to building the final PDF. Otherwise, merge all the TeX macros into
# one for building the PDF.
- @if [ -f .local/bin/pdflatex ] && [ x"$(pdf-build-final)" = xyes ]; then
+ @if [ -f .local/bin/pdflatex ] && [ x"$(pdf-build-final)" = xyes ];
+ then
# Put a LaTeX input command for all the necessary macro files.
-# 'hardware-parameters.tex' is created in 'configure.sh'.
+# Note that 'hardware-parameters.tex' is created in 'configure.sh'
+# (which is why it is first in the list).
projecttex=$(mtexdir)/project.tex
rm -f $$projecttex
- for t in $(subst paper,,$(makesrc)) hardware-parameters; do
- echo "\input{tex/build/macros/$$t.tex}" >> $$projecttex
+ for t in hardware-parameters $(subst paper,,$(makesrc)); do
+
+# Only add the macro file to 'project.tex' if the macro file is
+# not empty. Empty macro files are not a bug in Maneage alone: 1)
+# the processing of a sub-Makefile may not need to produce any
+# written macro for the PDF, and that is perfectly fine. 2) LaTeX
+# can also '\input' an empty file. However, it is important for
+# for publication servers (like arXiv) that do not allow
+# uploading empty files. Therefore, when 'project.tex' contains
+# empty files, such severs will not be able compile the PDF
+# because the file name is mentioned in 'project.tex', but cannot
+# be found in the uploaded files.
+ tfile=tex/build/macros/$$t.tex
+ if [ -s $$tfile ]; then
+ echo "\input{$$tfile}" >> $$projecttex
+ fi
+
done
# Possibly highlight the '\new' parts of the text.
@@ -92,6 +125,23 @@ $(mtexdir)/project.tex: $(mtexdir)/verify.tex
+# TeX build directory
+# -------------------
+#
+# If built in a group scenario, the TeX build directory must be separate
+# for each member (so they can work on their relevant parts of the paper
+# without conflicting with each other).
+ifeq ($(strip $(maneage_group_name)),)
+texbdir:=$(texdir)/build
+else
+texbdir:=$(texdir)/build-$(shell whoami)
+endif
+tikzdir:=$(texbdir)/tikz
+
+
+
+
+
# The bibliography
# ----------------
#
@@ -104,8 +154,8 @@ $(mtexdir)/project.tex: $(mtexdir)/verify.tex
# recipe and the 'paper.pdf' recipe. But if 'tex/src/references.tex' hasn't
# been modified, we don't want to re-build the bibliography, only the final
# PDF.
-$(texbdir)/paper.bbl: tex/src/references.tex $(mtexdir)/dependencies-bib.tex \
- | $(mtexdir)/project.tex
+$(texbdir)/paper.bbl: tex/src/references.tex | $(mtexdir)/project.tex
+
# If '$(mtexdir)/project.tex' is empty, don't build PDF.
@macros=$$(cat $(mtexdir)/project.tex)
if [ x"$$macros" != x ]; then
@@ -130,12 +180,11 @@ $(texbdir)/paper.bbl: tex/src/references.tex $(mtexdir)/dependencies-bib.tex \
# for details.
#
# We need the modification to 'LD_LIBRARY_PATH' because we do not
-# build LaTeX from source and it uses '/bin/sh' (among other
-# possible system-wide things).
- export LD_LIBRARY_PATH="$(sys_library_sh_path):$$LD_LIBRARY_PATH"
+# build LaTeX from source and it (or its packages) may use
+# '/bin/sh' (among other possible system-wide things).
+ export LD_LIBRARY_PATH="$(SYS_LIBRARY_SH_PATH):$$LD_LIBRARY_PATH"
pdflatex -shell-escape -halt-on-error "$$p"/paper.tex
biber paper
-
fi
@@ -165,9 +214,9 @@ paper.pdf: $(mtexdir)/project.tex paper.tex $(texbdir)/paper.bbl
# option '-shell-escape'.
#
# We need the modification to 'LD_LIBRARY_PATH' because we do not
-# build LaTeX from source and it uses '/bin/sh' (among other
-# possible system-wide things).
- export LD_LIBRARY_PATH="$(sys_library_sh_path):$$LD_LIBRARY_PATH"
+# build LaTeX from source and it (or its packages) may use
+# '/bin/sh' (among other possible system-wide things).
+ export LD_LIBRARY_PATH="$(SYS_LIBRARY_SH_PATH):$$LD_LIBRARY_PATH"
pdflatex -shell-escape -halt-on-error "$$p"/paper.tex
# Come back to the top project directory and copy the built PDF
diff --git a/reproduce/analysis/make/prepare.mk b/reproduce/analysis/make/prepare.mk
index 2cc1187..352fd00 100644
--- a/reproduce/analysis/make/prepare.mk
+++ b/reproduce/analysis/make/prepare.mk
@@ -1,6 +1,6 @@
# Basic preparations, called by './project make'.
#
-# Copyright (C) 2019-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2019-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#
# We need to remove the 'prepare' word from the list of 'makesrc'.
prepare-dep = $(filter-out prepare, $(makesrc))
-$(bsdir)/preparation-done.mk: \
+$(badir)/preparation-done.mk: \
$(foreach s, $(prepare-dep), $(mtexdir)/$(s).tex)
# If you need to add preparations (mainly automatically generated
diff --git a/reproduce/analysis/make/top-make.mk b/reproduce/analysis/make/top-make.mk
index 2689e64..7286ca6 100644
--- a/reproduce/analysis/make/top-make.mk
+++ b/reproduce/analysis/make/top-make.mk
@@ -1,6 +1,6 @@
# Top-level Makefile (first to be loaded).
#
-# Copyright (C) 2018-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2018-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,9 +19,9 @@
-# Load the local configuration (created after running
-# './project configure').
-include reproduce/software/config/LOCAL.conf
+# Load the local configuration (created after running './project
+# configure').
+include .build/software/config/LOCAL.conf
diff --git a/reproduce/analysis/make/top-prepare.mk b/reproduce/analysis/make/top-prepare.mk
index 7d92d72..913a062 100644
--- a/reproduce/analysis/make/top-prepare.mk
+++ b/reproduce/analysis/make/top-prepare.mk
@@ -4,7 +4,7 @@
# are not included here. Please see that file for thorough comments on each
# step.
#
-# Copyright (C) 2019-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2019-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,9 +23,9 @@
-# Load the local configuration (created after running
-# './project configure').
-include reproduce/software/config/LOCAL.conf
+# Load the local configuration (created after running './project
+# configure').
+include .build/software/config/LOCAL.conf
@@ -36,16 +36,16 @@ include reproduce/software/config/LOCAL.conf
#
# See 'top-make.mk' for complete explanation.
ifeq (x$(maneage_group_name),x$(GROUP-NAME))
-all: $(BDIR)/software/preparation-done.mk
+all: $(BDIR)/analysis/preparation-done.mk
@echo "Project preparation is complete.";
else
all:
@if [ "x$(GROUP-NAME)" = x ]; then \
echo "Project is NOT configured for groups, please run"; \
- echo " $$ ./project prepare"; \
+ echo " $$ ./project configure"; \
else \
echo "Project is configured for groups, please run"; \
- echo " $$ ./project prepare --group=$(GROUP-NAME) -j8"; \
+ echo " $$ ./project configure --group=$(GROUP-NAME) -j8"; \
fi
exit 1
endif
@@ -61,7 +61,7 @@ endif
#
# To ensure that 'prepare' and 'make' have the same basic definitions and
# environment and that all 'downloads' are managed in one place, both
-# './project prepare' and './project make' will first read 'initialize.mk'
+# './project configure' and './project make' will first read 'initialize.mk'
# and 'downloads.mk'.
makesrc = initialize \
prepare
diff --git a/reproduce/analysis/make/verify.mk b/reproduce/analysis/make/verify.mk
index c74f8ca..91c4b77 100644
--- a/reproduce/analysis/make/verify.mk
+++ b/reproduce/analysis/make/verify.mk
@@ -1,6 +1,6 @@
# Verify the project outputs before building the paper.
#
-# Copyright (C) 2020-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2020-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -138,11 +138,44 @@ $(mtexdir)/verify.tex: $(foreach s, $(verify-dep), $(mtexdir)/$(s).tex)
# Verify TeX macros (the values that go into the PDF text).
for m in $(verify-check); do
- file=$(mtexdir)/$$m.tex
- if [ $$m == delete-me ]; then s=711e2f7fa1f16ecbeeb3df6bcb4ec705
- else echo; echo "'$$m' not recognized."; exit 1
+
+# Set the macro file name, make sure it exists (the user may have
+# forgot to create it in the respective sub-Makefile).
+ tfile=$(mtexdir)/$$m.tex
+ if ! [ -f $$tfile ]; then
+ printf "$$tfile: ERROR: does not exist! If you do not "
+ printf "(currently) plan macros to be added to the final "
+ printf "PDF from that sub-Makefile, do the following to "
+ printf "avoid this error: put a 'touch \$$@' as the recipe "
+ printf "of the '\$$(mtexdir)/$$m.tex' target (at the bottom "
+ printf "of 'reproduce/analysis/make/$$m.mk'). If you later "
+ printf "decide to define macros there, simply replace the "
+ printf "temporary 'touch \$$@' command with the command(s) "
+ printf "to prepare/write the macro (see 'initialize.mk' "
+ printf "as an example)\n";
+ exit 1
fi
- $(call verify-txt-no-comments-no-space, $$file, $$s, $@.tmp)
+
+# Check the hash for this file and verify it.
+ case $$m in
+ delete-me) s=711e2f7fa1f16ecbeeb3df6bcb4ec705;;
+ *) # This file's hash is not in the list above.
+
+# If the file is empty, we can skip it (with the 'continue'
+# command). Otherwise, the user should be informed with an
+# error.
+ if [ -s $$tfile ]; then
+ printf "$$tfile: ERROR: please add the hash of this "
+ printf "macro file to the list of hashes above this "
+ printf "error message (in "
+ printf "'reproduce/analysis/make/verify.mk')\n"; exit 1
+ else
+ continue
+ fi
+ ;;
+ esac
+ $(call verify-txt-no-comments-no-space, $$tfile, $$s, $@.tmp)
+
done
# Move temporary file to final target.