diff --git a/README b/README
index 2cc77b1cb4fa3e0b6d5fdad09821afc6eedd8484..fb675c3a2daa5c9386f4e0ddb7f9d8513aab2479 100644
--- a/README
+++ b/README
@@ -10,6 +10,22 @@ DESCRIPTION
 
     * http://singularity.lbl.gov/
 
+USAGE
+
+     1. Install Singularity on your local desktop, laptop, or virtual 
+        machine.
+
+            ./naked-singularity.sh install
+
+     2. Build a simple Ubuntu Singularity container.
+
+            ./naked-singularity.sh build -a ubuntu -d ubuntu.def 
+
+     3. Uninstall Singularity from your local desktop, laptop, or 
+        virtual machine.
+
+            ./naked-singularity.sh uninstall
+
 STATUS
 
     A work in progress. 
@@ -29,8 +45,8 @@ AUTHOR
 
 VERSION
 
-    0.3.0
+    0.3.1
 
 LAST UPDATED
 
-    Wednesday, April 18th, 2018
+    Tuesday, June 12th, 2018
diff --git a/definition-files/us/ucsd/sdsc/comet/deepbench/deepbench.def b/definition-files/us/ucsd/sdsc/comet/deepbench/deepbench.def
index 2498d2a0285181361a217b084bbf1f87fe27a9d1..cfb85a8d1e9156e362b26f7431b596a0f9412436 100644
--- a/definition-files/us/ucsd/sdsc/comet/deepbench/deepbench.def
+++ b/definition-files/us/ucsd/sdsc/comet/deepbench/deepbench.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME deepbench
     APPLICATION_VERSION unknown
     APPLICATION_URL https://github.com/baidu-research/DeepBench
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180327
+
+    SINGULARITY_IMAGE_SIZE 8192
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 201808524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
@@ -307,14 +315,3 @@ OSVersion: xenial
 %runscript
 
 %test
-
-    # Test DeepBench with 32-bit GEMM training benchmark
-    export PATH="/usr/local/cuda-8.0/bin${PATH:+:${PATH}}"
-    export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
-    export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}"
-    export PATH="/opt/openmpi-1.8.4/bin:${PATH}"
-    export LD_LIBRARY_PATH="/opt/openmpi-1.8.4/lib:${LD_LIBRARY_PATH}"
-    export PATH="/opt/DeepBench/code/bin:${PATH}"
-    export LD_LIBRARY_PATH="/opt/DeepBench/code/baidu-allreduce:${LD_LIBRARY_PATH}"
-
-    time -p gemm_bench train float
diff --git a/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-cpu.def b/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-cpu.def
index e511bf1473e25dae00b0c2d5720ae26a51c7bf39..49effc94de6bbaf289e88e08b271944aefd28e49 100644
--- a/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-cpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-cpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME keras + tensorflow
     APPLICATION_VERSION 2.1.5 + 1.7
     APPLICATION_URL https://keras.io/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180418
+
+    SINGULARITY_IMAGE_SIZE 16384
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-gpu.def b/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-gpu.def
index ed9e9235fe7c31001f1ce7183af24a849cad10a3..f70d5474d6e00c43643a9c337feeae97abfde81f 100644
--- a/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-gpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/keras/keras-tensorflow-gpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME keras + tensorflow
     APPLICATION_VERSION 2.1.5 + 1.7
     APPLICATION_URL https://keras.io/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180418
+
+    SINGULARITY_IMAGE_SIZE 16384
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/meep/meep.def b/definition-files/us/ucsd/sdsc/comet/meep/meep.def
index 9ac1eac07f8f9adb916686e2c0da96d9c60c5d19..588fb23771914bbb2529275ae939840a9ef67f38 100644
--- a/definition-files/us/ucsd/sdsc/comet/meep/meep.def
+++ b/definition-files/us/ucsd/sdsc/comet/meep/meep.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME meep
     APPLICATION_VERSION 1.4.3
     APPLICATION_URL https://www.open-mpi.org/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180315
+
+    SINGULARITY_IMAGE_SIZE 4092
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180530
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
@@ -247,9 +255,6 @@ OSVersion: xenial
     make
     make install
 
-    #export PATH="/opt/meep-1.4.3/bin:${PATH}"
-    #export LD_LIBRARY_PATH="/opt/meep-1.4.3/lib:${LD_LIBRARY_PATH}"
-
     # Set container environment variables
     cd /.singularity.d/env
     echo 'export PATH="/opt/openmpi-1.8.4/bin:${PATH}"' >> 90-environment.sh
@@ -279,5 +284,23 @@ OSVersion: xenial
 %test
     
     # Test MEEP (and MPB) with an example calculation
+
+    export PATH="/opt/openmpi-1.8.4/bin:${PATH}"
+    export LD_LIBRARY_PATH="/opt/openmpi-1.8.4/lib:${LD_LIBRARY_PATH}"
+    export PATH="/opt/harminv-1.4.1/bin:${PATH}"
+    export LD_LIBRARY_PATH="/opt/harminv-1.4.1/lib:${LD_LIBRARY_PATH}"
+    export PATH="/opt/libctl-4.0.0/bin:${PATH}"
+    export LD_LIBRARY_PATH="/opt/libctl-4.0.0/lib:${LD_LIBRARY_PATH}"
+    export LD_LIBRARY_PATH="/opt/zlib-1.2.11/lib:${LD_LIBRARY_PATH}"
+    export PATH="/opt/hdf5-1.10.1/hdf5/bin:${PATH}"
+    export LD_LIBRARY_PATH="/opt/hdf5-1.10.1/hdf5/lib:${LD_LIBRARY_PATH}"
+    export PATH="/opt/h5utils-1.13/bin:${PATH}"
+    export PATH="/opt/fftw-3.3.7/bin:${PATH}"
+    export LD_LIBRARY_PATH="/opt/fftw-3.3.7/lib:{LD_LIBRARY_PATH}"
+    export PATH="/opt/mpb-1.6.1/bin:${PATH}"
+    export LD_LIBRARY_PATH="/opt/mpb-1.6.1/lib:${LD_LIBRARY_PATH}"
+    export PATH="/opt/meep-1.4.3/bin:${PATH}"
+    export LD_LIBRARY_PATH="/opt/meep-1.4.3/lib:${LD_LIBRARY_PATH}"
+
     time -p meep /opt/meep-1.4.3/examples/parallel-wvgs-force.ctl
     time -p mpirun -np 2 meep /opt/meep-1.4.3/examples/parallel-wvgs-force.ctl
diff --git a/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-cpu.def b/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-cpu.def
index 9aba9050a615b04663a32f810f25aca6b8a17ca4..f14954a3827f6289ecd839bc3ffd004da00fda01 100644
--- a/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-cpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-cpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME mxnet-cpu
     APPLICATION_VERSION 1.1.0
     APPLICATION_URL http://mxnet.io
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180329
+
+    SINGULARITY_IMAGE_SIZE 8192
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-gpu.def b/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-gpu.def
index 5d73904c722b759acf6118b59aef9051db1e0b49..672e5b9a3a73d5274c2552355051f287abbfc60a 100644
--- a/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-gpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/mxnet/mxnet-gpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME mxnet-gpu
     APPLICATION_VERSION 1.1.0
     APPLICATION_URL http://mxnet.io
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180329
+
+    SINGULARITY_IMAGE_SIZE 16384
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/neon/neon-cpu.def b/definition-files/us/ucsd/sdsc/comet/neon/neon-cpu.def
index 1fee7b16147003cf642a7167d054940ef23bce43..17c8c4e9f8eae79eff0fe3903df101569aacf7c7 100644
--- a/definition-files/us/ucsd/sdsc/comet/neon/neon-cpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/neon/neon-cpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME neon
     APPLICATION_VERSION 2.6.0
     APPLICATION_URL https://ai.intel.com/neon/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180410
+
+    SINGULARITY_IMAGE_SIZE 8192
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-cpu.def b/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-cpu.def
index 9de4c3d575622ee991693032051ee04a6c8c3af3..b71e0044eabc8ce7512329577408b33d8609b801 100644
--- a/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-cpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-cpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME pytorch
     APPLICATION_VERSION 0.3.1
     APPLICATION_URL http://pytorch.org/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180322
+
+    SINGULARITY_IMAGE_SIZE 16384
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-gpu.def b/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-gpu.def
index 9c4a630febd228196d1e46cf18ed6a37b6bc39b3..274eab2ebd854530dec9f31da6940168bbe999f6 100644
--- a/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-gpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/pytorch/pytorch-gpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME pytorch
     APPLICATION_VERSION 0.3.1
     APPLICATION_URL http://pytorch.org/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180322
+
+    SINGULARITY_IMAGE_SIZE 32768
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-cpu.def b/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-cpu.def
index 10481b0093b387bb7ab2de54d73ff443d58900ed..3414a4092411038375b67bb1fe7c252e28fd4d4e 100644
--- a/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-cpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-cpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME tensorflow
-    APPLICATION_VERSION 1.7
+    APPLICATION_VERSION 1.8
     APPLICATION_URL https://www.tensorflow.org
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180329
+
+    SINGULARITY_IMAGE_SIZE 16384
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180601
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
@@ -81,20 +89,22 @@ OSVersion: xenial
     # Install Bazel from Debian Package
     apt-get -y install openjdk-8-jdk
     apt-get -y install zlib1g-dev
-    wget https://github.com/bazelbuild/bazel/releases/download/0.11.1/bazel_0.11.1-linux-x86_64.deb
-    dpkg -i bazel_0.11.1-linux-x86_64.deb
+    wget https://github.com/bazelbuild/bazel/releases/download/0.13.1/bazel_0.13.1-linux-x86_64.deb
+    dpkg -i bazel_0.13.1-linux-x86_64.deb
 
     # Install TensorFlow python(2) dependencies
     apt-get -y install python-numpy
     apt-get -y install python-dev
     apt-get -y install python-pip
     apt-get -y install python-wheel
+    apt-get -y install python-enum34
+    apt-get -y install python-mock
     
     # Download TensorFlow source
     cd /opt
     git clone https://github.com/tensorflow/tensorflow
     cd tensorflow
-    git checkout r1.7
+    git checkout r1.8
 
     # Build and install TensorFlow for python(2)
     echo '#!/usr/bin/expect -f' > install-tensorflow-python.exp
@@ -123,10 +133,12 @@ OSVersion: xenial
     echo 'send "N\r"' >> install-tensorflow-python.exp
     echo 'expect "Do you wish to build TensorFlow with CUDA support? \[y/N\]: "' >> install-tensorflow-python.exp
     echo 'send "N\r"' >> install-tensorflow-python.exp
+    echo 'expect "Do you wish to download a fresh release of clang? (Experimental) \[y/N\]: "' >> install-tensorflow-python.exp
+    echo 'send "N\r"' >> install-tensorflow-python.exp
     echo 'expect "Do you wish to build TensorFlow with MPI support? \[y/N\]: "' >> install-tensorflow-python.exp
     echo 'send "N\r"' >> install-tensorflow-python.exp
     echo 'expect "Please specify optimization flags to use during compilation when bazel option \"--config=opt\" is specified \[Default is -march=native\]: "' >> install-tensorflow-python.exp
-    echo 'send " -march=native\r"' >> install-tensorflow-python.exp
+    echo 'send " -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mtune=generic\r"' >> install-tensorflow-python.exp
     echo 'expect "Would you like to interactively configure ./WORKSPACE for Android builds? \[y/N\]: "' >> install-tensorflow-python.exp
     send 'send "N\r"' >> install-tensorflow-python.exp
     echo 'expect "> "' >> install-tensorflow-python.exp
@@ -134,16 +146,35 @@ OSVersion: xenial
     chmod +x install-tensorflow-python.exp
     ./install-tensorflow-python.exp
 
+    # Clear /home/root/.cache prior to bazel build. Otherwise, previous builds may cause some conflicts. See 'dangling symbolic links' at https://github.com/tensorflow/tensorflow/issues/13928
+    rm -rf /home/root/.cache
+
     bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
     bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg
 
-    pip install tensorflow_pkg/tensorflow-1.7.0-cp27-cp27mu-linux_x86_64.whl
+    pip install tensorflow_pkg/tensorflow-1.8.0-cp27-cp27mu-linux_x86_64.whl
+
+    # Install common python packages for data science and machine learning applications
+    apt-get -y install python-scipy
+    apt-get -y install python-pandas
+    apt-get -y install python-matplotlib
+    apt-get -y install ipython
+    apt-get -y install ipython-notebook
+    apt-get -y install python-sympy
+    apt-get -y install python-nose
+    apt-get -y install python-sklearn
+    apt-get -y install python-mlpy
+    apt-get -y install python-nltk
+    apt-get -y install python-statsmodels
+    apt-get -y install libopencv-dev
+    apt-get -y install python-opencv
 
     # Install TensorFlow python3 dependencies
     apt-get -y install python3-numpy
     apt-get -y install python3-dev
     apt-get -y install python3-pip
     apt-get -y install python3-wheel
+    apt-get -y install python3-mock
 
     # Build and install TensorFlow for python3
     echo '#!/usr/bin/expect -f' > install-tensorflow-python3.exp
@@ -168,14 +199,16 @@ OSVersion: xenial
     echo 'send "N\r"' >> install-tensorflow-python3.exp
     echo 'expect "Do you wish to build TensorFlow with VERBS support? \[y/N\]: "' >> install-tensorflow-python3.exp
     echo 'send "N\r"' >> install-tensorflow-python3.exp
-    echo 'expect "Do you wish to build TensorFlow with OpenCL support? \[y/N\]: "' >> install-tensorflow-python3.exp
+    echo 'expect "Do you wish to build TensorFlow with OpenCL SYCL support? \[y/N\]: "' >> install-tensorflow-python3.exp
     echo 'send "N\r"' >> install-tensorflow-python3.exp
     echo 'expect "Do you wish to build TensorFlow with CUDA support? \[y/N\]: "' >> install-tensorflow-python3.exp
     echo 'send "N\r"' >> install-tensorflow-python3.exp
+    echo 'expect "Do you wish to download a fresh release of clang? (Experimental) \[y/N\]: "' >> install-tensorflow-python.exp
+    echo 'send "N\r"' >> install-tensorflow-python.exp
     echo 'expect "Do you wish to build TensorFlow with MPI support? \[y/N\]: "' >> install-tensorflow-python3.exp
     echo 'send "N\r"' >> install-tensorflow-python3.exp
     echo 'expect "Please specify optimization flags to use during compilation when bazel option \"--config=opt\" is specified \[Default is -march=native\]: "' >> install-tensorflow-python3.exp
-    echo 'send " -march=native\r"' >> install-tensorflow-python3.exp
+    echo 'send " -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mtune=generic\r"' >> install-tensorflow-python3.exp
     echo 'expect "Would you like to interactively configure ./WORKSPACE for Android builds? \[y/N\]: "' >> install-tensorflow-python3.exp
     send 'send "N\r"' >> install-tensorflow-python3.exp
     echo 'expect "> "' >> install-tensorflow-python3.exp
@@ -186,22 +219,7 @@ OSVersion: xenial
     bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
     bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg
 
-    pip3 install tensorflow_pkg/tensorflow-1.7.0-cp35-cp35m-linux_x86_64.whl
-
-    # Install common python packages for data science and machine learning applications
-    apt-get -y install python-scipy
-    apt-get -y install python-pandas
-    apt-get -y install python-matplotlib
-    apt-get -y install ipython
-    apt-get -y install ipython-notebook
-    apt-get -y install python-sympy
-    apt-get -y install python-nose
-    apt-get -y install python-sklearn
-    apt-get -y install python-mlpy
-    apt-get -y install python-nltk
-    apt-get -y install python-statsmodels
-    apt-get -y install libopencv-dev
-    apt-get -y install python-opencv
+    pip3 install tensorflow_pkg/tensorflow-1.8.0-cp35-cp35m-linux_x86_64.whl
 
     # Install common python3 packages for data science and machine learning applications
     apt-get -y install python3-scipy
diff --git a/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-gpu.def b/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-gpu.def
index dd58267fa4859ae7c3c176e2f537374c750263e0..9eefb6b540bc9d63ecdf00743641fd0f9e0167e1 100644
--- a/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-gpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/tensorflow/tensorflow-gpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME tensorflow
-    APPLICATION_VERSION 1.7
+    APPLICATION_VERSION 1.8
     APPLICATION_URL https://www.tensorflow.org
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180331
+
+    SINGULARITY_IMAGE_SIZE 32768
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180601
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
@@ -149,11 +157,11 @@ OSVersion: xenial
     wget --wait=10 "${CUDA_REPO_URL}/cuda-runtime-8-0_8.0.44-1_amd64.deb"
     wget --wait=10 "${CUDA_REPO_URL}/cuda-demo-suite-8-0_8.0.44-1_amd64.deb"
 
-    wget --wait=10 "${ML_REPO_URL}/libcudnn6_6.0.21-1+cuda8.0_amd64.deb"
-    wget --wait=10 "${ML_REPO_URL}/libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libcudnn7_7.1.4.18-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libcudnn7-dev_7.1.4.18-1+cuda8.0_amd64.deb"
 
-    wget --wait=10 "${ML_REPO_URL}/libnccl2_2.1.2-1+cuda8.0_amd64.deb"
-    wget --wait=10 "${ML_REPO_URL}/libnccl-dev_2.1.2-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libnccl2_2.2.12-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libnccl-dev_2.2.12-1+cuda8.0_amd64.deb"
 
     # Install NVIDIA drivers, libraries, and packages
     dpkg -i nvidia-367_367.48-0ubuntu1_amd64.deb
@@ -197,41 +205,47 @@ OSVersion: xenial
     dpkg -i cuda-runtime-8-0_8.0.44-1_amd64.deb
     dpkg -i cuda-demo-suite-8-0_8.0.44-1_amd64.deb
 
-    dpkg -i libcudnn6_6.0.21-1+cuda8.0_amd64.deb
-    dpkg -i libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb
+    dpkg -i libcudnn7_7.1.4.18-1+cuda8.0_amd64.deb
+    dpkg -i libcudnn7-dev_7.1.4.18-1+cuda8.0_amd64.deb
+
+    dpkg -i libnccl2_2.2.12-1+cuda8.0_amd64.deb
+    dpkg -i libnccl-dev_2.2.12-1+cuda8.0_amd64.deb
 
-    dpkg -i libnccl2_2.1.2-1+cuda8.0_amd64.deb
-    dpkg -i libnccl-dev_2.1.2-1+cuda8.0_amd64.deb
+    # Fixing some TensorFlow and libnccl*.deb path issues ... 
+    mv /usr/lib/x86_64-linux-gnu/libnccl_static.a /usr/local/cuda-8.0/lib64/libnccl_static.a
+    mv /usr/lib/x86_64-linux-gnu/libnccl.so.2.2.12 /usr/local/cuda-8.0/lib64/libnccl.so.2.2.12
+    ln -s /usr/local/cuda-8.0/lib64/libnccl.so.2.2.12 /usr/local/cuda-8.0/lib64/libnccl.so.2
+    ln -s /usr/local/cuda-8.0/lib64/libnccl.so.2 /usr/local/cuda-8.0/lib64/libnccl.so
+    mv /usr/include/nccl.h /usr/local/cuda-8.0/include/nccl.h
+    ln -s /usr/local/cuda-8.0/lib64 /usr/local/cuda-8.0/lib
+    mv /usr/share/doc/libnccl2/NCCL-SLA.txt.gz /usr/local/cuda-8.0/NCCL-SLA.txt
 
     # Set paths to CUDA binaries and libraries
     export PATH="/usr/local/cuda-8.0/bin${PATH:+:${PATH}}"
     export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
-
-    ### Install Bazel using custom APT repository
-    ###apt-get -y install openjdk-8-jdk
-    ###echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
-    ###curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
-    ###apt-get -y update
-    ###apt-get -y install bazel
-    ###apt-get -y upgrade bazel
+    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda/extras/CUPTI/lib64"
 
     # Install Bazel from Debian Package
     apt-get -y install openjdk-8-jdk
     apt-get -y install zlib1g-dev
-    wget https://github.com/bazelbuild/bazel/releases/download/0.11.1/bazel_0.11.1-linux-x86_64.deb
-    dpkg -i bazel_0.11.1-linux-x86_64.deb
+    wget https://github.com/bazelbuild/bazel/releases/download/0.13.1/bazel_0.13.1-linux-x86_64.deb
+    dpkg -i bazel_0.13.1-linux-x86_64.deb
 
     # Install TensorFlow python(2) dependencies
-    apt-get -y install python-numpy
+    apt-get -y install python
     apt-get -y install python-dev
     apt-get -y install python-pip
     apt-get -y install python-wheel
+    apt-get -y install python-enum34
+    apt-get -y install python-mock
+    apt-get -y install python-numpy
 
-    # Download TensorFlow source
     cd /opt
+
+    # Download TensorFlow source
     git clone https://github.com/tensorflow/tensorflow
     cd tensorflow
-    git checkout r1.7
+    git checkout r1.8
 
     # Build and install TensorFlow for python(2)
     echo '#!/usr/bin/expect -f' > install-tensorflow-python.exp
@@ -261,15 +275,19 @@ OSVersion: xenial
     echo 'expect "Do you wish to build TensorFlow with CUDA support? \[y/N\]: "' >> install-tensorflow-python.exp
     echo 'send "Y\r"' >> install-tensorflow-python.exp
     echo 'expect "Please specify the CUDA SDK version you want to use, e.g. 7.0. \[Leave empty to default to CUDA 9.0\]: "' >> install-tensorflow-python.exp
-    echo 'send "8.0\r"' >> install-tensorflow-python.exp
+    echo 'send "8.0.44\r"' >> install-tensorflow-python.exp
     echo 'expect "Please specify the location where CUDA 8.0 toolkit is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python.exp
     echo 'send "/usr/local/cuda\r"' >> install-tensorflow-python.exp
     echo 'expect "Please specify the cuDNN version you want to use. \[Leave empty to default to cuDNN 7.0\]: "' >> install-tensorflow-python.exp
-    echo 'send "6.0.21\r"' >> install-tensorflow-python.exp
-    echo 'expect "Please specify the location where cuDNN 6.0.21 library is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python.exp
+    echo 'send "7.1.4.18\r"' >> install-tensorflow-python.exp
+    echo 'expect "Please specify the location where cuDNN 7.1.4.18 library is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python.exp
     echo 'send "/usr/lib/x86_64-linux-gnu\r"' >> install-tensorflow-python.exp
     echo 'expect "Do you wish to build TensorFlow with TensorRT support? \[y/N\]: "' >> install-tensorflow-python.exp
     echo 'send "N\r"' >> install-tensorflow-python.exp
+    echo 'expect "Please specify the NCCL version you want to use. \[Leave empty to default to NCCL 1.3\]:"' >> install-tensorflow-python.exp
+    echo 'send "2.2.12\r"' >> install-tensorflow-python.exp
+    echo 'expect "Please specify the location where NCCL 2 library is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python.exp
+    echo 'send "/usr/local/cuda\r"' >> install-tensorflow-python.exp
     echo 'expect "Please specify a list of comma-separated Cuda compute capabilities you want to build with.\r"' >> install-tensorflow-python.exp
     echo 'expect "You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.\r"' >> install-tensorflow-python.exp
     echo 'expect "Please note that each additional compute capability significantly increases your build time and binary size. \[Default is: 3.5,5.2\]"' >> install-tensorflow-python.exp
@@ -281,7 +299,7 @@ OSVersion: xenial
     echo 'expect "Do you wish to build TensorFlow with MPI support? \[y/N\]: "' >> install-tensorflow-python.exp
     echo 'send "N\r"' >> install-tensorflow-python.exp
     echo 'expect "Please specify optimization flags to use during compilation when bazel option \"--config=opt\" is specified \[Default is -march=native\]: "' >> install-tensorflow-python.exp
-    echo 'send " -march=native\r"' >> install-tensorflow-python.exp
+    echo 'send " -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mtune=generic\r"' >> install-tensorflow-python.exp
     echo 'expect "Would you like to interactively configure ./WORKSPACE for Android builds? \[y/N\]: "' >> install-tensorflow-python.exp
     send 'send "N\r"' >> install-tensorflow-python.exp
     echo 'expect "> "' >> install-tensorflow-python.exp
@@ -292,16 +310,40 @@ OSVersion: xenial
     # See https://github.com/tensorflow/tensorflow/issues/17801
     ln -s /usr/local/cuda-8.0/nvvm/libdevice/libdevice.compute_50.10.bc /usr/local/cuda-8.0/nvvm/libdevice/libdevice.10.bc
 
+    # See https://github.com/tensorflow/tensorflow/issues/19203
+    #     https://github.com/ghostplant/tensorflow-cuda8-optimized/blob/master/Dockerfile.tf18-py35-cuda8-cudnn6021
+    sed -i 's/^#if TF_HAS_.*$/#if !defined(__NVCC__)/g' tensorflow/core/platform/macros.h
+
+    # Clear /home/root/.cache prior to bazel build. Otherwise, previous builds may cause some conflicts. See 'dangling symbolic links' at https://github.com/tensorflow/tensorflow/issues/13928
+    rm -rf /home/root/.cache
+
     bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
     bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg
 
-    pip install tensorflow_pkg/tensorflow-1.7.0-cp27-cp27mu-linux_x86_64.whl
+    pip install tensorflow_pkg/tensorflow-1.8.0-cp27-cp27mu-linux_x86_64.whl
+
+    # Install common python packages for data science and machine learning applications 
+    apt-get -y install python-scipy
+    apt-get -y install python-pandas
+    apt-get -y install python-matplotlib
+    apt-get -y install ipython
+    apt-get -y install ipython-notebook
+    apt-get -y install python-sympy
+    apt-get -y install python-nose
+    apt-get -y install python-sklearn
+    apt-get -y install python-mlpy
+    apt-get -y install python-nltk
+    apt-get -y install python-statsmodels
+    apt-get -y install libopencv-dev
+    apt-get -y install python-opencv
 
     # Install TensorFlow python3 dependencies
-    apt-get -y install python3-numpy
+    apt-get -y install python3
     apt-get -y install python3-dev
     apt-get -y install python3-pip
     apt-get -y install python3-wheel
+    apt-get -y install python3-mock
+    apt-get -y install python3-numpy
 
     # Build and install TensorFlow for python3
     echo '#!/usr/bin/expect -f' > install-tensorflow-python3.exp
@@ -331,15 +373,21 @@ OSVersion: xenial
     echo 'expect "Do you wish to build TensorFlow with CUDA support? \[y/N\]: "' >> install-tensorflow-python3.exp
     echo 'send "Y\r"' >> install-tensorflow-python3.exp
     echo 'expect "Please specify the CUDA SDK version you want to use, e.g. 7.0. \[Leave empty to default to CUDA 9.0\]: "' >> install-tensorflow-python3.exp
-    echo 'send "8.0\r"' >> install-tensorflow-python3.exp
+    echo 'send "8.0.44\r"' >> install-tensorflow-python3.exp
     echo 'expect "Please specify the location where CUDA 8.0 toolkit is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python3.exp
     echo 'send "/usr/local/cuda\r"' >> install-tensorflow-python3.exp
     echo 'expect "Please specify the cuDNN version you want to use. \[Leave empty to default to cuDNN 7.0\]: "' >> install-tensorflow-python3.exp
-    echo 'send "6.0.21\r"' >> install-tensorflow-python3.exp
-    echo 'expect "Please specify the location where cuDNN 6.0.21 library is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python3.exp
+    echo 'send "7.1.4.18\r"' >> install-tensorflow-python3.exp
+    echo 'expect "Please specify the location where cuDNN 7.1.4.18 library is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python3.exp
     echo 'send "/usr/lib/x86_64-linux-gnu\r"' >> install-tensorflow-python3.exp
     echo 'expect "Do you wish to build TensorFlow with TensorRT support? \[y/N\]: "' >> install-tensorflow-python3.exp
     echo 'send "N\r"' >> install-tensorflow-python3.exp
+    echo 'expect "Please specify the NCCL version you want to use. \[Leave empty to default to NCCL 1.3\]:"' >> install-tensorflow-python3.exp
+    echo 'send "2.2.12\r"' >> install-tensorflow-python3.exp
+    echo 'expect "Please specify the location where NCCL 2 library is installed. Refer to README.md for more details. \[Default is /usr/local/cuda\]: "' >> install-tensorflow-python.exp
+    echo 'send "/usr/local/cuda\r"' >> install-tensorflow-python3.exp
+    echo 'expect "Do you wish to build TensorFlow with TensorRT support? \[y/N\]: "' >> install-tensorflow-python3.exp
+    echo 'send "N\r"' >> install-tensorflow-python3.exp
     echo 'expect "Please specify a list of comma-separated Cuda compute capabilities you want to build with.\r"' >> install-tensorflow-python3.exp
     echo 'expect "You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.\r"' >> install-tensorflow-python3.exp
     echo 'expect "Please note that each additional compute capability significantly increases your build time and binary size. \[Default is: 3.5,5.2\]"' >> install-tensorflow-python3.exp
@@ -351,7 +399,7 @@ OSVersion: xenial
     echo 'expect "Do you wish to build TensorFlow with MPI support? \[y/N\]: "' >> install-tensorflow-python3.exp
     echo 'send "N\r"' >> install-tensorflow-python3.exp
     echo 'expect "Please specify optimization flags to use during compilation when bazel option \"--config=opt\" is specified \[Default is -march=native\]: "' >> install-tensorflow-python3.exp
-    echo 'send " -march=native\r"' >> install-tensorflow-python3.exp
+    echo 'send " -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mtune=generic\r"' >> install-tensorflow-python3.exp
     echo 'expect "Would you like to interactively configure ./WORKSPACE for Android builds? \[y/N\]: "' >> install-tensorflow-python3.exp
     send 'send "N\r"' >> install-tensorflow-python3.exp
     echo 'expect "> "' >> install-tensorflow-python3.exp
@@ -359,28 +407,10 @@ OSVersion: xenial
     chmod +x install-tensorflow-python3.exp
     ./install-tensorflow-python3.exp
 
-    # See https://github.com/tensorflow/tensorflow/issues/17801
-    ln -s /usr/local/cuda-8.0/nvvm/libdevice/libdevice.compute_50.10.bc /usr/local/cuda-8.0/nvvm/libdevice/libdevice.10.bc
-
     bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
     bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg
 
-    pip3 install tensorflow_pkg/tensorflow-1.7.0-cp35-cp35m-linux_x86_64.whl
-
-    # Install common python packages for data science and machine learning applications
-    apt-get -y install python-scipy
-    apt-get -y install python-pandas
-    apt-get -y install python-matplotlib
-    apt-get -y install ipython
-    apt-get -y install ipython-notebook
-    apt-get -y install python-sympy
-    apt-get -y install python-nose
-    apt-get -y install python-sklearn
-    apt-get -y install python-mlpy
-    apt-get -y install python-nltk
-    apt-get -y install python-statsmodels
-    apt-get -y install libopencv-dev
-    apt-get -y install python-opencv
+    pip3 install tensorflow_pkg/tensorflow-1.8.0-cp35-cp35m-linux_x86_64.whl
 
     # Install common python3 packages for data science and machine learning applications
     apt-get -y install python3-scipy
@@ -397,6 +427,7 @@ OSVersion: xenial
     cd /.singularity.d/env
     echo 'export PATH="/usr/local/cuda-8.0/bin${PATH:+:${PATH}}"' >> 90-environment.sh
     echo 'export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"' >> 90-environment.sh
+    echo 'export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda/extras/CUPTI/lib64"' >> 90-environment.sh
 
     # Update database for mlocate
     updatedb
@@ -406,8 +437,3 @@ OSVersion: xenial
 %runscript
 
 %test
-
-    # Test TensorFlow for both python and python3
-    #time -p python /opt/tensorflow/tensorflow/examples/tutorials/mnist/mnist_deep.py
-    #time -p python3 /opt/tensorflow/tensorflow/examples/tutorials/mnist/mnist_deep.py
-
diff --git a/definition-files/us/ucsd/sdsc/comet/theano/theano-cpu.def b/definition-files/us/ucsd/sdsc/comet/theano/theano-cpu.def
index ff4faf3301297003d2d007935deb06fc112d419f..a0a867766064c0475d4ddcd5cdc04453c9902a6b 100644
--- a/definition-files/us/ucsd/sdsc/comet/theano/theano-cpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/theano/theano-cpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME theano
     APPLICATION_VERSION 1.0.1
     APPLICATION_URL https://developer.nvidia.com/cuda-zone
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180320
+
+    SINGULARITY_IMAGE_SIZE 8192
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/theano/theano-gpu.def b/definition-files/us/ucsd/sdsc/comet/theano/theano-gpu.def
index 5fb7b3d9e0c439eb261e0eafb8ec8014342fb730..4c8898b98e00181648604fa052bcebc2f6561f94 100644
--- a/definition-files/us/ucsd/sdsc/comet/theano/theano-gpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/theano/theano-gpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME theano
     APPLICATION_VERSION 1.0.1
     APPLICATION_URL https://developer.nvidia.com/cuda-zone
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180320
+
+    SINGULARITY_IMAGE_SIZE 16384
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180530
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/torch/torch-gpu.def b/definition-files/us/ucsd/sdsc/comet/torch/torch-gpu.def
index 6dc59e8b680914e728c462cf241ad5d53a596490..d091d1a12bb125cbdbf8e046d89e54a54886d70e 100644
--- a/definition-files/us/ucsd/sdsc/comet/torch/torch-gpu.def
+++ b/definition-files/us/ucsd/sdsc/comet/torch/torch-gpu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME torch7-nv
     APPLICATION_VERSION 0.10.7
     APPLICATION_URL http://torch.ch/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180327
+
+    SINGULARITY_IMAGE_SIZE 8192
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda-openmpi.def b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda-openmpi.def
index 43dddffe406a063b51c70614c67cb277156e1cc2..dd99a39daaed9da6b4fb0eb50ce3734695cce9db 100644
--- a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda-openmpi.def
+++ b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda-openmpi.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME cuda + openmpi
     APPLICATION_VERSION 8.0.44 + 1.8.4
     APPLICATION_URL https://www.open-mpi.org/faq/?category=runcuda
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180320
+
+    SINGULARITY_IMAGE_SIZE 8192
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
@@ -248,6 +256,9 @@ OSVersion: xenial
     apt-get -y install libnl-route-3-dev
     apt-get -y install libnl-utils
 
+    # Install OpenMPI dependencies
+    apt-get -y install zlib1g-dev
+
     # Download, build, and install CUDA-aware OpenMPI
     wget https://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.4.tar.gz
     tar -xzvf openmpi-1.8.4.tar.gz
@@ -274,13 +285,3 @@ OSVersion: xenial
 %runscript
 
 %test
-
-    export PATH="/usr/local/cuda-8.0/bin${PATH:+:${PATH}}"
-    export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
-    export PATH="/opt/openmpi-1.8.4/bin:${PATH}"
-    export LD_LIBRARY_PATH="/opt/openmpi-1.8.4/lib:${LD_LIBRARY_PATH}"
-
-    nvcc --version
-    ompi_info --parsable --all | grep mpi_built_with_cuda_support:value
-    ompi_info --all | grep btl_openib_have_cuda_gdr
-    ompi_info --all | grep btl_openib_have_driver_gdr
diff --git a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda.def b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda.def
index 768a618204f046b5a263de4d12388c09a23767d2..964707abca902fadcbc8701d3a5e92f298d694cf 100644
--- a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda.def
+++ b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-cuda.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME cuda
     APPLICATION_VERSION 8.0.44
     APPLICATION_URL https://developer.nvidia.com/cuda-zone
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180320
+
+    SINGULARITY_IMAGE_SIZE 8192
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180525
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
@@ -160,11 +168,11 @@ OSVersion: xenial
     wget --wait=10 "${CUDA_REPO_URL}/cuda-runtime-8-0_8.0.44-1_amd64.deb"
     wget --wait=10 "${CUDA_REPO_URL}/cuda-demo-suite-8-0_8.0.44-1_amd64.deb"
 
-    wget --wait=10 "${ML_REPO_URL}/libcudnn6_6.0.21-1+cuda8.0_amd64.deb"
-    wget --wait=10 "${ML_REPO_URL}/libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libcudnn7_7.1.4.18-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libcudnn7-dev_7.1.4.18-1+cuda8.0_amd64.deb"
 
-    wget --wait=10 "${ML_REPO_URL}/libnccl2_2.1.2-1+cuda8.0_amd64.deb"
-    wget --wait=10 "${ML_REPO_URL}/libnccl-dev_2.1.2-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libnccl2_2.2.12-1+cuda8.0_amd64.deb"
+    wget --wait=10 "${ML_REPO_URL}/libnccl-dev_2.2.12-1+cuda8.0_amd64.deb"
 
     # Install NVIDIA drivers, libraries, and packages
     dpkg -i nvidia-367_367.48-0ubuntu1_amd64.deb
@@ -208,11 +216,11 @@ OSVersion: xenial
     dpkg -i cuda-runtime-8-0_8.0.44-1_amd64.deb
     dpkg -i cuda-demo-suite-8-0_8.0.44-1_amd64.deb
 
-    dpkg -i libcudnn6_6.0.21-1+cuda8.0_amd64.deb
-    dpkg -i libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb
+    dpkg -i libcudnn7_7.1.4.18-1+cuda8.0_amd64.deb
+    dpkg -i libcudnn7-dev_7.1.4.18-1+cuda8.0_amd64.deb
 
-    dpkg -i libnccl2_2.1.2-1+cuda8.0_amd64.deb
-    dpkg -i libnccl-dev_2.1.2-1+cuda8.0_amd64.deb
+    dpkg -i libnccl2_2.2.12-1+cuda8.0_amd64.deb
+    dpkg -i libnccl-dev_2.2.12-1+cuda8.0_amd64.deb
 
     # Set paths to CUDA binaries and libraries
     export PATH="/usr/local/cuda-8.0/bin${PATH:+:${PATH}}"
diff --git a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-mvapich2.def b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-mvapich2.def
index a19150625f59ce1b37d4ea0669690dbab970e544..c7cbb131b3fe709cc6ccc5a501fffdd668914c2e 100644
--- a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-mvapich2.def
+++ b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-mvapich2.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME mvapich2
     APPLICATION_VERSION 2.1
     APPLICATION_URL http://mvapich.cse.ohio-state.edu/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180320
+
+    SINGULARITY_IMAGE_SIZE 2048
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180523
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-openmpi.def b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-openmpi.def
index 8434fcfdf30d4c420574e9421669314ab1288b27..77d96a07b02e4f99bc5847cf9fd7cb25a8086b85 100644
--- a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-openmpi.def
+++ b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu-openmpi.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
     APPLICATION_NAME openmpi
     APPLICATION_VERSION 1.8.4
     APPLICATION_URL https://www.open-mpi.org/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180320
+
+    SINGULARITY_IMAGE_SIZE 2048
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180524
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
@@ -111,6 +119,9 @@ OSVersion: xenial
     apt-get -y install libnl-route-3-dev
     apt-get -y install libnl-utils
 
+    # Install OpenMPI dependencies
+    apt-get -y install zlib1g-dev
+
     # Download, build, and install OpenMPI
     wget https://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.4.tar.gz
     tar -xzvf openmpi-1.8.4.tar.gz
@@ -135,7 +146,3 @@ OSVersion: xenial
 %runscript
 
 %test
-
-    export PATH="/opt/openmpi/bin:${PATH}"
-    export LD_LIBRARY_PATH="/opt/openmpi/lib:${LD_LIBRARY_PATH}"
-    mpirun --version
diff --git a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu.def b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu.def
index d17ea85d6db649efebcd4c583aef3a14da13812c..b1bbe7f55a8159c92a54d49b4917c325a2a778cb 100644
--- a/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu.def
+++ b/definition-files/us/ucsd/sdsc/comet/ubuntu/ubuntu.def
@@ -4,20 +4,28 @@ OSVersion: xenial
 
 %labels
 
-    AUTHOR_NAME Marty Kandes
-    AUTHOR_EMAIL mkandes@sdsc.edu
-    APPLICATION_NAME none
-    APPLICATION_VERSION none
-    APPLICATION_URL none
+    APPLICATION_NAME ubuntu
+    APPLICATION_VERSION 16.04
+    APPLICATION_URL https://www.ubuntu.com/
+
     SYSTEM_NAME comet
-    SYSTEM_SINGULARITY_VERSION 2.3.2
+    SYSTEM_SINGULARITY_VERSION 2.5.1
     SYSTEM_URL http://www.sdsc.edu/support/user_guides/comet.html
-    LAST_UPDATED 20180320
+
+    SINGULARITY_IMAGE_SIZE 2048
+
+    AUTHOR_NAME Marty Kandes
+    AUTHOR_EMAIL mkandes@sdsc.edu
+
+    LAST_UPDATED 20180523
 
 %setup
 
 %environment
 
+    # Set system locale
+    export LC_ALL=C
+
 %post -c /bin/bash
 
     # Set system locale
diff --git a/naked-singularity.sh b/naked-singularity.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9f25504568eaae2063db39ed8f077bfacef5a3d2
--- /dev/null
+++ b/naked-singularity.sh
@@ -0,0 +1,585 @@
+# ======================================================================
+#
+# NAME
+# 
+#     naked-singularity.sh
+#
+# DESCRIPTION
+#
+#     A bash script to help users create Singularity containers from the 
+#     definition (or recipe) files available in the naked-singularity 
+#     repository.
+#
+# USAGE
+#
+#     1. Install Singularity on your local desktop, laptop, or virtual 
+#        machine.
+#
+#            ./naked-singularity.sh install
+#
+#     2. Build a simple Ubuntu Singularity container.
+#
+#            ./naked-singularity.sh build -a ubuntu -d ubuntu.def 
+#
+#     3. Uninstall Singularity from your local desktop, laptop, or 
+#        virtual machine.
+#
+#            ./naked-singularity.sh uninstall
+#
+# LAST UPDATED
+#
+#     Friday, May 18th, 2018
+#
+# ----------------------------------------------------------------------
+
+naked_out() {
+
+  echo "naked-singularity: ${@}" >&1
+
+}
+
+
+naked_err() {
+
+  echo "naked-singularity: ERROR :: ${@}" >&2
+
+}
+
+
+naked_warn() {
+
+  echo "naked-singularity: WARNING :: ${@}" >&2
+
+}
+
+
+naked_build() {
+
+  local path_to_definition_file="${naked_dir}/definition-files"
+  local path_to_image="${naked_dir}/images"
+
+  local country='us'
+  local organization='ucsd'
+  local unit='sdsc'
+  local system='comet'
+  local application=''
+  local definition_file=''
+  local image=''
+  local -i image_size='-1'
+  local writable='false'
+  local force_overwrite='false'
+
+  naked_out "Read in all command-line options for 'build' command ..."
+
+  while (( "${#}" > 0 )); do
+    naked_out "Read in command-line option '${1}' with input value '${2}' ... "
+    case "${1}" in
+      -c | --country )
+        country="${2,,}"
+        shift 2
+        ;;
+      -o | --organization )
+        organization="${2,,}"
+        shift 2
+        ;;
+      -u | --unit )
+        unit="${2,,}"
+        shift 2
+        ;;
+      -s | --system )
+        system="${2,,}"
+        shift 2
+        ;;
+      -a | --application )
+        application="${2}"
+        shift 2
+        ;;
+      -d | --definition-file )
+        definition_file="${2}"
+        shift 2
+        ;;
+      -i | --image )
+        image="${2}"
+        shift 2
+        ;;
+      -z | --image-size )
+        image_size="${2}"
+        shift 2
+        ;;
+      -w | --writable )
+        writable='true'
+        shift 1
+        ;;
+      -f | --force-overwrite )
+        force_overwrite='true'
+        shift 1
+        ;;
+      *)
+        naked_err "Command-line option ${1} not recognized or not supported."
+        return 1
+    esac
+  done
+
+  naked_out "All command-line options for 'build' command have been read ... "
+
+  naked_out 'Check if DEFINITION FILE is exists ...'
+
+  if [[ -z "${country}" ]]; then
+    naked_err 'No COUNTRY code was provided.'
+    naked_err 'Use the -c (or --country) command-line option to specify the two-letter COUNTRY code where the target SYSTEM is located.'
+    naked_err 'Listing COUNTRY codes to choose from ... '
+    echo "ls ${path_to_definition_file}"
+    echo "$(ls "${path_to_definition_file}")"
+    return 1
+  fi
+
+  path_to_definition_file+="/${country}"
+
+  if [[ ! -d "${path_to_definition_file}" ]]; then
+    naked_err "${path_to_definition_file} does not exist."
+    naked_err 'Use the -c (or --country) command-line option to specify the two-letter COUNTRY code where the target SYSTEM is located.'
+    naked_err 'Listing all COUNTRYs to choose from ...'
+    echo "ls ${path_to_definition_file%/${country}}"
+    echo "$(ls "${path_to_definition_file%/${country}}")"
+    return 1
+  fi
+
+  if [[ -z "${organization}" ]]; then
+    naked_err 'No ORGANIZATION was provided.'
+    naked_err 'Use the -o (or --organization) command-line option to specify the acronym of the ORGANIZATION where the target SYSTEM is located.'
+    naked_err 'Listing all ORGANIZATIONs to choose from ... '
+    echo "ls ${path_to_definition_file}"
+    echo "$(ls "${path_to_definition_file}")"
+    return 1
+  fi
+
+  path_to_definition_file+="/${organization}"
+
+  if [[ ! -d "${path_to_definition_file}" ]]; then
+    naked_err "${path_to_definition_file} does not exist."
+    naked_err 'Use the -o (or --organization) command-line option to specify the acronym of the ORGANIZATION where the target SYSTEM is located.'
+    naked_err 'Listing all ORGANIZATIONs to choose from ...'
+    echo "ls ${path_to_definition_file%/${organization}}"
+    echo "$(ls "${path_to_definition_file%/${organization}}")"
+    return 1
+  fi
+
+  if [[ -z "${unit}" ]]; then
+    naked_err 'No UNIT was provided.'
+    naked_err 'Use the -u (or --unit) command-line option to specify the acronym of the UNIT that administers the target SYSTEM.'
+    naked_err 'Listing all UNITs to choose from ...'
+    echo "ls ${path_to_definition_file}"
+    echo "$(ls "${path_to_definition_file}")"
+    return 1
+  fi
+
+  path_to_definition_file+="/${unit}"
+
+  if [[ ! -d "${path_to_definition_file}" ]]; then
+    naked_err "${path_to_definition_file} does not exist."
+    naked_err 'Use the -u (or --unit) command-line option to specify the acronym of the UNIT that administers the target SYSTEM.'
+    naked_err 'Listing all UNITs to choose from ...'
+    echo "ls ${path_to_definition_file%/${unit}}"
+    echo "$(ls "${path_to_definition_file%/${unit}}")"
+    return 1
+  fi
+
+  if [[ -z "${system}" ]]; then
+    naked_err 'No SYSTEM name was provided.'
+    naked_err 'Use the -s (or --system) command-line option to specify the name of the target SYSTEM.'
+    naked_err 'Listing all SYSTEMs to choose from ...'
+    echo "ls ${path_to_definition_file}"
+    echo "$(ls "${path_to_definition_file}")"
+    return 1
+  fi
+
+  path_to_definition_file+="/${system}"
+
+  if [[ ! -d "${path_to_definition_file}" ]]; then
+    naked_err "${path_to_definition_file} does not exist."
+    naked_err 'Use the -s (or --system) command-line option to specify the name of the target SYSTEM.'
+    naked_err 'Listing all SYSTEMs to choose from ...'
+    echo "ls ${path_to_definition_file%/${system}}"
+    echo "$(ls "${path_to_definition_file%/${system}}")"
+    return 1
+  fi
+
+  if [[ -z "${application}" ]]; then
+    naked_err 'No APPLICATION name was provided.'
+    naked_err 'Use the -a (or --application) command-line option to specify the name of the APPLICATION to be run on the target SYSTEM.'
+    naked_err 'Listing all APPLICATIONs to choose from ...'
+    echo "ls ${path_to_definition_file}"
+    echo "$(ls "${path_to_definition_file}")"
+    return 1
+  fi
+
+  path_to_definition_file+="/${application}"
+
+  if [[ ! -d "${path_to_definition_file}" ]]; then
+    naked_err "${path_to_definition_file} does not exist."
+    naked_err 'Use the -a (or --application) command-line option to specify the name of the APPLICATION to be run on the target SYSTEM.'
+    naked_err 'Listing all APPLICATIONs to choose from ...'
+    echo "ls ${path_to_definition_file%/${application}}"
+    echo "$(ls "${path_to_definition_file%/${application}}")"
+    return 1
+  fi
+
+  if [[ -z "${definition_file}" ]]; then
+    naked_err 'No DEFINITION FILE was provided.'
+    naked_err 'Use the -d (or --definition-file) command-line option to specify the name of the DEFINITION FILE.'
+    naked_err 'Listing all DEFINITION FILEs to choose from ...'
+    echo "ls ${path_to_definition_file}"
+    echo "$(ls "${path_to_definition_file}")" 
+    return 1
+  fi
+
+  path_to_definition_file+="/${definition_file}"
+
+  if [[ ! -f "${path_to_definition_file}" ]]; then
+    naked_err "${path_to_definition_file} does not exist."
+    naked_err 'Use the -d (or --definition-file) command-line option to specify the name of the DEFINITION FILE.'
+    naked_err 'Listing all DEFINITION FILEs to choose from ...'
+    echo "ls ${path_to_definition_file%/${definition_file}}"
+    echo "$(ls "${path_to_definition_file%/${definition_file}}")"
+    return 1
+  fi
+
+  naked_out "DEFINITION FILE exists ... ${path_to_definition_file}"
+
+  naked_out 'Check if IMAGE exists ...'
+
+  if [[ -z "${image}" ]]; then
+    naked_warn 'WARNING :: No IMAGE name was provided.'
+    naked_warn 'Use the -i (or --image) command-line option to specify the name of the IMAGE.'
+    image="$(echo "${definition_file}" | sed 's/.def//')"
+    if [[ "${writable}" = 'true' ]]; then
+      image+='.img'
+    else
+      image+='.simg'
+    fi 
+    naked_out "Setting IMAGE name ... ${image}"
+  fi
+
+  path_to_image+="/${country}"
+  path_to_image+="/${organization}"
+  path_to_image+="/${unit}"
+  path_to_image+="/${system}"
+  path_to_image+="/${application}"
+  path_to_image+="/${image}"
+
+  if [[ ! -f "${path_to_image}" ]]; then
+    naked_out "${path_to_image} does not exist yet ..."
+    naked_out "Prepare to build a new Singularity IMAGE from ${path_to_definition_file} ..."
+    naked_out 'Make parent directories to accomodate new IMAGE if they do not exist already ...'
+    echo "mkdir -p $(dirname ${path_to_image})"
+    mkdir -p "$(dirname "${path_to_image}")"
+    if [[ "${writable}" = 'true' ]]; then
+      naked_out "Build new $(basename "${path_to_image}") as a writable ext3 Singularity IMAGE ..."
+      if (( "${image_size}" <= 0 )); then
+        naked_warn 'WARNING :: IMAGE_SIZE is less than or equal to zero.'
+        naked_warn 'IMAGE_SIZE is the size of the IMAGE in integer-valued units of MiB.'
+        naked_warn 'Attempting to set IMAGE SIZE from DEFINITION FILE ...'
+        grep 'SINGULARITY_IMAGE_SIZE' "${path_to_definition_file}"
+        if [[ "${?}" -ne 0 ]]; then
+          naked_err 'SINGULARITY_IMAGE_SIZE not found in DEFINITION FILE ... '
+          return 1
+        else
+          naked_out 'Setting IMAGE_SIZE equal to SINGULARITY_IMAGE_SIZE ... '
+          image_size="$(grep 'SINGULARITY_IMAGE_SIZE' "${path_to_definition_file}" | \
+                        sed s'/    SINGULARITY_IMAGE_SIZE //')"
+        fi
+      fi
+      naked_out 'Creating writable ext3 Singularity IMAGE now ...'
+      echo "singularity image.create --size ${image_size} ${path_to_image}"
+      singularity image.create --size "${image_size}" "${path_to_image}"
+      naked_out 'IMAGE created ...'
+      naked_out 'Starting build now ...'
+      echo "sudo singularity build --writable ${path_to_image} ${path_to_definition_file}"
+      sudo singularity build --writable "${path_to_image}" "${path_to_definition_file}"
+    else
+      naked_out "Build $(basename "${path_to_image}") as a read-only squashfs Singularity IMAGE ..."
+      naked_out 'Starting build now ...'
+      echo "sudo singularity build ${path_to_image} ${path_to_definition_file}"
+      sudo singularity build "${path_to_image}" "${path_to_definition_file}"
+    fi
+  else
+    naked_err "${path_to_image} already exists ..."
+    naked_err 'Cannot overwrite existing IMAGE ...'
+    return 1
+  fi
+
+  naked_out 'Build complete.'
+
+  return 0
+
+}
+
+
+naked_inspect() {
+
+  echo 'run singularity inspect command ... '
+
+}
+
+
+naked_install() {
+
+  local operating_system='ubuntu'
+  local prefix='/usr/local'
+  local version='2.5.1'
+
+  naked_out "Read in all command-line options of the 'install' command ..."
+
+  while (( "${#}" > 0 )); do
+    naked_out "Read in command-line option '${1}' with input value '${2}' ... "
+    case "${1}" in
+      -o | --os )
+        operating_system="${2,,}"
+        shift 2
+        ;;
+      -p | --prefix )
+        prefix="${2}"
+        shift 2
+        ;;
+      -v | --version )
+        version="${2}"
+        shift 2
+        ;;
+      *)
+        naked_err "Command-line option ${1} not recognized or not supported."
+        return 1
+    esac
+  done
+
+  naked_out "All command-line options for 'install' command have been read ... "
+
+  naked_out 'Checking if Singularity is already installed on this system ...'
+  echo 'singularity --version'
+  singularity --version
+  if [[ "${?}" -eq 0 ]]; then
+    naked_err 'Singularity is already installed on this system!'
+    naked_err 'Please uninstall the existing version of Singularity prior to installing a new version.'
+    return 1
+  fi
+
+  naked_out 'Singularity is not yet installed on this system ...'
+
+  if [[ "${operating_system}" = 'centos' ]]; then
+
+    naked_out 'Running update ...'
+    echo 'sudo yum -y update'
+    sudo yum -y update
+
+    naked_out 'Installing Singularity dependencies ...'
+    echo "sudo yum groupinstall -y 'Development Tools'"
+    sudo yum groupinstall -y 'Development Tools'
+    echo 'yum install -y libarchive-devel'
+    yum install -y libarchive-devel
+
+  elif [[ "${operating_system}" = 'ubuntu' ]]; then
+
+    naked_out 'Running update ...'
+    echo 'sudo apt-get -y update'
+    sudo apt-get -y update
+
+    naked_out 'Installing Singularity dependencies ...'
+    echo 'sudo apt-get -y install python'
+    sudo apt-get -y install python
+    echo 'sudo apt-get -y install dh-autoreconf'
+    sudo apt-get -y install dh-autoreconf
+    echo 'sudo apt-get -y install build-essential'
+    sudo apt-get -y install build-essential
+    echo 'sudo apt-get -y install libarchive-dev'
+    sudo apt-get -y install libarchive-dev
+    echo 'sudo apt-get -y install debootstrap'
+    sudo apt-get -y install debootstrap
+    echo 'sudo apt-get -y install squashfs-tools'
+    sudo apt-get -y install squashfs-tools
+
+  else
+
+    naked_err 'Operating system not recognized or not supported.'
+    return 1
+
+  fi
+
+  naked_out 'Downloading Singularity source code...'
+  echo "wget https://github.com/singularityware/singularity/releases/download/${version}/singularity-${version}.tar.gz"
+  wget "https://github.com/singularityware/singularity/releases/download/${version}/singularity-${version}.tar.gz"
+
+  naked_out 'Extracting Singularity source code...'
+  echo "tar -xzvf singularity-${version}.tar.gz"
+  tar -xzvf singularity-${version}.tar.gz
+
+  naked_out 'Configuring Singularity ...'
+  echo "cd singularity-${version}"
+  cd "singularity-${version}"
+  echo "./configure --prefix=${prefix}"
+  ./configure --prefix="${prefix}"
+
+  naked_out 'Compiling Singularity ...'
+  echo 'make'
+  make
+
+  naked_out 'Installing Singularity ...'
+  echo 'sudo make install'
+  sudo make install
+
+  naked_out 'Checking if Singularity was installed successully ...'
+  singularity --version
+  if [[ "${?}" -ne 0 ]]; then
+    naked_err 'Singularity was NOT installed successfully ...'
+    return 1
+  fi
+
+  naked_out 'Singularity was installed successfully!'
+
+  naked_out 'Cleaning up ...'
+  cd ../
+  rm -rf "singularity-${version}.tar.gz"
+  rm -rf "singularity-${version}"
+
+  return 0
+
+}
+
+
+naked_shell() {
+
+  echo 'run singularity shell command ... '
+
+}
+
+
+naked_uninstall() {
+
+  local prefix='/usr/local'
+
+  naked_out "Read in all command-line options of the 'uninstall' command ..."
+
+  while (( "${#}" > 0 )); do
+    naked_out "Read in command-line option '${1}' with input value '${2}' ... "
+    case "${1}" in
+      -p | --prefix )
+        prefix="${2}"
+        shift 2
+        ;;
+      *)
+        naked_err "Command-line option ${1} not recognized or not supported."
+        return 1
+    esac
+  done
+
+  naked_out "All command-line options for 'uninstall' command have been read ... "
+
+  naked_out 'Checking if Singularity is installed ...'
+  echo 'singularity --version'
+  singularity --version
+  if [[ "${?}" -ne 0 ]]; then
+    naked_err 'Singularity is not installed on this system.'
+    return 1
+  fi
+
+  naked_out 'Uninstalling Singularity ...'
+  sudo rm -rf "${prefix}/libexec/singularity"
+  sudo rm -rf "${prefix}/etc/singularity"
+  sudo rm -rf "${prefix}/include/singularity"
+  sudo rm -rf "${prefix}/lib/singularity"
+  sudo rm -rf "${prefix}/var/lib/singularity"
+  sudo rm "${prefix}/bin/singularity"
+  sudo rm "${prefix}/bin/run-singularity"
+  sudo rm "${prefix}/etc/bash_completion.d/singularity"
+  sudo rm "${prefix}/man/man1/singularity.1"
+
+  naked_out 'Checking if Singularity was uninstalled successfully ...'
+  which singularity
+  if [[ "${?}" -eq 0 ]]; then
+    naked_err 'Singularity was NOT uninstalled!'
+    return 1
+  fi
+
+  naked_out 'Singularity was uninstalled successfully!'
+
+  return 0
+
+}
+
+
+naked_upload() {
+
+  echo 'Upload image to users HOME directory on target system ...'
+
+}
+
+
+naked_verify() {
+
+  echo 'Verify checksums of definition file and image match ... '
+
+}
+
+
+main() {
+
+  local naked_command=''
+  local naked_dir="${PWD}"
+
+  if (( "${#}" > 0 )); then # at least one command-line arguments was
+    # provided. The first argument is expected to be main command issued 
+    # by the user. Read in that command and then determine if it is a
+    # valid command.
+
+    naked_command="${1}"
+    shift 1
+
+    if [[ "${naked_command}" = 'build' ]]; then
+
+      naked_build "${@}"
+      if [[ "${?}" -ne 0 ]]; then
+        exit 1
+      fi
+
+    elif [[ "${naked_command}" = 'install' ]]; then
+
+      naked_install "${@}"
+      if [[ "${?}" -ne 0 ]]; then
+        exit 1
+      fi
+
+    elif [[ "${naked_command}" = 'uninstall' ]]; then
+
+      naked_uninstall "${@}"
+      if [[ "${?}" -ne 0 ]]; then
+        exit 1
+      fi
+
+    elif [[ "${naked_command}" = 'help' || \
+            "${naked_command}" = '-h' || \
+            "${naked_command}" = '--help' ]]; then # return help. 
+
+      echo "USAGE: naked-singularity.sh <command> [options] {values}"
+      echo ""
+      echo "Finish writing help later ... ."
+
+    else
+
+      naked_err 'Command not recognized or not supported.'
+      exit 1
+
+    fi
+
+  else
+
+    naked_err 'No command-line arguments were provided.'
+    exit 1
+
+  fi
+  
+  exit 0
+
+}
+
+
+main "${@}"
+
+# ======================================================================