aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2019-07-28 02:32:20 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2019-07-28 02:53:34 +0100
commit6ef4cc854d1df46b719de5d66b45537b0aa11f92 (patch)
treea4b9680ef483167e41089a4a8b911cca70c11164
parent8847155563e25aa70663413f6a8dc9657ca79993 (diff)
Single wrapper instead of old ./configure, Makefile and ./for-group
Until now, to work on a project, it was necessary to `./configure' it and build the software. Then we had to run `.local/bin/make' to run the project and do the analysis every time. If the project was a shared project between many users on a large server, it was necessary to call the `./for-group' script. This way of managing the project had a major problem: since the user directly called the lower-level `./configure' or `.local/bin/make' it was not possible to provide high-level control (for example limiting the environment variables). This was especially noticed recently with a bug that was related to environment variables (bug #56682). With this commit, this problem is solved using a single script called `project' in the top directory. To configure and build the project, users can now run these commands: $ ./project configure $ ./project make To work on the project with other users in a group these commands can be used: $ ./project configure --group=GROUPNAME $ ./project make --group=GROUPNAME The old options to both configure and make the project are still valid. Run `./project --help' to see a list. For example: $ ./project configure -e --host-cc $ ./project make -j8 The old `configure' script has been moved to `reproduce/software/bash/configure.sh' and is called by the new `./project' script. The `./project' script now just manages the options, then passes control to the `configure.sh' script. For the "make" step, it also reads the options, then calls Make. So in the lower-level nothing has changed. Only the `./project' script is now the single/direct user interface of the project. On a parallel note: as part of bug #56682, we also found out that on some macOS systems, the `DYLD_LIBRARY_PATH' environment variable has to be set to blank. This is no problem because RPATH is automatically set in macOS and the executables and libraries contain the absolute address of the libraries they should link with. But having `DYLD_LIBRARY_PATH' can conflict with some low-level system libraries and cause very hard to debug linking errors (like that reported in the bug report). This fixes bug #56682.
-rw-r--r--.file-metadatabin6106 -> 6239 bytes
-rw-r--r--README-hacking.md140
-rw-r--r--README.md12
-rwxr-xr-xfor-group114
-rwxr-xr-xproject291
-rw-r--r--reproduce/analysis/make/initialize.mk20
-rw-r--r--reproduce/analysis/make/paper.mk6
-rw-r--r--reproduce/analysis/make/top.mk12
-rwxr-xr-xreproduce/software/bash/configure.sh (renamed from configure)285
-rw-r--r--reproduce/software/config/installation/LOCAL.mk.in4
-rwxr-xr-xreproduce/software/make/atlas-multiple.mk4
-rwxr-xr-xreproduce/software/make/atlas-single.mk4
-rw-r--r--reproduce/software/make/basic.mk10
-rw-r--r--reproduce/software/make/high-level.mk13
-rw-r--r--reproduce/software/make/python.mk4
15 files changed, 479 insertions, 440 deletions
diff --git a/.file-metadata b/.file-metadata
index af859e9..1e4b3c5 100644
--- a/.file-metadata
+++ b/.file-metadata
Binary files differ
diff --git a/README-hacking.md b/README-hacking.md
index 375bf85..cf2e332 100644
--- a/README-hacking.md
+++ b/README-hacking.md
@@ -240,10 +240,10 @@ first understand its architecture so you can navigate your way in the
directories and understand how to implement your research project within
its framework: where to add new files and which existing files to modify
for what purpose. But before reading this theoretical discussion, please
-run the template (described in `README.md`: first run `./configure`, then
-`.local/bin/make -j8`) without any change, just to see how it works (note
-that the configure step builds all necessary software, so it can take long,
-but you can read along while its working).
+run the template (described in `README.md`: first run `./project
+configure`, then `./project make -j8`) without any change, just to see how
+it works (note that the configure step builds all necessary software, so it
+can take long, but you can read along while its working).
The project has two top-level directories: `reproduce` and
`tex`. `reproduce` hosts all the software building and analysis
@@ -253,24 +253,21 @@ a PDF using LaTeX.
The `reproduce` directory has two sub-directories: `software` and
`analysis`. As the name says, the former contains all the instructions to
download, build and install (independent of the host operating system) the
-necessary software (these are called by the `./configure` script). The
-latter contains instructions on how to use those software to do your
-project's analysis.
-
-After it finishes, `./configure` will create the following symbolic links
-in the project's top source directory: 1) `Makefile` in the top directory
-(which points to `reproduce/analysis/make/top.mk`). 2) `.build` which
-points to the top build directory.And 3) `.local` for easy access to the
-custom built software packages installation directory. The first is for
-practical necessity (so you can run `make` from the top source directory),
-but the latter is just for convenience (fast access to the built outputs
-and software).
-
-Therefore, by running `.local/bin/make` we are doing the project's analysis
-with its own custom version of GNU Make, not the host system's Make. The
-first file that is read by Make (the template's starting point) is the
-top-level `Makefile` (created by `./configure`). Therefore, we'll start
-describing the template's architecture with this file. This file is
+necessary software (these are called by the `./project configure`
+command). The latter contains instructions on how to use those software to
+do your project's analysis.
+
+After it finishes, `./project configure` will create the following symbolic
+links in the project's top source directory: `.build` which points to the
+top build directory and `.local` for easy access to the custom built
+software installation directory.
+
+Once the project is configured for your system, `./project make` will doing
+the project's analysis with its own custom version of software. The process
+is managed through Make and `./project make` will start with
+`reproduce/analysis/make/top.mk` (called `top.mk` from now on).
+
+Let's continue the template's architecture with this file. `top.mk` is
relatively short and heavily commented so hopefully the descriptions in
each comment will be enough to understand the general details. As you read
this section, please also look at the contents of the mentioned files and
@@ -286,13 +283,13 @@ strategy to deal with large/huge files).
To keep the source and (intermediate) built files separate, you _must_
define a top-level build directory variable (or `$(BDIR)`) to host all the
-intermediate files (you defined it during `./configure`). This directory
-doesn't need to be version controlled or even synchronized, or backed-up in
-other servers: its contents are all products, and can be easily re-created
-any time. As you define targets for your new rules, it is thus important to
-place them all under sub-directories of `$(BDIR)`. As mentioned above, you
-always have fast access to this "build"-directory with the `.build`
-symbolic link.
+intermediate files (you defined it during `./project configure`). This
+directory doesn't need to be version controlled or even synchronized, or
+backed-up in other servers: its contents are all products, and can be
+easily re-created any time. As you define targets for your new rules, it is
+thus important to place them all under sub-directories of `$(BDIR)`. As
+mentioned above, you always have fast access to this "build"-directory with
+the `.build` symbolic link.
In this architecture, we have two types of Makefiles that are loaded into
the top `Makefile`: _configuration-Makefiles_ (only independent
@@ -301,13 +298,13 @@ actually contain analysis/processing rules).
The configuration-Makefiles are those that satisfy these two wildcards:
`reproduce/software/config/installation/*.mk` (for building the necessary
-software when you run `./configure`) and `reproduce/analysis/config/*.mk`
-(for the high-level analysis, when you run `.local/bin/make`). These
-Makefiles don't actually have any rules, they just have values for various
-free parameters throughout the configuration or analysis. Open a few of
-them to see for yourself. These Makefiles must only contain raw Make
-variables (project configurations). By "raw" we mean that the Make
-variables in these files must not depend on variables in any other
+software when you run `./project configure`) and
+`reproduce/analysis/config/*.mk` (for the high-level analysis, when you run
+`./project make`). These Makefiles don't actually have any rules, they just
+have values for various free parameters throughout the configuration or
+analysis. Open a few of them to see for yourself. These Makefiles must only
+contain raw Make variables (project configurations). By "raw" we mean that
+the Make variables in these files must not depend on variables in any other
configuration-Makefile. This is because we don't want to assume any order
in reading them. It is also very important to *not* define any rule, or
other Make construct, in these configuration-Makefiles.
@@ -343,18 +340,17 @@ users of a Unix group (when working on large computer clusters). In this
scenario, each user can have their own cloned project source, but share the
large built files between each other. To do this, it is necessary for all
built files to give full permission to group members while not allowing any
-other users access to the contents. Therefore the `./configure` and Make
-steps must be called with special conditions which are managed in the
-`for-group` script.
-
-Let's see how this design is implemented. The `./configure` script's final
-step is to put a `Makefile` in the top directory. This allows us to start
-"making" the project. Please open and inspect it as we go along here. The
-first step (un-commented line) is to import the local configuration
-(answers to the questions `./configure` asked you). They are defined in the
-configuration-Makefile `reproduce/software/config/installation/LOCAL.mk`
-which was also built by `./configure` (based on the `LOCAL.mk.in` template
-of the same directory).
+other users access to the contents. Therefore the `./project configure` and
+`./project make` steps must be called with special conditions which are
+managed in the `--group` option.
+
+Let's see how this design is implemented. Please open and inspect `top.mk`
+it as we go along here. The first step (un-commented line) is to import the
+local configuration (your answers to the questions of `./project
+configure`). They are defined in the configuration-Makefile
+`reproduce/software/config/installation/LOCAL.mk` which was also built by
+`./project configure` (based on the `LOCAL.mk.in` template of the same
+directory).
The next non-commented set of the top `Makefile` defines the ultimate
target of the whole project (`paper.pdf`). But to avoid mistakes, a sanity
@@ -450,10 +446,10 @@ Customization checklist
=======================
Take the following steps to fully customize this template for your research
-project. After finishing the list, be sure to run `./configure` and `make`
-to see if everything works correctly before expanding it. If you notice
-anything missing or any in-correct part (probably a change that has not
-been explained here), please let us know to correct it.
+project. After finishing the list, be sure to run `./project configure` and
+`project make` to see if everything works correctly. If you notice anything
+missing or any in-correct part (probably a change that has not been
+explained here), please let us know to correct it.
As described above, the concept of reproducibility (during a project)
heavily relies on [version
@@ -487,21 +483,21 @@ get more advanced in later stages of your work.
- **Test the template**: Before making any changes, it is important to
test it and see if everything works properly with the commands
- below. If there is any problem in the `./configure` or `make` steps,
- please contact us to fix the problem before continuing. Since the
- building of dependencies in `./configure` can take long, you can take
- the next few steps (editing the files) while its working (they don't
- affect the configuration). After `make` is finished, open `paper.pdf`
- and if it looks fine, you are ready to start customizing the template
- for your project. But before that, clean all the extra template
- outputs with `make clean` as shown below.
+ below. If there is any problem in the `./project configure` or
+ `./project make` steps, please contact us to fix the problem before
+ continuing. Since the building of dependencies in configuration can
+ take long, you can take the next few steps (editing the files) while
+ its working (they don't affect the configuration). After `./project
+ make` is finished, open `paper.pdf`. If it looks fine, you are ready
+ to start customizing the template for your project. But before that,
+ clean all the extra template outputs with `make clean` as shown below.
```shell
- $ ./configure --host-cc # Set top directories and build dependencies (except for GCC which can take long).
- $ .local/bin/make # Do the (mainly symbolic) processing and build paper
+ $ ./project configure --host-cc # Configure project (except for GCC which can take long).
+ $ ./project make # Do the (mainly symbolic) processing and build paper
# Open 'paper.pdf' and see if everything is ok.
- $ .local/bin/make clean # Delete high-level outputs.
+ $ ./project make clean # Delete high-level outputs (keep software)
```
- **Setup the remote**: You can use any [hosting
@@ -636,8 +632,8 @@ get more advanced in later stages of your work.
commit to be sure it works as expected).
```shell
- $ .local/bin/make clean # Delete outputs ('make distclean' for everything)
- $ .local/bin/make # Build the project to ensure everything is fine.
+ $ ./project make clean # Delete outputs ('make distclean' for everything)
+ $ ./project make # Build the project to ensure everything is fine.
$ git add -u # Stage all the changes.
$ git status # Make sure everything is fine.
$ git commit # Your first commit, add a nice description.
@@ -711,7 +707,7 @@ get more advanced in later stages of your work.
script will crash). To do that, just modify the years in
`reproduce/software/config/installation/texlive.conf`, then delete
`.build/software/tarballs/install-tl-unx.tar.gz`. The next time you
- run `./configure`, the new TeXLive will be installed and used.
+ run `./project configure`, the new TeXLive will be installed and used.
- **Pre-publication: add notice on reproducibility**: Add a notice
somewhere prominent in the first page within your paper, informing the
@@ -967,12 +963,12 @@ for the benefit of others.
[reproducible-paper-output](https://gitlab.com/makhlaghi/reproducible-paper-output)
repository.
- - **Inspecting status**: When you run `./configure`, several programs and
- libraries start to get configured and build (in many cases,
- simultaneously). To understand the building process, or for debugging a
- strange situation, it is sometimes useful to know which programs are
- being built at every moment. To do this, you can look into the
- `.build/software/build-tmp` directory (from the top project
+ - **Inspecting status**: When you run `./project configure`, several
+ programs and libraries start to get configured and build (in many
+ cases, simultaneously). To understand the building process, or for
+ debugging a strange situation, it is sometimes useful to know which
+ programs are being built at every moment. To do this, you can look
+ into the `.build/software/build-tmp` directory (from the top project
directory). This temporary directory is only present while building
the software. At every moment, it contains the unpacked source tarball
directories of the all the packages that are being built. After a
diff --git a/README.md b/README.md
index 212e178..bb46fe0 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,8 @@ a compressed tarball of the project).
```shell
$ git clone XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-$ ./configure
-$ .local/bin/make -j8
+$ ./project configure
+$ ./project make -j8
```
For a general introduction to reproducible science as implemented in this
@@ -44,8 +44,8 @@ This project was designed to have as few dependencies as possible.
1.1: Minimal software building tools like C compiler, Make, and other
tools found on any Unix-like operating system (GNU/Linux, BSD, Mac
OS, and others). All necessary dependencies will be built from
- source (for use only within this project) by the `./configure'
- script (next step).
+ source (for use only within this project) by the `./project
+ configure' script (next step).
1.2: (OPTIONAL) Tarball of dependencies. If they are already present (in
a directory given at configuration time), they will be
@@ -69,7 +69,7 @@ This project was designed to have as few dependencies as possible.
programs (project dependencies). So it may take a while to complete.
```shell
- $ ./configure
+ $ ./project configure
```
3. Run the following command (local build of the Make software) to
@@ -79,7 +79,7 @@ This project was designed to have as few dependencies as possible.
system by running `./.local/bin/nproc`)
```shell
- $ .local/bin/make -j8
+ $ ./project make -j8
```
diff --git a/for-group b/for-group
deleted file mode 100755
index e5c55f9..0000000
--- a/for-group
+++ /dev/null
@@ -1,114 +0,0 @@
-#! /bin/bash
-#
-# Running examples:
-#
-# $ ./for-group group_name configure [OPTIONS]
-# $ ./for-group group_name make [OPTIONS]
-#
-# This is a wrapper for the configure and Make steps designed for a group
-# of users (sharing the same group name) working on the project in the same
-# build directory.
-#
-# When the configuration (normally done with `./configure') and build
-# (normally done with `.local/bin/make') steps are done with this script,
-# all the files that are created within the project will have these
-# properties:
-#
-# 1) Group owner will be the group specified in the command-line.
-# 2) The permission flags give write access to the group members.
-#
-# Copyright (C) 2019, Mohammad Akhlaghi <mohammad@akhlaghi.org>
-#
-# This script is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This script is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# A copy of the GNU General Public License is available at
-# <http://www.gnu.org/licenses/>.
-
-
-
-
-
-# Script settings
-# ---------------
-# Stop the script if there are any errors.
-set -e
-
-
-
-
-
-# See if any argument are given at all.
-if [ "x$1" = x ]; then
- echo "$0: At least two arguments are necessary:"
- echo
- echo " To configure: $ ./for-group group_name configure"
- echo " To build: $ ./for-group group_name make"
- exit 1
-fi
-
-
-
-
-
-# Prepare any other argument to pass onto the `./configure' or `make'
-# commands. `$@' is the list of command-line tokens given to the this
-# (`./for-group') script. Therefore, the first token in it is the group
-# name and the second is the script name. As a result, we want anything
-# after the third token.
-options=$(echo "$@" | awk '{for(i=3;i<=NF;++i) printf("%s ", $i)}')
-
-
-
-
-
-# Make sure the given group is usable.
-if sg "$1" "echo test &> /dev/null" &> /dev/null; then
- if [ "x$2" = xconfigure ]; then script="./configure"
- elif [ "x$2" = xmake ]; then script=".local/bin/make"
- else
- echo "$0: a third argument is necessary."
- echo "It specifies the action: either 'configure' or 'make'"
- exit 1
- fi
-else
- echo "$0: '$1' is not a usable group name on this system.";
- echo "TIP: you can use the 'groups' command to see your groups."
- exit 1
-fi
-
-
-
-
-
-# Define the group, and set the permission so the user and group both have
-# read and write permissions. Then run the respective script.
-#
-# We are also exporting a special variable so `./configure' and Make can
-# prepare for sanity checks and avoid re-doing the whole analysis with a
-# typo (not using this script properly after configuration).
-export reproducible_paper_group_name="$1"
-sg "$1" "umask u+r,u+w,g+r,g+w,o-r,o-w,o-x && $script $options"
-
-
-
-
-
-# Group writing permissions for dependencies directory
-#
-# The common build process sets the writing permissions of the installed
-# programs/libraries to `755'. So group members can't write over a
-# file. This creates problems when another group member wants to update the
-# software for example. We thus need to manually add the group writing flag
-# to all installed software files.
-if [ "x$2" = xconfigure ]; then
- echo "Enabling group writing permission on all installed software..."
- .local/bin/chmod -R g+w .local/;
-fi
diff --git a/project b/project
new file mode 100755
index 0000000..b366e00
--- /dev/null
+++ b/project
@@ -0,0 +1,291 @@
+#!/bin/bash
+#
+# High-level script to manage the project.
+# Run `./project --help' for a description of how to use it.
+#
+# Copyright (C) 2019 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+#
+# This script is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This script is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details. See <http://www.gnu.org/licenses/>.
+
+
+# Basic settings
+# --------------
+# Stop the script if there are any errors.
+set -e
+
+# Default option values
+jobs=0 # 0 is for the default for the `configure.sh' script.
+group=
+debug=
+host_cc=0
+operation=
+build_dir=
+input_dir=
+make_targets=
+software_dir=
+existing_conf=0
+scriptname="./project"
+minmapsize=10000000000
+
+
+
+
+
+# Parse the options
+# -----------------
+#
+# Separate command-line arguments from options. Then put the option value
+# into the respective variable.
+#
+# Each option has two lines because we want to process both these formats:
+# `--name=value' and `--name value'. The former (with `=') is a single
+# command-line argument, so we just need to shift the counter by one. The
+# latter (without `=') is two arguments, so we'll need two shifts.
+#
+# Note on the case strings: for every option, we need three lines: one when
+# the option name and value are separate. Another when there is an equal
+# between them, and finally one where the value is immediately after the
+# short-format. This exact order is important. Otherwise, there will be a
+# conflict between them.
+
+print_help() {
+ # Print the output.
+ cat <<EOF
+Usage: $scriptname configure [OPTIONS]
+ $scriptname make [OPTIONS]
+
+Top-level script to manage the reproducible project. The high-level
+operation is defined by the (mandatory) second argument:
+
+ configure - Configure project for this machine (e.g., build software).
+ make - Run the project (do analysis and build outputs).
+
+RECOMMENDATION: If this is the first time you are configuring this
+template, please don't use the options and let the script explain each
+parameter in full detail by simply running './project configure'.
+
+With the options below you can modify the default behavior.
+
+Configure options:
+ -b, --build-dir=STR Top directory to build the project in.
+ -e, --existing-conf Use (possibly existing) local configuration.
+ --host-cc Use host system's C compiler, don't build GCC.
+ -i, --input-dir=STR Directory containing input datasets (optional).
+ -m, --minmapsize=INT [Gnuastro] Minimum number of bytes to use RAM.
+ -s, --software-dir=STR Directory containing necessary software tarballs.
+
+Configure and Make options:
+ -g, --group=STR Build and run with write permissions for a group.
+ -j, --jobs=INT Number of threads to build/run the software.
+ -?, --help Print this help list.
+
+Make options:
+ -d, --debug=FLAGS Print various types of debugging information.
+
+Mandatory or optional arguments to long options are also mandatory or optional
+for any corresponding short options.
+
+Reproducible paper template: https://gitlab.com/makhlaghi/reproducible-paper
+
+Report bugs to mohammad@akhlaghi.org
+EOF
+}
+
+on_off_option_error() {
+ if [ "x$2" = x ]; then
+ echo "$scriptname: '$1' doesn't take any values."
+ else
+ echo "$scriptname: '$1' (or '$2') doesn't take any values."
+ fi
+ exit 1
+}
+
+check_v() {
+ if [ x"$2" = x ]; then
+ echo "$scriptname: option '$1' requires an argument."
+ echo "Try '$scriptname --help' for more information."
+ exit 1;
+ fi
+}
+
+func_operation_set() {
+ if [ x$operation = x ]; then
+ operation=$1
+ else
+ echo "Only one operation ('configure' or 'make') may be given."
+ exit 1
+ fi
+}
+
+while [[ $# -gt 0 ]]
+do
+ case $1 in
+ # Main operation.
+ configure) func_operation_set $1; shift;;
+ make) func_operation_set $1; shift;;
+
+
+ # Configure options:
+ -b|--builddir) build_dir="$2"; check_v "$1" "$build_dir"; shift;shift;;
+ -b=*|--build-dir=*) build_dir="${1#*=}"; check_v "$1" "$build_dir"; shift;;
+ -b*) build_dir=$(echo "$1" | sed -e's/-b//'); check_v "$1" "$build_dir"; shift;;
+ -e|--existing-conf) existing_conf=1; shift;;
+ -e*|--existing-conf=*) on_off_option_error --existing-conf -e;;
+ --host-cc) host_cc=1; shift;;
+ --host-cc=*) on_off_option_error --host-cc;;
+ -i|--inputdir) input_dir="$2"; check_v "$1" "$input_dir"; shift;shift;;
+ -i=*|--inputdir=*) input_dir="${1#*=}"; check_v "$1" "$input_dir"; shift;;
+ -i*) input_dir=$(echo "$1" | sed -e's/-i//'); check_v "$1" "$input_dir"; shift;;
+ -m|--minmapsize) minmapsize="$2"; check_v "$1" "$minmapsize"; shift;shift;;
+ -m=*|--minmapsize=*) minmapsize="${1#*=}"; check_v "$1" "$minmapsize"; shift;;
+ -m*) minmapsize=$(echo "$1" | sed -e's/-m//'); check_v "$1" "$minmapsize"; shift;;
+ -s|--software-dir) software_dir="$2"; check_v "$1" "$software_dir"; shift;shift;;
+ -s=*|--software-dir=*) software_dir="${1#*=}"; check_v "$1" "$software_dir"; shift;;
+ -s*) software_dir=$(echo "$1" | sed -e's/-s//'); check_v "$1" "$software_dir"; shift;;
+
+ # Configure and Make options:
+ -g|--group) group="$2"; check_v group "$group"; shift;shift;;
+ -g=*|--group=*) group="${1#*=}"; check_v group "$group"; shift;;
+ -g*) group=$(echo "$1" | sed -e's/-g//'); check_v group "$group"; shift;;
+ -j|--jobs) jobs="$2"; check_v jobs "$jobs"; shift;shift;;
+ -j=*|--jobs=*) jobs="${1#*=}"; check_v jobs "$jobs"; shift;;
+ -j*) jobs=$(echo "$1" | sed -e's/-j//'); check_v jobs "$jobs"; shift;;
+ -'?'|--help) print_help; exit 0;;
+ -'?'*|--help=*) on_off_option_error --help -?;;
+
+ # Make options (note that Make's `debug' can take values, but when called
+ # without any value, it is like giving it a value of `a'):
+ -d|--debug) if [ x"$2" = x ]; then debug=a; shift;
+ else debug="$2"; check_v debug "$debug"; shift;shift; fi;;
+ -d=*|--debug=*) debug="${1#*=}"; check_v debug "$debug"; shift;;
+ -d*) debug=$(echo "$1" | sed -e's/-d//'); check_v debug "$debug"; shift;;
+
+ # Unrecognized option:
+ -*) echo "$scriptname: unknown option '$1'"; exit 1;;
+
+ # Not an option, an argument (so its a Make target).
+ *) make_targets="$make_targets $1"; shift;;
+ esac
+done
+
+
+
+
+
+# Basic group settings
+# --------------------
+if ! [ x$group = x ]; then
+
+ # Check if group is usable.
+ if ! sg "$group" "echo test &> /dev/null" &> /dev/null; then
+ echo "$scriptname: '$group' is not a usable group name on this system.";
+ echo "(TIP: you can use the 'groups' command to see your groups)"
+ exit 1
+ fi
+
+ # Set the group option for running Make.
+ gopt="reproducible_paper_group_name=$group"
+fi
+
+
+
+
+
+# Do requested operation
+# ----------------------
+perms="u+r,u+w,g+r,g+w,o-r,o-w,o-x"
+configscript=./reproduce/software/bash/configure.sh
+case $operation in
+
+ # Build the project's software.
+ configure)
+
+ # Variables to pass to the configuration script.
+ export jobs=$jobs
+ export host_cc=$host_cc
+ export build_dir=$build_dir
+ export input_dir=$input_dir
+ export scriptname=$scriptname
+ export minmapsize=$minmapsize
+ export software_dir=$software_dir
+ export existing_conf=$existing_conf
+ export reproducible_paper_group_name=$group
+
+ # Run the configuration script
+ if [ x"$group" = x ]; then
+ $configscript
+ else
+ # Set the group and permission flags.
+ sg "$group" "umask $perms && $configscript"
+
+ # Set the group writing permission for everything in the
+ # installed software directory. The common build process sets
+ # the writing permissions of the installed programs/libraries
+ # to `755'. So group members can't write over a file. This
+ # creates problems when another group member wants to update
+ # the software for example. We thus need to manually add the
+ # group writing flag to all installed software files.
+ echo "Enabling group writing permission on all installed software..."
+ .local/bin/chmod -R g+w .local/;
+ fi
+ ;;
+
+ # Run the project
+ make)
+
+ # Make sure the configure script has been completed properly
+ # (`configuration-done.txt' exists).
+ if ! [ -f .build/software/configuration-done.txt ]; then
+ cat <<EOF
+
+The project isn't configured for this system, or the configuration wasn't
+successful. To configure the project, please use this command:
+
+ '$ ./project configure'
+
+(TIP: if you have already ran this command once, run it with '-e' to use
+the previous configuration, run with '--help' for more info)
+
+EOF
+ exit 1
+ fi
+
+ # Get the full address of the build directory:
+ bdir=`.local/bin/realpath .build`
+
+
+ # Remove all existing environment variables (with `env -i') and
+ # only use some pre-defined environment variables, then build the
+ # project.
+ envmake=".local/bin/env -i HOME= sys-rm=$(which rm) $gopt"
+ envmake="$envmake .local/bin/make -f reproduce/analysis/make/top.mk"
+ if ! [ x"$debug" = x ]; then envmake="$envmake --debug=$debug"; fi
+
+ # Set the number of jobs. Note that for the `configure.sh' script
+ # the default value has to be 0, so the default is the maximum
+ # number of threads. But here, the default value is 1.
+ if ! [ x"$jobs" = x0 ]; then envmake="$envmake -j$jobs"; fi
+
+ # Run the project
+ if [ x"$group" = x ]; then
+ $envmake $make_targets
+ else
+ # Set the group and permission flags.
+ sg "$group" "umask $perms && $envmake $make_targets"
+ fi
+ ;;
+
+ # Operation not specified.
+ *)
+ echo "No operation defined (you can give 'configure' or 'make')."
+ exit 1
+ ;;
+esac
diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk
index d2b026e..f8a09e6 100644
--- a/reproduce/analysis/make/initialize.mk
+++ b/reproduce/analysis/make/initialize.mk
@@ -84,8 +84,6 @@ tikzdir = $(texbdir)/tikz
# Before defining the local sub-environment here, we'll need to save the
# system's environment for some scenarios (for example after `clean'ing the
# built programs).
-sys-path := $(PATH)
-sys-rm := $(shell which rm)
curdir := $(shell echo $$(pwd))
@@ -97,7 +95,7 @@ curdir := $(shell echo $$(pwd))
#
# We want the full recipe to be executed in one call to the shell. Also we
# want Make to run the specific version of Bash that we have installed
-# during `./configure' time.
+# during `./project configure' time.
#
# Regarding the directories, this project builds its major dependencies
# itself and doesn't use the local system's default tools. With these
@@ -116,7 +114,11 @@ export LDFLAGS := -L$(installdir)/lib
export SHELL := $(installdir)/bin/bash
export CPPFLAGS := -I$(installdir)/include
export LD_LIBRARY_PATH := $(installdir)/lib
-export DYLD_LIBRARY_PATH := $(installdir)/lib
+
+# RPATH is automatically written in macOS, so `DYLD_LIBRARY_PATH' is
+# ultimately redundant. But on some systems, even having a single value
+# causes crashs (see bug #56682). So we'll just give it no value at all.
+export DYLD_LIBRARY_PATH :=
@@ -190,15 +192,17 @@ clean: clean-mmap
# features like ignoring the listing of a file with `!()' that we
# are using afterwards.
shopt -s extglob
- rm -rf $(BDIR)/!(software)
+ rm -rf $(BDIR)/tex/macros/!(dependencies.tex|dependencies-bib.tex)
+ rm -rf $(BDIR)/!(software|tex) $(BDIR)/tex/!(macros|build)
+ rm -rf $(BDIR)/tex/build/!(tikz) $(BDIR)/tex/build/tikz/*
distclean: clean
# We'll be deleting the built environent programs and just need the
# `rm' program. So for this recipe, we'll use the host system's
# `rm', not our own.
- $(sys-rm) -rf $(BDIR)
- $(sys-rm) -f Makefile .gnuastro .local .build
- $(sys-rm) -f $(pconfdir)/LOCAL.mk $(gconfdir)/gnuastro-local.conf
+ $$sys-rm -rf $(BDIR)
+ $$sys-rm -f Makefile .gnuastro .local .build
+ $$sys-rm -f $(pconfdir)/LOCAL.mk $(gconfdir)/gnuastro-local.conf
diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk
index c17028a..436bac4 100644
--- a/reproduce/analysis/make/paper.mk
+++ b/reproduce/analysis/make/paper.mk
@@ -64,11 +64,9 @@ $(mtexdir)/project.tex: $(foreach s, $(subst paper,,$(makesrc)), $(mtexdir)/$(s)
echo "'reproduce/analysis/config/pdf-build.mk'."
echo
echo "If you don't have LaTeX within the project, please re-run"
- echo "'./configure' when you have internet access. To speed it up,"
- echo "you can keep the previous configuration files (answer 'n'"
- echo "when it asks about re-writing previous configuration files)."
+ echo "'./project configure -e' when you have internet access."
else
- echo "For more, run './.local/bin/make more-on-building-pdf=1'"
+ echo "For more, run './project make more-on-building-pdf=1'"
fi
echo
echo "" > $@
diff --git a/reproduce/analysis/make/top.mk b/reproduce/analysis/make/top.mk
index b753979..7d20800 100644
--- a/reproduce/analysis/make/top.mk
+++ b/reproduce/analysis/make/top.mk
@@ -19,7 +19,8 @@
-# Load the local configuration (created after running `./configure').
+# Load the local configuration (created after running
+# `./project configure').
include reproduce/software/config/installation/LOCAL.mk
@@ -49,9 +50,8 @@ include reproduce/software/config/installation/LOCAL.mk
#
# Controlling this requires two variables that are available at this stage:
#
-# - `GROUP-NAME': from `LOCAL.mk' (which was built by `./configure').
-# - `reproducible_paper_group_name': from the `./for-group' script (if it
-# was used to call Make).
+# - `GROUP-NAME': from `LOCAL.mk' (which was built by `./project configure').
+# - `reproducible_paper_group_name': value to the `--group' option.
#
# The analysis is only done when both have the same group name. Note that
# when the project isn't being built for a group, both variables will be an
@@ -70,10 +70,10 @@ else
all:
@if [ "x$(GROUP-NAME)" = x ]; then \
echo "Project is NOT configured for groups, please run"; \
- echo " $$ .local/bin/make"; \
+ echo " $$ ./project make"; \
else \
echo "Project is configured for groups, please run"; \
- echo " $$ ./for-group $(GROUP-NAME) make -j8"; \
+ echo " $$ ./project make --group=$(GROUP-NAME) -j8"; \
fi
endif
diff --git a/configure b/reproduce/software/bash/configure.sh
index 6dd796c..65b728e 100755
--- a/configure
+++ b/reproduce/software/bash/configure.sh
@@ -27,150 +27,6 @@ set -e
-# Default option values
-jobs=0
-build_dir=
-input_dir=
-host_cc=0
-software_dir=
-existing_conf=0
-minmapsize=10000000000
-scriptname="./configure"
-
-
-
-
-
-# Output of --help
-# ----------------
-print_help() {
- # Print the output.
- cat <<EOF
-Usage: $scriptname [OPTION]...
-
-Configure the reproducible paper template for this system (set local
-settings for this system). The local settings can be given on the
-command-line through the options below. If not, the configure script will
-interactively ask for a value to each one (with basic necessary background
-information printed before them). Alternatively, if you have already
-configured this script for your system, you can use the '--existing-conf'
-to use its values directly.
-
-RECOMMENDATION: If this is the first time you are running this template,
-please don't use the options and let the script explain each parameter in
-full detail by simply running './configure'.
-
-The only mandatory value is the local build directory. This is where all
-the (temporary) built files will be stored. Optionally, you can also
-provide directories that host input data, or software source codes. If the
-necessary files don't exist there, the template will automatically download
-them.
-
-With the options below you can modify the default behavior. Just note that
-you should not put an '=' sign between an option name and its value.
-
-Configure options:
- Top-level directory settings:
- -b, --build-dir=STR Top directory to build the project in.
- -i, --input-dir=STR Directory containing input datasets (optional).
- -s, --software-dir=STR Directory containing necessary software tarballs.
-
- Operating mode options:
- --host-cc Use host system's C compiler, don't build GCC.
- -m, --minmapsize=INT (Gnuastro) Minimum number of bytes to use RAM.
- -j, --jobs=INT Number of threads to build the software.
- -e, --existing-conf Use (possibly existing) local configuration.
- -h, --help Print this help list.
-
-Mandatory or optional arguments to long options are also mandatory or optional
-for any corresponding short options.
-
-Reproducible paper template: https://gitlab.com/makhlaghi/reproducible-paper
-
-Report bugs to mohammad@akhlaghi.org
-EOF
-}
-
-
-
-
-
-# Functions to check option values and complain if necessary.
-function on_off_option_error() {
- if [ "x$2" = x ]; then
- echo "$scriptname: '$1' doesn't take any values."
- else
- echo "$scriptname: '$1' (or '$2') doesn't take any values."
- fi
- exit 1
-}
-
-function check_v() {
- if [ x"$2" = x ]; then
- echo "$scriptname: option '$1' requires an argument."
- echo "Try '$scriptname --help' for more information."
- exit 1;
- fi
-}
-
-
-
-
-
-# Separate command-line arguments from options. Then put the option
-# value into the respective variable.
-#
-# Each option has two lines because we want to process both these formats:
-# `--name=value' and `--name value'. The former (with `=') is a single
-# command-line argument, so we just need to shift the counter by one. The
-# latter (without `=') is two arguments, so we'll need two shifts.
-#
-# Note on the case strings: for every option, we need three lines: one when
-# the option name and value are separate. Another when there is an equal
-# between them, and finally one where the value is immediately after the
-# short-format. This exact order is important. Otherwise, there will be a
-# conflict between them.
-while [[ $# -gt 0 ]]
-do
- case $1 in
- # Input parameters.
- -b|--builddir) build_dir="$2"; check_v "$1" "$build_dir"; shift;shift;;
- -b=*|--build-dir=*) build_dir="${1#*=}"; check_v "$1" "$build_dir"; shift;;
- -b*) build_dir=$(echo "$1" | sed -e's/-b//'); check_v "$1" "$build_dir"; shift;;
- -i|--inputdir) input_dir="$2"; check_v "$1" "$input_dir"; shift;shift;;
- -i=*|--inputdir=*) input_dir="${1#*=}"; check_v "$1" "$input_dir"; shift;;
- -i*) input_dir=$(echo "$1" | sed -e's/-i//'); check_v "$1" "$input_dir"; shift;;
- -s|--software-dir) software_dir="$2"; check_v "$1" "$software_dir"; shift;shift;;
- -s=*|--software-dir=*) software_dir="${1#*=}"; check_v "$1" "$software_dir"; shift;;
- -s*) software_dir=$(echo "$1" | sed -e's/-s//'); check_v "$1" "$software_dir"; shift;;
- -m|--minmapsize) minmapsize="$2"; check_v "$1" "$minmapsize"; shift;shift;;
- -m=*|--minmapsize=*) minmapsize="${1#*=}"; check_v "$1" "$minmapsize"; shift;;
- -m*) minmapsize=$(echo "$1" | sed -e's/-m//'); check_v "$1" "$minmapsize"; shift;;
-
- # Operating mode options
- --host-cc) host_cc=1; shift;;
- --host-cc=*) on_off_option_error --host-cc;;
- -j|--jobs) jobs="$2"; check_v "$1" "$jobs"; shift;shift;;
- -j=*|--jobs=*) jobs="${1#*=}"; check_v "$1" "$jobs"; shift;;
- -j*) jobs=$(echo "$1" | sed -e's/-j//'); check_v "$1" "$jobs"; shift;;
- -e|--existing-conf) existing_conf=1; shift;;
- -e*|--existing-conf=*) on_off_option_error --existing-conf -e;;
- -?|--help) print_help; exit 0;;
- -'?'*|--help=*) on_off_option_error --help -?;;
-
- # Unrecognized option:
- -*) echo "$scriptname: unknown option '$1'"; exit 1;;
-
- # Not an option, an argument.
- *) echo "The configure script doesn't accept arguments.";
- echo "For a description of options, please run with '--help'."; exit 1;;
- esac
-done
-
-
-
-
-
# Internal directories
# --------------------
#
@@ -194,19 +50,6 @@ glconf=$cdir/gnuastro/gnuastro-local.conf
-# Delete final target of configuration
-# ------------------------------------
-#
-# Without the top-level `Makefile' the user can't run `make' in this
-# directory. But we only want to make it available when we know everything
-# else is set up. So we'll delete it at the start of this configuration and
-# reset the link in the absolute end.
-rm -f Makefile
-
-
-
-
-
# Notice for top of generated files
# ---------------------------------
#
@@ -214,12 +57,12 @@ rm -f Makefile
# a text editor and wants to edit them, it is important to let them know
# that their changes are not going to be permenant.
function create_file_with_notice() {
- if echo "# IMPORTANT: file can be RE-WRITTEN after './configure'" > "$1"
+ if echo "# IMPORTANT: file can be RE-WRITTEN after './project configure'" > "$1"
then
echo "#" >> "$1"
echo "# This file was created during configuration" >> "$1"
- echo "# ('./configure'). Therefore, it is not under version" >> "$1"
- echo "# control and any manual changes to it will be" >> "$1"
+ echo "# ('./project configure'). Therefore, it is not under" >> "$1"
+ echo "# version control and any manual changes to it will be" >> "$1"
echo "# over-written if the project re-configured." >> "$1"
echo "#" >> "$1"
else
@@ -275,7 +118,7 @@ EOF
#
# `LOCAL.mk' is the top-most local configuration for the project. If it
# already exists when this script is run, we'll make a copy of it as backup
-# (for example the user might have ran `./configure' by mistake).
+# (for example the user might have ran `./project configure' by mistake).
printnotice=yes
rewritepconfig=yes
rewritegconfig=yes
@@ -302,10 +145,10 @@ if [ $rewritepconfig = no ]; then
echo "-----------------------------"
if [ "x$oldgroupname" = x ]; then
status="NOT configured for groups"
- confcommand="./configure"
+ confcommand="./project configure"
else
status="configured for '$oldgroupname' group"
- confcommand="./for-group $oldgroupname configure"
+ confcommand="./project configure --group=$oldgroupname"
fi
echo "Project was previously $status!"
echo "Either enable re-write of this configuration file,"
@@ -323,8 +166,8 @@ fi
# Identify the downloader tool
# ----------------------------
#
-# After this `./configure' script finishes, we will have both Wget and cURL
-# for downloading any necessary dataset during the processing. However, to
+# After this script finishes, we will have both Wget and cURL for
+# downloading any necessary dataset during the processing. However, to
# complete the configuration, we may also need to download the source code
# of some necessary software packages (including the downloaders). So we
# need to check the host's available tool for downloading at this step.
@@ -607,7 +450,7 @@ version that this project was designed to use in '$depverfile'
($gversion). Please re-run after removing the former file:
$ rm $glconf
- $ ./configure
+ $ ./project configure
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -621,6 +464,23 @@ fi
+# Delete final configuration target
+# ---------------------------------
+#
+# We only want to start running the project later if this script has
+# completed successfully. To make sure it hasn't crashed in the middle
+# (without the user noticing), in the end of this script we make a file and
+# we'll delete it here (at the start). Therefore if the script crashed in
+# the middle that file won't exist.
+sdir=$bdir/software
+finaltarget=$sdir/configuration-done.txt
+if ! [ -d $sdir ]; then mkdir $sdir; fi
+rm -f $finaltarget
+
+
+
+
+
# Project's top-level directories
# -------------------------------
#
@@ -628,10 +488,6 @@ fi
# avoid too many directory dependencies throughout the software and
# analysis Makefiles (thus making them hard to read), we are just building
# them here
-# Top-level software
-sdir=$bdir/software
-if ! [ -d $sdir ]; then mkdir $sdir; fi
-
# Software tarballs
tardir=$sdir/tarballs
if ! [ -d $tardir ]; then mkdir $tardir; fi
@@ -716,34 +572,34 @@ ln -s $topdir/reproduce/software/config/gnuastro .gnuastro
# random characters to this name and make it unique to every run (even for
# a single user).
tmpblddir=$sdir/build-tmp
-if ! [ -d $tmpblddir ]; then
+rm -rf $tmpblddir/* $tmpblddir # If its a link, we need to empty its
+ # contents first, then itself.
- # Set the top-level shared memory location.
- if [ -d /dev/shm ]; then shmdir=/dev/shm
- else shmdir=""
- fi
+# Set the top-level shared memory location.
+if [ -d /dev/shm ]; then shmdir=/dev/shm
+else shmdir=""
+fi
- # If a shared memory mounted directory exists and there is enough space
- # there (in RAM), build a temporary directory for this project.
- needed_space=2000000
- if [ x"$shmdir" != x ]; then
- available_space=$(df $shmdir | awk 'NR==2{print $4}')
- if [ $available_space -gt $needed_space ]; then
- dirname=$(pwd | sed -e's/\// /g' \
- | awk '{l=NF-1; printf("%s-%s",$l, $NF)}')
- tbshmdir=$shmdir/"$dirname"-$(whoami)
- if ! [ -d $tbshmdir ]; then mkdir $tbshmdir; fi
- fi
- else
- tbshmdir=""
+# If a shared memory mounted directory exists and there is enough space
+# there (in RAM), build a temporary directory for this project.
+needed_space=2000000
+if [ x"$shmdir" != x ]; then
+ available_space=$(df $shmdir | awk 'NR==2{print $4}')
+ if [ $available_space -gt $needed_space ]; then
+ dirname=$(pwd | sed -e's/\// /g' \
+ | awk '{l=NF-1; printf("%s-%s",$l, $NF)}')
+ tbshmdir=$shmdir/"$dirname"-$(whoami)
+ if ! [ -d $tbshmdir ]; then mkdir $tbshmdir; fi
fi
+else
+ tbshmdir=""
+fi
- # If a shared memory directory was created set `build-tmp' to be a
- # symbolic link to it. Otherwise, just build the temporary build
- # directory under the project build directory.
- if [ x$tbshmdir = x ]; then mkdir $tmpblddir;
- else ln -s $tbshmdir $tmpblddir;
- fi
+# If a shared memory directory was created set `build-tmp' to be a
+# symbolic link to it. Otherwise, just build the temporary build
+# directory under the project build directory.
+if [ x$tbshmdir = x ]; then mkdir $tmpblddir;
+else ln -s $tbshmdir $tmpblddir;
fi
@@ -834,7 +690,7 @@ static_build=no
#
#If you have other compilers on your system, you can select a different
#compiler by setting the 'CC' environment variable before running
-#'./configure'.
+#'./project configure'.
#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
@@ -1072,7 +928,7 @@ PLEASE SEE THE WARNINGS ABOVE.
Since GCC is pretty low-level, this configuration script will continue in 5
seconds and use your system's C compiler (it won't build a custom GCC). But
please consider installing the necessary package(s) to complete your C
-compiler, then re-run './configure'.
+compiler, then re-run './project configure'.
EOF
sleep 5
@@ -1176,13 +1032,14 @@ if [ $jobs = 0 ]; then
else
numthreads=$jobs
fi
-./.local/bin/make -f reproduce/software/make/high-level.mk \
- rpath_command=$rpath_command \
- static_build=$static_build \
- numthreads=$numthreads \
- on_mac_os=$on_mac_os \
- host_cc=$host_cc \
- -j$numthreads
+.local/bin/env -i HOME=$bdir \
+ .local/bin/make -f reproduce/software/make/high-level.mk \
+ rpath_command=$rpath_command \
+ static_build=$static_build \
+ numthreads=$numthreads \
+ on_mac_os=$on_mac_os \
+ host_cc=$host_cc \
+ -j$numthreads
@@ -1223,7 +1080,7 @@ below. Within configure, answer 'n' (for "no") when asked to re-write the
configuration files.
rm .local/version-info/tex/texlive-ready-tlmgr
- ./configure
+ ./project configure
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1326,20 +1183,16 @@ fi
# directory should be empty, so just delete it. Note `tmpblddir' may be a
# symbolic link to shared memory. So, to work in any scenario, first delete
# the contents of the directory (if it has any), then delete `tmpblddir'.
-.local/bin/rm -rf $tmpblddir/*
-.local/bin/rm -rf $tmpblddir
+.local/bin/rm -rf $tmpblddir/* $tmpblddir
-# Final step: available Makefile
+# Register successful completion
# ------------------------------
-#
-# We only want `make' to work after the configuration is complete. So we
-# will only put in the top-level Makefile after all the steps above are
-# done.
-.local/bin/ln -s $topdir/reproduce/analysis/make/top.mk Makefile
+echo `.local/bin/date` > $finaltarget
+
@@ -1351,9 +1204,9 @@ fi
# The configuration is now complete, we can inform the user on the next
# step(s) to take.
if [ x$reproducible_paper_group_name = x ]; then
- buildcommand=".local/bin/make -j8"
+ buildcommand="./project make -j8"
else
- buildcommand="./for-group $reproducible_paper_group_name make -j8"
+ buildcommand="./project make --group=$reproducible_paper_group_name -j8"
fi
cat <<EOF
@@ -1365,7 +1218,7 @@ Please run the following command to start.
$buildcommand
-To change the configuration later, please re-run './configure',
-DO NOT manually edit the relevant files.
+To change the configuration later, please re-run './project configure', DO
+NOT manually edit the relevant files.
EOF
diff --git a/reproduce/software/config/installation/LOCAL.mk.in b/reproduce/software/config/installation/LOCAL.mk.in
index 785bb6a..132d961 100644
--- a/reproduce/software/config/installation/LOCAL.mk.in
+++ b/reproduce/software/config/installation/LOCAL.mk.in
@@ -1,7 +1,7 @@
# Local project configuration.
#
-# This is just a template for the `./configure' script to fill in. Please
-# don't make any change to this file.
+# This is just a template for the `./project configure' script to fill
+# in. Please don't make any change to this file.
#
# Copyright (C) 2018-2019 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
diff --git a/reproduce/software/make/atlas-multiple.mk b/reproduce/software/make/atlas-multiple.mk
index fef25c7..f5efb35 100755
--- a/reproduce/software/make/atlas-multiple.mk
+++ b/reproduce/software/make/atlas-multiple.mk
@@ -3,8 +3,8 @@
# ------------------------------------------------------------------------
# !!!!! IMPORTANT NOTES !!!!!
#
-# This Makefile will be run during the initial `./configure' script. It is
-# not included into the reproduction pipe after that.
+# This Makefile will be run during the initial `./project configure'
+# script. It is not included into the reproduction pipe after that.
#
# ------------------------------------------------------------------------
#
diff --git a/reproduce/software/make/atlas-single.mk b/reproduce/software/make/atlas-single.mk
index dde2926..c4621ce 100755
--- a/reproduce/software/make/atlas-single.mk
+++ b/reproduce/software/make/atlas-single.mk
@@ -3,8 +3,8 @@
# ------------------------------------------------------------------------
# !!!!! IMPORTANT NOTES !!!!!
#
-# This Makefile will be run during the initial `./configure' script. It is
-# not included into the reproduction pipe after that.
+# This Makefile will be run during the initial `./project configure'
+# script. It is not included into the reproduction pipe after that.
#
# ------------------------------------------------------------------------
#
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index bab37ed..e4ab55a 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -4,8 +4,8 @@
# ------------------------------------------------------------------------
# !!!!! IMPORTANT NOTES !!!!!
#
-# This Makefile will be run by the initial `./configure' script. It is not
-# included into the project after that.
+# This Makefile will be run by the initial `./project configure' script. It
+# is not included into the project after that.
#
# This Makefile builds very low-level and basic tools like GNU Tar, GNU
# Bash, GNU Make, GCC and etc. Therefore this is the only Makefile in the
@@ -58,7 +58,11 @@ export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig
export CPPFLAGS := -I$(idir)/include $(CPPFLAGS)
export LD_LIBRARY_PATH := $(ildir):$(LD_LIBRARY_PATH)
export LDFLAGS := $(rpath_command) -L$(ildir) $(LDFLAGS)
-export DYLD_LIBRARY_PATH := $(ildir):$(DYLD_LIBRARY_PATH)
+
+# RPATH is automatically written in macOS, so `DYLD_LIBRARY_PATH' is
+# ultimately redundant. But on some systems, even having a single value
+# causes crashs (see bug #56682). So we'll just give it no value at all.
+export DYLD_LIBRARY_PATH :=
# Define the top-level basic programs (that don't depend on any other).
top-level-programs = low-level-links gcc
diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk
index dee23ca..b9a70de 100644
--- a/reproduce/software/make/high-level.mk
+++ b/reproduce/software/make/high-level.mk
@@ -3,8 +3,8 @@
# ------------------------------------------------------------------------
# !!!!! IMPORTANT NOTES !!!!!
#
-# This Makefile will be run by the initial `./configure' script. It is not
-# included into the reproduction pipe after that.
+# This Makefile will be run by the initial `./project configure' script. It
+# is not included into the reproduction pipe after that.
#
# ------------------------------------------------------------------------
#
@@ -76,7 +76,11 @@ export LD_RUN_PATH := $(ildir):$(il64dir)
export PKG_CONFIG_PATH := $(ildir)/pkgconfig
export LD_LIBRARY_PATH := $(ildir):$(il64dir)
export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig
-export DYLD_LIBRARY_PATH := $(ildir):$(il64dir)
+
+# RPATH is automatically written in macOS, so `DYLD_LIBRARY_PATH' is
+# ultimately redundant. But on some systems, even having a single value
+# causes crashs (see bug #56682). So we'll just give it no value at all.
+export DYLD_LIBRARY_PATH :=
# Building flags:
#
@@ -90,6 +94,9 @@ export CXXFLAGS := -liconv
endif
+
+
+
# We want the download to happen on a single thread. So we need to define a
# lock, and call a special script we have written for this job. These are
# placed here because we want them both in the `high-level.mk' and
diff --git a/reproduce/software/make/python.mk b/reproduce/software/make/python.mk
index 22b668f..ed1c87d 100644
--- a/reproduce/software/make/python.mk
+++ b/reproduce/software/make/python.mk
@@ -3,8 +3,8 @@
# ------------------------------------------------------------------------
# !!!!! IMPORTANT NOTES !!!!!
#
-# This Makefile will be run by the initial `./configure' script. It is not
-# included into the reproduction pipe after that.
+# This Makefile will be run by the initial `./project configure' script. It
+# is not included into the reproduction pipe after that.
#
# ------------------------------------------------------------------------
#