root/MGET/Branches/Jason/PythonPackage/src/GeoEco/AssimilatedModules/rpy/src-rpy-1.0.3/BUILDING_FOR_GEOECO.txt @ 404

Revision 404, 2.6 KB (checked in by jjr8, 4 years ago)

This and the previous few revisions fix and implement:

* #264: Predict GAM and Predict GLM tools should check the left and bottom extents and the number of rows and columns rather than all four extents
* #265: The Raster Type search option does not work for batch processing tools that find rasters
* #284: Tools that do not have "Run Python script in process" checked run extremely slowly under ArcGIS 9.3
* #357: Add support for ArcGIS 9.3.1
* #358: When provided with raster layers, Predict GAM and Predict GLM tools fail with GDAL Error 4: `<raster>' does not exist in the file system, and is not recognised as a supported dataset name.
* #359: With ArcGIS 9.3.1, Predict GAM and Predict GLM tools fail with RPy_RException: Error: GDAL Error 5: Access window out of range in RasterIO()
* #360: All tools that invoke R leak memory
* #361: Python's logging package causes large memory leaks in "in process" MGET tools under ArcGIS 9.3

The ArcGIS 9.3 toolbox still needs to rebuilt and more testing needs to happen, but this revision represents a large amount of the total work required for MGET 0.7b1.

Line 
1How to build GeoEco's assimilated copy of rpy when a new verison of R is released. Assumes you are building
2the 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
10Steps:
11
121. Uninstall your existing obsolete version of R.
13
142. Install the new version of R to the default location.
15
163. Start a CMD.exe shell.
17
184. Run: "%VS71COMNTOOLS%\vsvars32.bat" (including quotes) to set Visual Studio env vars.
19
205. Run: cd C:\MGET\MGET\Branches\Jason\PythonPackage\src\GeoEco\AssimilatedModules\rpy\src-rpy-1.0.3 (or wherever)
21
22Steps 6 through 13 will use the four-step procedure described in http://support.microsoft.com/kb/q131313/
23under "Creating a .DEF file" to create R.lib for the R.dll that was just installed. We need this .lib so
24rpy's C code can link to it.
25
266. Run: set RHOME=C:\Progra~1\R\R-2.8.1
27
287. Run: dumpbin /out:%RHOME%\bin\R_exports.txt /exports %RHOME%\bin\R.dll
29
308. Create an empty file %RHOME%\bin\R.def and open it for editing with your favorite text editor.
31
329. For the first line of the file, type EXPORTS and press Enter.
33
3410. Open %RHOME%\bin\R_exports.txt in another instance of your text editor.
35
3611. From R_exports.txt, copy the contents of the "name" column into R.def. That file should ultimately look
37    like this:
38
39EXPORTS
40ATTRIB
41AllDevicesKilled
42BODY
43Brent_fmin
44CAAR
45CAD4R
46CADDDR
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
5312. Save R.def and close both text files.
54
5513. Run: lib /def:%RHOME%\bin\R.def /out:%RHOME%\bin\R.lib /machine:ix86
56
5714. 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
6315. 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!
Note: See TracBrowser for help on using the browser.