| 1 | How to build GeoEco's assimilated copy of rpy when a new verison of R is released. Assumes you are building
|
|---|
| 2 | the following configuration:
|
|---|
| 3 |
|
|---|
| 4 | * Windows 32-bit x86
|
|---|
| 5 | * Microsoft Visual Studio .NET 2003
|
|---|
| 6 | * R 2.8.1
|
|---|
| 7 | * All programs installed in default locations
|
|---|
| 8 | * GeoEco source code in Jason branch (e.g. C:\MGET\MGET\Branches\Jason)
|
|---|
| 9 |
|
|---|
| 10 | Steps:
|
|---|
| 11 |
|
|---|
| 12 | 1. Uninstall your existing obsolete version of R.
|
|---|
| 13 |
|
|---|
| 14 | 2. Install the new version of R to the default location.
|
|---|
| 15 |
|
|---|
| 16 | 3. Start a CMD.exe shell.
|
|---|
| 17 |
|
|---|
| 18 | 4. Run: "%VS71COMNTOOLS%\vsvars32.bat" (including quotes) to set Visual Studio env vars.
|
|---|
| 19 |
|
|---|
| 20 | 5. Run: cd C:\MGET\MGET\Branches\Jason\PythonPackage\src\GeoEco\AssimilatedModules\rpy\src-rpy-1.0.3 (or wherever)
|
|---|
| 21 |
|
|---|
| 22 | Steps 6 through 13 will use the four-step procedure described in http://support.microsoft.com/kb/q131313/
|
|---|
| 23 | under "Creating a .DEF file" to create R.lib for the R.dll that was just installed. We need this .lib so
|
|---|
| 24 | rpy's C code can link to it.
|
|---|
| 25 |
|
|---|
| 26 | 6. Run: set RHOME=C:\Progra~1\R\R-2.8.1
|
|---|
| 27 |
|
|---|
| 28 | 7. Run: dumpbin /out:%RHOME%\bin\R_exports.txt /exports %RHOME%\bin\R.dll
|
|---|
| 29 |
|
|---|
| 30 | 8. Create an empty file %RHOME%\bin\R.def and open it for editing with your favorite text editor.
|
|---|
| 31 |
|
|---|
| 32 | 9. For the first line of the file, type EXPORTS and press Enter.
|
|---|
| 33 |
|
|---|
| 34 | 10. Open %RHOME%\bin\R_exports.txt in another instance of your text editor.
|
|---|
| 35 |
|
|---|
| 36 | 11. From R_exports.txt, copy the contents of the "name" column into R.def. That file should ultimately look
|
|---|
| 37 | like this:
|
|---|
| 38 |
|
|---|
| 39 | EXPORTS
|
|---|
| 40 | ATTRIB
|
|---|
| 41 | AllDevicesKilled
|
|---|
| 42 | BODY
|
|---|
| 43 | Brent_fmin
|
|---|
| 44 | CAAR
|
|---|
| 45 | CAD4R
|
|---|
| 46 | CADDDR
|
|---|
| 47 | ...
|
|---|
| 48 |
|
|---|
| 49 | To accomplish this easily, your text editor must be able to select multi-line rectangular blocks of
|
|---|
| 50 | text. If you can't do that, you'll have to edit up the block of text by hand, or write code to extract
|
|---|
| 51 | the name column.
|
|---|
| 52 |
|
|---|
| 53 | 12. Save R.def and close both text files.
|
|---|
| 54 |
|
|---|
| 55 | 13. Run: lib /def:%RHOME%\bin\R.def /out:%RHOME%\bin\R.lib /machine:ix86
|
|---|
| 56 |
|
|---|
| 57 | 14. For each version of Python supported by GeoEco (assume version number is XY, e.g. 25):
|
|---|
| 58 |
|
|---|
| 59 | a. Run: C:\pythonXY\python.exe setup.py build
|
|---|
| 60 | b. Run: copy build\lib.win32-X.Y\_rpy2081.pyd ..\lib\win32\PythonXY
|
|---|
| 61 | c. Add ..\lib\win32\PythonXY\_rpy2081.pyd to subversion (e.g. right click on the file, select TortoiseSVN --> Add)
|
|---|
| 62 |
|
|---|
| 63 | 15. You are done. To clean up:
|
|---|
| 64 |
|
|---|
| 65 | a. Run: del %RHOME%\bin\R_exports.txt
|
|---|
| 66 | b. Run: del %RHOME%\bin\R.def
|
|---|
| 67 | c. Run: del %RHOME%\bin\R.exp
|
|---|
| 68 | d. Run: del %RHOME%\bin\R.lib
|
|---|
| 69 | e. Run: del src\io2081.c
|
|---|
| 70 | f. Run: del src\R_eval2081.c
|
|---|
| 71 | g. Run: del src\rpymodule2081.c
|
|---|
| 72 | h. Run: rd /s/q build
|
|---|
| 73 |
|
|---|
| 74 | WARNING: DO NOT DELETE %RHOME%\bin\R.exe or %RHOME%\bin\R.dll!
|
|---|
| 75 |
|
|---|
| 76 | WARNING: Do not check in anything to subversion other than the .pyd files!
|
|---|