How to Upgrade Your Numerical Recipes Code to Version 2.08

This page contains links to all the files needed to upgrade any Second Edition version of Numerical Recipes to version 2.08. The information density on this page is high, so you may want to print it out.

Important Note: Versions 2.06 and 2.08 of Numerical Recipes are both "benchmark releases". This means that you will need to upgrade any earlier version to 2.06 before upgrading to 2.08, and that future upgrades will require upgrading to at least version 2.08 as a starting point. The reason is that there are extensive changes in the distribution formats between versions 2.06 and 2.08.

Upgrade Instructions from 2.06 to 2.08

All upgrade patch files are free, and may be copied or redistributed without limit. The original Numerical Recipes files, and the corrected versions, after patching, are of course subject to the distribution restrictions of your original license.

Product Files You Must Have Patch File to Download See Notes
2.06 Diskette in C
(identify by .AR files)
disk.id
install.dat
install.exe
nrc20rec.ar
nrc20exa.ar
C206A08.EXE Notes 1,2
2.06 Download in C disk.id
install.dat
nr.ico
nrc206h.hlp
nrcopy16.dll
nrcopy32.dll
readme.doc
setup.exe
C206H08.EXE Note 1
2.06 Windows CDROM
C install files
C206R08.EXE Note 1
2.06 Diskette in Fortran
(identify by .AR files)
disk.id
install.dat
install.exe
nrf20rec.ar
nrf20exa.ar
F206A08.EXE Notes 1,2
2.06 Download Type A
in Fortran
disk.id
install.dat
nr.ico
nrcopy16.dll
nrcopy32.dll
nrf206h.hlp
dummy.hlp [Note 4]
readme.doc
setup.exe
F206E08.EXE Notes 1,3,4
2.06 Download Type B
in Fortran
or
2.06H Diskette in Fortran
disk.id
install.dat
nr.ico
nr7f206h.hlp
nr9f206h.hlp
nrcopy.dll
nrcopy17.dll
nrcopy32.dll
readme.doc
setup.exe
F206H08.EXE Notes 1,3
2.06 Windows CDROM
Fortran install files
same as Type B above, except nrcopy.dll NOT needed F206R08.EXE Note 1
2.06 UNIX tar files from Download or UNIX CDROM
(Move files and perform upgrade on a DOS or Windows PC. This is the preferred upgrade method for UNIX tar files.)
any or all of:
c-ansi.tar
c-kr.tar
f77.tar
f90.tar
CF206U08.EXE Notes 1,5
2.06 UNIX tar files from Download or UNIX CDROM
(Use UNIX "patch" command on UNIX machine. Above method is better if you can move the tar files in binary mode to/from a DOS or Windows PC.)
c-ansi.tar UCA206b08.txt or UCA206b08.uu Note 6
c-kr.tar UCK206b08.txt or UCK206b08.uu
f77.tar or recipes_f.tar U7F206b08.txt or U7F206b08.uu
f90.tar U9F206b08.txt or U9F206b08.uu
recipes_c.tar Same as upgrading both c-ansi.tar and c-kr.tar .
Individual Version 2.06 Numerical Recipes routines or directories containing multiple such routines Use the language-appropriate U??206b08.txt file above. In a text editor, search for patches of interest. Apply patches by hand, or using UNIX-style patch program on UNIX machine or equivalent on DOS or Windows PC. Notes 6,7
Macintosh Diskette or Download We regret that no Macintosh upgrade to 2.08 is available at this time, other than hand application of the above .txt upgrade patches. Contact Cambridge University Press for information on upgrading your Win/DOS/Mac CDROM to version 2.08.

Notes:

  1. Copy the prerequisite files and the downloaded patch file to a single scratch directory. Run the patch file. It will unpack into files RTPATCH.EXE and xxxxxxxx.RTP (for some xxxxxxxx). Run the DOS command: "RTPATCH.EXE xxxxxxxx.RTP" This produces a set of upgraded installation files that you should save to a diskette or elsewhere. Install by running SETUP.EXE . Important: The word "run", above, means "open an MS-DOS box and type the command at an MS-DOS command prompt". Any other method (e.g., double clicking on an icon, or entering a command from the "Start" menu) will give unpredictable results!

  2. Upgrades from DOS version to Windows version. Windows 3.1, 95, or NT required after the upgrade. The only upgrade options for continued DOS (without Windows) use are (i) upgrade, unpack all files on a Windows machine, move them to a DOS machine, or (ii) purchase the Win/DOS/Mac CDROM.

  3. Downloads Type A and Type B can be distinguished by the file names nrf206h.hlp (Type A) versus nr7f206h.hlp (Type B).

  4. You must create an additional file named dummy.hlp in the upgrade directory before applying the patch. This file must be an identical (additional) copy of your existing file nrf206h.hlp. You can create it with the DOS command, "copy nrf206h.hlp dummy.hlp". The patch will then upgrade nrf206h.hlp to version 2.08 Fortran 77 code, and will upgrade dummy.hlp to version 2.08 Fortran 90 code. (Both are needed to complete the installation.)

  5. This method upgrades UNIX tar files that have been moved to a DOS machine for that purpose. If you can easily move files, this is the most trouble-free upgrade method. Be sure that you transfer tar files as binary files. Follow directions in Note 1, then move upgraded tar files back to your UNIX machine and unpack them.

  6. See following section for detailed instructions. Download .uu version and use uudecode to unpack .txt files if your browser mangles downloaded .txt files (e.g., by converting tabs to spaces or altering end-of-line codes).

  7. If you want to upgrade a single routine, search for its name in the .txt patch file, e.g., "chebft" or "dfpmin". No such patch means no change in the program. If you want to upgrade a whole directory, locate the series of consecutive patches that apply to, e.g., all the ansi C recipes routines. If you copy just these to a separate file, and possibly edit the file name strings in them, you may be able to patch them all at once using the UNIX patch utility (or the PC version of same).

How to Apply Patches with the UNIX "patch" Command

Follow these steps:
  1. Unpack your original Numerical Recipes tar file(s) into a scratch directory to make a clean copy. If you can't locate the original tar file(s), copy your entire existing Numerical Recipes directory tree. Go to the directory in the new copy that contains the highest level Numerical Recipes directories, namely recipes_c-ansi, recipes_c-kr, recipes_f and/or recipes_f-90

  2. Verify that the "patch" utility is in your path, e.g., by the command "which patch". (If your UNIX system doesn't have the patch utility, you can easily obtain it, e.g., from ftp://prep.ai.mit.edu/pub/gnu/ and many other places.)

  3. Download the appropriate patch file(s) using the links in the table above. Important note: The .txt patch files are ordinary UNIX text files. They contain tab characters, and their lines end with ^J. Some Web browsers mangle these files, by changing tabs to spaces and/or by changing ^J to ^M^J . Such mangled patch files will not work! This can be avoided by instead downloading the .uu patch files and then using your machine's "uudecode" command to convert the .uu files to .txt files. Put (or move) the downloaded patch files into the directory you moved to in step 1 above.

  4. Now issue one or more of the following commands, depending on which patches you have downloaded:
    • patch -p1 < UCA206b08.txt
    • patch -p1 < UCK206b08.txt
    • patch -p1 < U7F206b08.txt
    • patch -p1 < U9F206b08.txt
    If patch stops and prompts you for a file name, it means that either (i) you are in the wrong directory, or (ii) you have renamed some Numerical Recipes directories or files, or (iii) your version of patch does not interpret the path-stripping flag "-p1" in the way that we believe to be standard. You can usually recover from any of these problems by renaming some files/directories, changing the "-p1" flag, and/or reading the man page that comes with your version of patch.

  5. The patch utility will issue many supposedly informative, but actually confusing, messages. After you have successfully executed each patch command, the corresponding directory (recipes_c-ansi, recipes_c-kr, recipes_f or recipes_f-90) will have been upgraded to version 2.08.
Also, here is a version of UNIX "patch" for DOS, and the same file in uuencoded format. Here is a brief description of how to use these files.