From e34137f7c2423edbb9551dbb3b40d6a60149724e Mon Sep 17 00:00:00 2001
From: Aaron Councilman <aaronjc4@illinois.edu>
Date: Mon, 18 Apr 2022 09:51:42 -0500
Subject: [PATCH] Remove hard-coded thread numbers for building, document RAM
 requirements

---
 hpvm/docs/build-hpvm.rst      | 10 ++++++----
 hpvm/docs/tutorials/index.rst |  7 ++++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/hpvm/docs/build-hpvm.rst b/hpvm/docs/build-hpvm.rst
index 5f9a5b9588..c2fe79754c 100644
--- a/hpvm/docs/build-hpvm.rst
+++ b/hpvm/docs/build-hpvm.rst
@@ -155,11 +155,13 @@ The HPVM installer script can be used to automatically download extra components
 
   .. code-block:: shell
 
-   ./install.sh -j32 DCMAKE_BUILD_TYPE=Release
+   ./install.sh -j<n> DCMAKE_BUILD_TYPE=Release
 
-  will compile HPVM with 32 threads in Release mode; similarly, inputting
-  ``DCMAKE_BUILD_TYPE=Release`` to the prompt will also send ``-DCMAKE_BUILD_TYPE=Release``
-  to CMake which gives a build in Release mode.
+  will compile HPVM in Release mode. In this, ```<n>``` should be replaced by
+  the number of threads to build with. Note that HPVM requires nearly 16 GB of
+  RAM to build single-threaded and the usage increases (though not linearly) as
+  the number of threads is increased. If you encounter Out of Memory or similar
+  errors during compilation, try decreasing the number of threads.
 
 After configuring HPVM,
 the installer will also compile HPVM by default, which you can opt out of.
diff --git a/hpvm/docs/tutorials/index.rst b/hpvm/docs/tutorials/index.rst
index bf9097dd86..de1cde3ccf 100644
--- a/hpvm/docs/tutorials/index.rst
+++ b/hpvm/docs/tutorials/index.rst
@@ -18,9 +18,14 @@ Next, build hpvm using the provided installer as follows:
 
 .. code-block:: shell
 
-  ./install.sh -j32 DCMAKE_BUILD_TYPE=Release
+  ./install.sh -j<n> DCMAKE_BUILD_TYPE=Release
 
 This script will download the required LLVM release and build HPVM.
+In this, ```<n>``` should be replaced with the number of threads to build with.
+Note that HPVM requires nearly 16 GB of RAM to build single-threaded and this
+increases (though not linearly) as the number of threads is increased. If you
+encounter Out of Memory or similar errors during compilation, try decreasing
+the number of threads.
 
 For more details on building HPVM, check out the :doc:`detailed build instructions <../build-hpvm>`.
 
-- 
GitLab