This distribution contains the sources to build pqR on Windows.  See
the file `README' for fuller details (written for R-2.15.0, but mostly
also applicable to pqR).

Details on building pqR are given in the `R Installation and
Administration Manual' in the doc/manual directory.  An HTML version
is at doc/html/R-admin.html, unless you're using a development version
of pqR (from github).  Information about success or lack thereof in
installing pqR on various systems can also be found via the
pqR-project.org site.

The short version of these instructions, easier to read but maybe not
always completely adequate, is as follows:

  0) Some general notes:

         o The build process takes a while, minutes to an hour or so,
           depending on how fast your computer is.  Don't conclude
           that the "make" command used below has hung up just because
           it's taking a while.  It's important that the computer not
           automatically decide to go to sleep while the build is
           progressing.

         o You may have to disable anti-virus software, which can
           interfere with the build process by doing things like
           opening a file that was created to snoop on it, leading to
           an error when the build process tries to change the file
           while another process has it open.

         o Some general knowledge of how the Windows command prompt
           window works will be helpful.  In particular, note that if
           any of the file names referred to below have spaces in them
           (possible because your user name has spaces), it will be
           necessary to enclose the file name in double quotes ("..").

         o Text files in the distribution follow the Linux/Unix/Mac
           convention of marking ends of lines with LF only, whereas
           Windows uses CR + LF.  Because of this, some Windows tools
           won't show them correctly (though the "more" and "cat"
           commands should work).  If you already have a version of R
           installed, you can edit such files with the RGui or RStudio
           editor.  On recent Windows 10 versions, notepad should also
           work.  You can also look at files with a web browser.

  1) Obtain TeX from somewhere, such as http://miktex.org.  (If you
     get the basic MiKTeX version, note that it will at times ask
     about downloading more parts of TeX, and that this may result in
     the build process appearing to hang if the window that MiKTeX
     puts up asking about this is covered by another window.)

  2) Obtain Rtools33.exe from http://pqR-project.org/Rtools33.exe (do
     not use the version obtainable via r-project.org, which is a
     later version not tested with pqR).  Run this to install the
     required build tools, but do not choose the options to install
     "extra" material for 32 or 64 bit builds of R itself (since this
     can cause problems with ownership or permissions for files).
     Enable the option to update your path to include Rtools programs.

  3) Download the pqR source from pqR-project.org, as a file with a
     name of the form pqR-YYYY-MM-DD.tar.gz.

  4) Download one or the other of the files pqR-win-extras-32.tar.gz
     or pqR-win-extras-64.tar.gz from pqR-project.org, for a 32-bit or
     64-bit build.  (If you like, you can do a 32-bit build on a
     64-bit system.)  These files contain some extra stuff to be added
     to the source that is needed for some features of Windows builds,
     which you will have skipped installing in step (2).

  5) Start a Windows console ("command prompt") window, and issue the
     following commands (which, apart from the first, you should also
     issue when starting any other console windows you use):

         mkdir c:\tmp
         set TMPDIR=c:\tmp
         set CYGWIN=nodosfilewarning
         set TAR_OPTIONS=--no-same-owner
         set TAR=<path-to-where-you-put-Rtools>\bin\tar.exe

     You can replace c:\tmp with some other directory if you wish.

  6) Change to a directory in which you wish the pqR source/build
     directory to be created, using the "cd" command.  Then untar the
     file you downloaded in step (2) with the following command:

         tar -xvf <path-to-where-you-put>\pqR-YYYY-MM-DD.tar.gz

     This will create the directory pqR-YYYY-MM-DD, which is both the
     source directory and the directory in which pqR will be built.
     If you wish, you can rename this directory now (but not later),
     using the "mv" command.

  7) Change into the pqR-YYYY-MM-DD directory, and in it untar the 
     win-extra file you downloaded in step (4), as follows (or 
     similarly for 32 rather than 64):

         tar -xvf <path-to-where-you-put>\pqR-win-extras-64.tar.gz

  8) Change to the src\gnuwin32 sub-directory of the source/build
     directory.

  9) Copy either MkRules.dist32 or MkRules.dist64 to MkRules.local and
     possibly edit MkRules.local as appropriate.  For example, if
     runing 64-bit Windows, you might use the command

         cp MkRules.dist64 MkRules.local

     Note that the names are case-sensitive!

     MkRules.dist32 should work for any Windows XP, Vista, 7, 8, or 10
     system (in conjunction with pqR-win-extras-32), but on 64-bit systems
     will be slower and more memory-limited than using MkRules.dist64
     (with pqR-win-extras-64).  See the comments in the MkRules files for
     more details.

 10) Possibly edit the options (eg, whether helper threads or
     compressed pointers are enabled) at the start of fixed\h\config.h
     (in src\gnuwin32).

 11) (OPTIONAL) If you want the base and recommended packages to be byte 
     compiled, enter the commands

          set R_NO_BASE_COMPILE=FALSE
          set R_PKG_BYTECOMPILE=TRUE

     Note that byte compilation is NOT recommended, so you should 
     probably NOT do this.

     The compiled byte code will not actually be used unless the 
     following command is also entered each time before R is run:

          set R_USE_BYTECODE=TRUE

 12) Issue the following commands in a Windows console (command
     prompt) window (after issuing the commands in step (5)), in order
     to build pqR in-place in the source directory:

          make all recommended >make.out 2>&1
          cd bitmap
          make >make.out 2>&1
          cd ..
          make cairodevices >make-cairo.out 2>&1

     The first "make" command will take a while.  You can monitor the
     make.out files from another console window to see how things are
     progressing during the build.  Or you can view the file in a web
     browser (eg, firefox), and refresh the page to see how the build
     is progressing.

 13) You should now be able to run Rterm.exe, by typing the command
     <build-dir>\bin\<arch>\Rterm.exe to the Windows console, where
     <build-dir> is the source/build directory you are using and
     <arch> is i386 for 32-bit builds and x64 for 64-bit builds.

     The number of helper threads to use can be specified by 

         set R_HELPERS=<number>

     before running Rterm.  The default if this is not set is 0.

 14) You can check the installation by running the command

         make check-all >check-all.out 2>&1

     in src/gnuwin32.  You can monitor the results by looking at
     check-all.out in another console window.  You can run this check
     with varying numbers of helper threads, set as above.

 15) You can make the PDF manuals (when in src/gnuwin32) with

         make manuals >make-manuals.out 2>&1

 16) You should be able to run the R Gui by typing the command
     <build-dir>\bin\<arch>\RGui.exe to the Windows command prompt.
     The number of helper threads can be set as for Rterm.

 17) The programs R.exe and Rscript.exe in <build-dir>\bin should also
     work now, with the number of helper threads set as above.