gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 18986ab 6/7: Tmpfs build script included in th


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 18986ab 6/7: Tmpfs build script included in the distribution tarball
Date: Thu, 4 Aug 2016 23:21:06 +0000 (UTC)

branch: master
commit 18986ab8930fdc9c627e7f6b5a7a2bc000b46d1e
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Tmpfs build script included in the distribution tarball
    
    The script to configure and build in tmpfs will now be included in the
    Gnuastro distribution. Two other minor corrections were made with this 
commit:
    
     - The script was renamed to 'tmpfs-config-make' to be shorter and more
       clear.
    
     - The directory in tmpfs now also includes the version number (if
       '.version' exists) incase multiple builds are done during development.
---
 Makefile.am                                  |    8 ++---
 parallel-build-in-tmpfs => tmpfs-config-make |   41 ++++++++++++++++++--------
 2 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d437df5..aeab85b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -113,10 +113,10 @@ dist_doc_DATA = README
 
 ## Files that are only distributed
 ## ===============================
-EXTRA_DIST = bootstrap bootstrap.conf genauthors .dir-locals.el .version  \
-             bootstrapped/m4/gnulib-cache.m4 bootstrapped/README         \
-             .autom4te.cfg lib/gnuastro/commonargs.h                     \
-             lib/gnuastro/commonparams.h lib/gnuastro/fixedstringmacros.h \
+EXTRA_DIST = bootstrap bootstrap.conf genauthors .dir-locals.el .version   \
+             tmpfs-config-make bootstrapped/m4/gnulib-cache.m4             \
+             bootstrapped/README .autom4te.cfg lib/gnuastro/commonargs.h   \
+             lib/gnuastro/commonparams.h lib/gnuastro/fixedstringmacros.h  \
              lib/gnuastro/neighbors.h lib/gnuastro/README
 
 
diff --git a/parallel-build-in-tmpfs b/tmpfs-config-make
similarity index 74%
rename from parallel-build-in-tmpfs
rename to tmpfs-config-make
index f7dec41..bb2153f 100755
--- a/parallel-build-in-tmpfs
+++ b/tmpfs-config-make
@@ -2,13 +2,18 @@
 
 # This script will configure and build Gnuastro in parallel within a
 # temporary tmpfs directory in the RAM. Then it will create a symbolic link
-# to access that temporary directory called 'build'.
+# to access that temporary directory which is called 'build'. Ideally this
+# script should only be run the first time when you want to run
+# './configure' and 'make'. For future builds 'make' should be run in the
+# 'build' directory, either run 'cd build' first, or 'make -C build'. If
+# the configure script dependencies didn't change, you can also run this
+# script again to run make in the build directory.
 #
 # MOTIVATION:
 #
 # The configure and build process involves the creation, reading, and
 # modification of a large number of files (input/output, or I/O). Therefore
-# I/O issues can directly affect the work of developers who need to
+# file I/O issues can directly affect the work of developers who need to
 # configure and build Gnuastro numerous times. Some such issues are listed
 # below:
 #
@@ -23,12 +28,13 @@
 #
 # One solution to these problems is the tmpfs file system (see
 # https://en.wikipedia.org/wiki/Tmpfs). Any file in tmpfs is actually
-# stored in the RAM (and possibly SAWP), not on HDDs or SSDs. Therefore the
-# large number of small file I/O will not harm the HDDs or SSDs. However,
-# due to the volatile nature of RAM, files in the tmpfs filesystem will be
-# permanently lost after a power-off, since they are all derivative files
-# (not files that have been directly manipulated) there is no problem in
-# this and this feature can be considered and automatic cleanup.
+# stored in the RAM (and possibly SAWP), not on HDDs or SSDs. The RAM is
+# built for a large number of fast file I/O. Therefore the large number of
+# file I/O will not harm the HDDs or SSDs. However, due to the volatile
+# nature of RAM, files in the tmpfs filesystem will be permanently lost
+# after a power-off. Since all configured and built files are derivative
+# files (not files that have been directly written by hand) there is no
+# problem in this and this feature can be considered and automatic cleanup.
 #
 # The modern GNU C library (and thus the Linux kernel) define the
 # '/dev/shm' directory for this purpose (POSIX shared memory). Therefore
@@ -43,7 +49,7 @@
 # there. In Emacs, the command to be run with the 'M-x compile' command can
 # be changed to 'cd build; make -kjN' (N is an integer >=1) instead of the
 # default 'make -k'. In this manner, the 'M-x recompile' command to be run
-# duringn the development will also build in the RAM while you modify the
+# during the development will also build in the RAM while you modify the
 # source in your non-volatile HDD or SSD.
 #
 # To further speed up the build process, this script will build ('make')
@@ -84,9 +90,17 @@ if [ ! -d $TMPDIR ]; then
 fi
 
 
-# First make the Gnuastro temporary directory (if it doesn't already
-# exist).
-build_dir=$TMPDIR/gnuastro
+# 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).
+if [ -f .version ]; then
+    build_dir=$TMPDIR/gnuastro-$(cat .version)
+else
+    build_dir=$TMPDIR/gnuastro
+fi
+
+
+# Make the build directory in tmpfs (if it doesn't already exist).
 if [ ! -d $build_dir ]; then
     mkdir $build_dir
 fi
@@ -103,8 +117,9 @@ if [ -h $build_sym ]; then
     rm $build_sym
 fi
 
+
+# Create the link only if the symbolic link doesn't exist.
 if [ ! -e $build_sym ]; then
-    # Create the link only if the target doesn't exist.
     ln -s $build_dir $build_sym
 else
     echo "$build_sym already exists here and is not a symbolic link."



reply via email to

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