gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 590e114: Options for the separate build direct


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 590e114: Options for the separate build directory script
Date: Fri, 25 May 2018 21:54:40 -0400 (EDT)

branch: master
commit 590e114da2b3b49d95686d0557711902804a7a1d
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Options for the separate build directory script
    
    Until now, the main tool for easy development was the `tmpfs-config-make'
    script. But it didn't accept options and everytime we wanted to debug or
    make some other modification to it, it was necessary to manually update it.
    
    With this commit, it is renamed to "developer-build" and a whole section is
    now devoted to it in the book, describing its options and how to run it. In
    effect it has been separated from the "Configure and build in RAM" section.
---
 Makefile.am               |   2 +-
 developer-build           | 318 ++++++++++++++++++++++++++++++++++++++++++++++
 doc/gnuastro.texi         | 217 ++++++++++++++++++++++++-------
 doc/release-checklist.txt |   4 +-
 tests/during-dev.sh       |   4 +-
 tmpfs-config-make         | 137 --------------------
 6 files changed, 491 insertions(+), 191 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d316836..6928071 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -142,7 +142,7 @@ dist_sysconf_DATA = bin/gnuastro.conf
 
 ## Files that are only distributed
 ## ===============================
-EXTRA_DIST = genauthors .dir-locals.el .version tmpfs-config-make     \
+EXTRA_DIST = genauthors .dir-locals.el .version developer-build     \
   bootstrapped/README .autom4te.cfg
 
 
diff --git a/developer-build b/developer-build
new file mode 100755
index 0000000..b4b7ebd
--- /dev/null
+++ b/developer-build
@@ -0,0 +1,318 @@
+#! /bin/sh
+
+# This script will configure and build Gnuastro in parallel inside another
+# directory (to keep the source and build directories separate). By default
+# it is in the tmpfs directory of the RAM. Please see the "Configure and
+# build in RAM" section of the Gnuastro book/documentation for a full
+# explanation.
+#
+# Original author:
+#   Mohammad Akhlaghi <address@hidden>
+# Contributing author(s):
+#   Mosè Giordano <address@hidden>
+# Copyright (C) 2016-2018, Free Software Foundation, Inc.
+#
+# Gnuastro 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.
+#
+# Gnuastro 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.
+#
+# You should have received a copy of the GNU General Public License along
+# with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
+
+
+
+
+
+# Default values for variables.
+jobs=8
+debug=0
+clean=0
+check=0
+install=0
+top_build_dir=/dev/shm
+if [ -f .version ]; then
+    version=$(cat .version)
+else
+    version=""
+fi
+
+
+
+
+
+# Output of help.
+me=$0                           # Executable file name.
+help_print() {
+
+    # See if debug is enabled or not.
+    if [ $debug = "0" ]; then
+        debug_status="DISABLED"
+    else
+        debug_status="ENABLED"
+    fi
+
+    # See if clean is enabled or not.
+    if [ $clean = "0" ]; then
+        clean_status="DISABLED"
+    else
+        clean_status="ENABLED"
+    fi
+
+    # See if check is enabled or not.
+    if [ $check = "0" ]; then
+        check_status="DISABLED"
+    else
+        check_status="ENABLED"
+    fi
+
+    # See if install is enabled or not.
+    if [ $install = "0" ]; then
+        install_status="DISABLED"
+    else
+        install_status="ENABLED"
+    fi
+
+    # Print the output.
+    cat <<EOF
+
+Usage: $me [OPTION]...
+
+Configure and make the package in a separate directory and put a symbolic
+link to that directory in the current directory. A top build directory must
+be given to host the build directory for this script (see 'top-build-dir'
+option below). The symbolic link to the build directory in this directory
+will be called 'build'.
+
+Options:
+
+ -b, --top-build-dir STR  Address to host the top build directory.
+                          Current value: $top_build_dir
+
+ -V, --version            Print current version to be used in absolute
+                          build directory name.
+                          Current value: $version
+
+ -c, --clean              Delete (with `rm') all its contents of the build
+                          directory before starting new configuration.
+                          Current status: $clean_status
+
+ -d, --debug              Build Gnuastro with debugging information,
+                          no optimization flags, and without shared
+                          libraries.
+                          Current status: $debug_status
+
+ -j, --jobs INT           Number of threads to use in 'make'.
+                          Current value: $jobs
+
+ -C, --check              Run 'make check' after the build.
+                          Current status: $check_status
+
+ -i, --install            Run `sudo make install' after the build.
+                          Current status: $install_status
+
+ -P, --printparams        Another name for `--help', for similarity with
+                          Gnuastro's programs. Note that the output of
+                          `--help' also includes the variable values.
+
+ -h, --help               Print this help list.
+
+Mandatory or optional arguments to long options are also mandatory or optional
+for any corresponding short options.
+
+GNU Astronomy Utilities home page: http://www.gnu.org/software/gnuastro/
+
+Report bugs to address@hidden
+EOF
+}
+
+
+
+
+
+# Parse the arguments.
+while [[ $# -gt 0 ]]
+do
+    key="$1"
+    case $key in
+        -b|--top-build-dir)
+            top_build_dir="$2"
+            shift # past argument
+            shift # past value
+            ;;
+        -V|--version)
+            echo $version
+            exit 0
+            ;;
+        -c|--clean)
+            clean=1
+            shift # past argument
+            ;;
+        -d|--debug)
+            debug=1
+            shift # past argument
+            ;;
+        -j|--jobs)
+            jobs="$2"
+            shift # past argument
+            shift # past value
+            ;;
+        -C|--check)
+            check=1
+            shift # past argument
+            ;;
+        -i|--install)
+            install=1
+            shift # past argument
+            ;;
+        -h|-P|--help|--printparams)
+            help_print
+            exit 0
+            ;;
+        *)    # unknown option
+            echo "'$1' isn't a recognized option. Aborted."
+            echo
+            echo "Recall that for this script, options and their values must 
be"
+            echo "separated by atleast one white-space character."
+            exit 1
+            ;;
+    esac
+done
+
+
+
+
+
+# Check if top_build_dir exists
+if [ ! -d $top_build_dir ]; then
+    echo "$top_build_dir doesn't exist. Aborted."
+    exit 1
+fi
+
+
+
+
+
+# Keep the address of this source directory (where this script is being run
+# from) which we will need later.
+srcdir=$(pwd)
+
+
+
+
+
+# Set the build directory name in tmpfs. If the .version file exists, use
+# it to allow multiple version builds there (which might happen during
+# development).
+basedir=$(basename -- "$srcdir")
+if [ -f .version ]; then
+    build_dir=$top_build_dir/"$basedir"-$version
+else
+    build_dir=$top_build_dir/"$basedir"
+fi
+
+
+
+
+
+# Make the build directory in tmpfs (if it doesn't already exist).
+if [ ! -d $build_dir ]; then
+    mkdir $build_dir
+fi
+
+
+
+
+
+# Make a symbolic link to the tmpfs build directory for users to easily
+# access the built files and also follow the progress. We are first
+# deleting any existing symbolic link and remaking it since the possible
+# deletion of $build_dir during the development can complicate the
+# pre-existing symbolic link.
+build_sym=build
+if [ -h $build_sym ]; then
+    # Delete a harmless symbolic link, if present.
+    rm $build_sym
+fi
+
+
+
+
+
+# Create the link only if the symbolic link doesn't exist.
+if [ ! -e $build_sym ]; then
+    ln -s $build_dir $build_sym
+else
+    echo "$build_sym already exists here and is not a symbolic link."
+    echo "Aborted."
+    exit 1
+fi
+
+
+
+
+
+# Clean the contents of the build directory if requested.
+if [ x$clean = x1 ]; then
+    rm -rf $build_sym/*
+fi
+
+
+
+
+
+# Go into the build directory to start the configure and/or build:
+cd $build_dir
+
+
+
+
+
+# If a 'Makefile' doesn't exist, then configure Gnuastro.
+#
+# FOR DEBUGGING: uncomment the second half of this line. Gnuastro uses GNU
+# Libtool to build shared libraries for highly portable and maintainable
+# usage on a wide variety of systems. While this is great for binaries,
+# shared libraries can be a pain when debuggin. For this reason,
+# compilation of shared libraries can be turned off by specifying the
+# --disable-shared option to configure. With static libraries, compilation
+# (the `make' command) will also significantly speed up. Also, by default
+# (in `configure.ac'), we have set optimization flags which have to be
+# cancelled in debugging.
+if [ ! -f Makefile ]; then
+    if [ x$debug = x1 ]; then
+        $srcdir/configure --srcdir=$srcdir CFLAGS="-g -O0" --disable-shared
+    else
+        $srcdir/configure --srcdir=$srcdir
+    fi
+fi
+
+
+
+
+
+# Build Gnuastro in that directory with the specified number of threads
+make -kj$jobs
+
+
+
+
+
+# If requested, also run `make check'.
+if [ x$check = x1 ]; then
+    make check -kj$jobs
+fi
+
+
+
+
+
+# If requested, also run `sudo make install'.
+if [ x$install = x1 ]; then
+    sudo make install -kj$jobs
+fi
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 6f27ff7..f16e249 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -274,6 +274,7 @@ Version controlled source
 Build and install
 
 * Configuring::                 Configure Gnuastro
+* Separate build and source directories::  Keeping derivate/build files 
separate.
 * Tests::                       Run tests to see if it is working.
 * A4 print book::               Customize the print book.
 * Known issues::                Issues you might encounter.
@@ -5413,6 +5414,7 @@ encounter in the installation steps and ways you can 
solve them.
 
 @menu
 * Configuring::                 Configure Gnuastro
+* Separate build and source directories::  Keeping derivate/build files 
separate.
 * Tests::                       Run tests to see if it is working.
 * A4 print book::               Customize the print book.
 * Known issues::                Issues you might encounter.
@@ -5422,7 +5424,7 @@ encounter in the installation steps and ways you can 
solve them.
 
 
 
address@hidden Configuring, Tests, Build and install, Build and install
address@hidden Configuring, Separate build and source directories, Build and 
install, Build and install
 @subsection Configuring
 
 @pindex ./configure
@@ -5990,11 +5992,11 @@ $ ./configure --program-transform-name='s/ast/ /'
 
 @cindex File I/O
 @cindex Input/Output, file
-The configure and build process involves the creation, reading, and
-modification of a large number of files (input/output, or I/O). Therefore
-file I/O issues can directly affect the work of developers who need to
-configure and build Gnuastro numerous times. Some of these issues are
-listed below:
+Gnuastro's configure and build process (the GNU build system) involves the
+creation, reading, and modification of a large number of files
+(input/output, or I/O). Therefore file I/O issues can directly affect the
+work of developers who need to configure and build Gnuastro numerous
+times. Some of these issues are listed below:
 
 @itemize
 @cindex HDD
@@ -6030,44 +6032,161 @@ considered as an automatic cleanup.
 @cindex Linux kernel
 @cindex GNU C library
 @cindex GNU build system
-The modern GNU C library (and thus the Linux kernel) define the
address@hidden/dev/shm} directory for this purpose (POSIX shared memory). So 
using
-GNU Build System's ability to build in a separate directory (not
-necessarily in the source directory), we can configure and build the
-programs in @file{/dev/shm} to benefit from the RAM. To simplify the
-process, Gnuastro comes with a @file{tmpfs-config-make} script. This script
-will create a directory in the shared memory, and put a symbolic link to it
-(called @file{build}) in the top source directory (the backup/sync software
-therefore only needs to ignore this single link/file). The script will then
-internally change to that directory and configure and build (@command{make
--kjN}, where @command{N} is the number of threads for a parallel build)
-Gnuastro in there. To benefit from this script, simply run the following
-command instead of @command{./configure} and @command{make}:
+The modern GNU C library (and thus the Linux kernel) defines the
address@hidden/dev/shm} directory for this purpose in the RAM (POSIX shared
+memory). To build in it, you can use the GNU build system's ability to
+build in a separate directory (not necessarily in the source directory) as
+shown below. Just set @file{SRCDIR} as the address of Gnuastro's top source
+directory (for example, the unpacked tarball).
 
 @example
-$ ./tmpfs-config-make
+$ mkdir /dev/shm/tmp-gnuastro-build
+$ cd /dev/shm/tmp-gnuastro-build
+$ SRCDIR/configure --srcdir=SRCDIR
+$ make
 @end example
 
address@hidden GNU Emacs
-After this script is finished, you can address@hidden build}' and run other
-Make commands (for example, address@hidden check}', address@hidden
-install}', or address@hidden pdf}') from there. In Emacs, the command to be
-run with the @command{M-x compile} command (by default: @command{make -k})
-can be changed to address@hidden build; make -kjN}', or address@hidden -C
-build -kjN}' (@command{N} is the number of threads; an integer
address@hidden). For subsequent builds (during development) the
address@hidden recompile} command will also do all the building in the RAM
-while you modify the clean, and backed-up source files and make
-minimal/efficient use of your non-volatile HDD or SSD.
-
-This script can be used in any software which is configured and built using
-the GNU Build System. Just copy it in the top source directory of that
-software and run it from there. The default number of threads and location
-of the shared memory (@file{/dev/shm}) are currently hard-coded within the
-script. If you need to change them, please open the script with a text
-editor and set their values manually.
-
address@hidden Tests, A4 print book, Configuring, Build and install
+Gnuastro comes with a script to simplify this process of configuring and
+building in a different directory (a ``clean'' build), for more see
address@hidden build and source directories}.
+
address@hidden Separate build and source directories, Tests, Configuring, Build 
and install
address@hidden Separate build and source directories
+
+The simple steps of @ref{Quick start} will mix the source and built files.
+This can cause inconvenience for developers or enthusiasts following the
+the most recent work (see @ref{Version controlled source}). The current
+section is mainly focused on this later group of Gnuastro users. If you
+just install Gnuastro on major releases (following @ref{Announcements}),
+you can safely ignore this section.
+
address@hidden GNU build system
+When it is necessary to keep the source (which is under version control),
+but not the derivative (built) files (after checking or installing), the
+best solution is to keep the source and the built files in separate
+directories. One application of this is already discussed in @ref{Configure
+and build in RAM}.
+
+To facilitate this process of configuring and building in a separate
+directory, Gnuastro comes with the @file{developer-build} script. It is
+available in the top source directory and is @emph{not} installed. It will
+make a directory under a given top-level directory (given to
address@hidden) and build Gnuastro in there directory. It thus
+keeps the source completely separated from the built files. For easy access
+to the built files, it also makes a symbolic link to the built directory in
+the top source files called @file{build}.
+
+When run without any options, default values will be used for its
+configuration. As with Gnuastro's programs, you can inspect the default
+values with @option{-P} (or @option{--printparams}, the output just looks a
+little different here). The default top-level build directory is
address@hidden/dev/shm}: the shared memory directory in RAM on GNU/Linux 
systems as
+described in @ref{Configure and build in RAM}.
+
address@hidden Debug
+Besides these, it also has some features to facilitate the job of
+developers or bleeding edge users like the @option{--debug} option to do a
+fast build, with debug information, no optimization, and no shared
+libraries. Here is the full list of options you can feed to this script to
+configure its operations.
+
address@hidden
address@hidden
address@hidden all Gnuastro's common program behavior usable here:}
address@hidden is just a non-installed script with a very limited
+scope as described above. It thus doesn't have all the common option
+behaviors or configuration files for example.
address@hidden cartouche
+
address@hidden
address@hidden
address@hidden space between option and value:} @file{developer-build}
+doesn't accept an @key{=} sign between the options and their values. It
+also needs atleast one character between the option and its
+value. Therefore @option{-n 4} or @option{--numthreads 4} are acceptable,
+while @option{-n4}, @option{-n=4}, or @option{--numthreads=4}
+aren't. Finally multiple short option names cannot be merged: for example
+you can say @option{-c -n 4}, but unlike Gnuastro's programs, @option{-cn4}
+is not acceptable.
address@hidden cartouche
+
address@hidden
address@hidden
address@hidden for other packages:} This script can be used in any
+software which is configured and built using the GNU Build System. Just
+copy it in the top source directory of that software and run it from there.
address@hidden cartouche
+
address@hidden @option
+
address@hidden -b STR
address@hidden --top-build-dir STR
+The top build directory to make a directory for the build. If this option
+isn't called, the top build directory is @file{/dev/shm} (only available in
+GNU/Linux operating systems, see @ref{Configure and build in RAM}).
+
address@hidden -V
address@hidden --version
+Print the version string of Gnuastro that will be used in the build. This
+string will be appended to the directory name containing the built files.
+
address@hidden -c
address@hidden --clean
address@hidden GNU Autoreconf
+Delete the contents of the build directory (clean it) before starting the
+configuration and building of this run.
+
+This is useful when you have recently pulled changes from the main Git
+repository, or commited a change your self and ran @command{autoreconf -f},
+see @ref{Synchronizing}. After running GNU Autoconf, the version will be
+updated and you need to do a clean build.
+
address@hidden -d
address@hidden --debug
address@hidden Valgrind
address@hidden GNU Debugger (GDB)
+Build with debugging flags (for example to use in GNU Debugger, also known
+as GDB, or Valgrind), disable optimization and also the building of shared
+libraries. Similar to running the configure script of below
+
address@hidden
+$ ./configure CFLAGS="-g -O0" --disable-shared
address@hidden example
+
+Besides all the debugging advantages of building with this option, it will
+also be significantly speed up the build (at the cost of slower built
+programs). So when you are testing something small or working on the build
+system itself, it will be much faster to test your work with this option.
+
address@hidden -j INT
address@hidden --jobs INT
+The maximum number of threads/jobs for Make to build at any moment. As the
+name suggests (Make has an identical option), the number given to this
+option is directly passed on to any call of Make with its @option{-j}
+option.
+
address@hidden -C
address@hidden --check
+After finishing the build, also run @command{make check}. By default,
address@hidden check} isn't run because the developer usually has their own
+checks to work on (for example defined in @file{tests/during-dev.sh}).
+
address@hidden -i
address@hidden --install
+After finishing the build, also run @command{make install}.
+
address@hidden -h
address@hidden --help
address@hidden -P
address@hidden --printparams
+Print a description of this script along with all the options and their
+current values.
+
address@hidden table
+
+
+
address@hidden Tests, A4 print book, Separate build and source directories, 
Build and install
 @subsection Tests
 
 @cindex @command{make check}
@@ -28279,8 +28398,8 @@ source}). To facilitate the building and testing of 
your work during
 development, Gnuastro comes with two useful scripts:
 
 @table @file
address@hidden @file{tmpfs-config-make}
address@hidden tmpfs-config-make
address@hidden @file{developer-build}
address@hidden developer-build
 This is more fully described in @ref{Configure and build in RAM}. During
 development, you will usually run this command only once (at the start of
 your work).
@@ -28316,8 +28435,8 @@ $ ./configure --disable-shared CFLAGS="-g -O0"
 @end example
 
 @noindent
-In @file{tmpfs-config-make} you can ask for this behavior by setting
address@hidden to @code{1}.
+In @file{developer-build} you can ask for this behavior through the
address@hidden option, see @ref{Separate build and source directories}.
 
 In order to understand the building process, you can go through the
 Autoconf, Automake and Libtool manuals, like all GNU manuals they provide
@@ -28356,15 +28475,15 @@ executable.
 
 @cindex Build tree
 @cindex Source tree
address@hidden @file{tmpfs-config-make}
address@hidden @file{developer-build}
 The most important thing to have in mind about all the test scripts is that
 they are run from inside the @file{tests/} directory in the ``build
 tree''. Which can be different from the directory they are stored in (known
-as the ``source tree'')@footnote{The @file{tmpfs-config-make} script also
+as the ``source tree'')@footnote{The @file{developer-build} script also
 uses this feature to keep the source and build directories separate (see
address@hidden and build in RAM}).}. This distinction is made by GNU
-Autoconf and Automake (which configure, build and install Gnuastro) so that
-you can install the program even if you don't have write access to the
address@hidden build and source directories}).}. This distinction is made by
+GNU Autoconf and Automake (which configure, build and install Gnuastro) so
+that you can install the program even if you don't have write access to the
 directory keeping the source files. See the ``Parallel build trees (a.k.a
 VPATH builds)'' in the Automake manual for a nice explanation.
 
diff --git a/doc/release-checklist.txt b/doc/release-checklist.txt
index 095dedd..05a851f 100644
--- a/doc/release-checklist.txt
+++ b/doc/release-checklist.txt
@@ -53,7 +53,7 @@ all the commits needed for this release have been completed.
 
      $ git clean -fxd
      $ ./bootstrap --copy --gnulib-srcdir=/path/to/gnulib
-     $ ./tmpfs-config-make
+     $ ./developer-build
      $ cd build
      $ make distcheck -j8
 
@@ -77,7 +77,7 @@ all the commits needed for this release have been completed.
 
      $ rm -rf ./build/*
      $ autoreconf -f
-     $ ./tmpfs-config-make
+     $ ./developer-build
      $ cd build
      $ make distcheck -j8
      $ make dist-lzip
diff --git a/tests/during-dev.sh b/tests/during-dev.sh
index e7b9a8f..6a43b3b 100755
--- a/tests/during-dev.sh
+++ b/tests/during-dev.sh
@@ -16,7 +16,7 @@
 #      build directories) so if you need to make lots of temporary test
 #      files, there they won't get mixed up with non-output files.
 #
-# Combined with the `tmpfs-config-make', this script can be used to greatly
+# Combined with the `developer-build', this script can be used to greatly
 # simplify the development process. After running that script once, for
 # subsequent builds during your development, you can run this script from
 # the top source directory (by running `./tests/during-dev.sh', or giving
@@ -65,7 +65,7 @@
 # Set the basic test directories. If you are building over the source
 # directory, then set `builddir' to `./'. If you want the outputs to be in
 # the top source directory, set it to `./'. Since 'build' is the assumed
-# symbolic link in `tmpfs-config-make', it is also assumed in the version
+# symbolic link in `developer-build', it is also assumed in the version
 # controlled version of this script. Note, if your directory names have
 # space characters in them, quote the full value
 numjobs=8
diff --git a/tmpfs-config-make b/tmpfs-config-make
deleted file mode 100755
index 5149bcf..0000000
--- a/tmpfs-config-make
+++ /dev/null
@@ -1,137 +0,0 @@
-#! /bin/sh
-
-# This script will configure and build Gnuastro in parallel within a
-# temporary tmpfs directory in the RAM. Please see the "Configure and build
-# in RAM" section of the Gnuastro book/documentation for a full
-# explanation.
-#
-# Original author: Mohammad Akhlaghi <address@hidden>
-# Contributing author(s):
-#   Mosè Giordano <address@hidden>
-# Copyright (C) 2016-2018, Free Software Foundation, Inc.
-#
-# Gnuastro 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.
-#
-# Gnuastro 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.
-#
-# You should have received a copy of the GNU General Public License along
-# with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
-
-
-
-
-
-# Set the variables:
-NUM_THREADS=8
-TMPDIR=/dev/shm
-debug_noshared=0
-
-
-
-
-
-# Check if TMPDIR exists
-if [ ! -d $TMPDIR ]; then
-    echo "$TMPDIR doesn't exist. Aborted."
-    exit 1
-fi
-
-
-
-
-
-# Keep the address of this source directory (where this script is being run
-# from) which we will need later.
-srcdir=$(pwd)
-
-
-
-
-
-# Set the build directory name in tmpfs. If the .version file exists, use
-# it to allow multiple version builds there (which might happen during
-# development).
-basedir=$(basename -- "$srcdir")
-if [ -f .version ]; then
-    build_dir=$TMPDIR/"$basedir"-$(cat .version)
-else
-    build_dir=$TMPDIR/"$basedir"
-fi
-
-
-
-
-
-# Make the build directory in tmpfs (if it doesn't already exist).
-if [ ! -d $build_dir ]; then
-    mkdir $build_dir
-fi
-
-
-
-
-
-# Make a symbolic link to the tmpfs build directory for users to easily
-# access the built files and also follow the progress. We are first
-# deleting any existing symbolic link and remaking it since the possible
-# deletion of $build_dir during the development can complicate the
-# pre-existing symbolic link.
-build_sym=build
-if [ -h $build_sym ]; then
-    # Delete a harmless symbolic link, if present.
-    rm $build_sym
-fi
-
-
-
-
-
-# Create the link only if the symbolic link doesn't exist.
-if [ ! -e $build_sym ]; then
-    ln -s $build_dir $build_sym
-else
-    echo "$build_sym already exists here and is not a symbolic link."
-    echo "Aborted."
-    exit 1
-fi
-
-
-
-
-
-# Go into the build directory to start the configure and/or build:
-cd $build_dir
-
-
-
-
-
-# If a 'Makefile' doesn't exist, then configure Gnuastro.
-#
-# FOR DEBUGGING: uncomment the second half of this line. Gnuastro uses GNU
-# Libtool to build shared libraries for highly portable and maintainable
-# usage on a wide variety of systems. While this is great for binaries,
-# shared libraries can be a pain when debuggin. For this reason,
-# compilation of shared libraries can be turned off by specifying the
-# --disable-shared option to configure. With static libraries, compilation
-# (the `make' command) will also significantly speed up. Also, by default
-# (in `configure.ac'), we have set optimization flags which have to be
-# cancelled in debugging.
-if [ ! -f Makefile ]; then
-    if [ x$debug_noshared = x1 ]; then
-        $srcdir/configure --srcdir=$srcdir CFLAGS="-g -O0" --disable-shared
-    else
-        $srcdir/configure --srcdir=$srcdir
-    fi
-fi
-
-
-
-# Build Gnuastro in that directory with the specified number of threads
-make -kj$NUM_THREADS



reply via email to

[Prev in Thread] Current Thread [Next in Thread]