Changes between Version 45 and Version 46 of Cookbook gdal


Ignore:
Timestamp:
Jan 30, 2010 10:02:11 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Cookbook gdal

    v45 v46  
    243243using VC++. 
    244244 
    245 '' j'installe le plugins eclipse cdt à l'aide du gestionnaire d'extensions d'éclipse http://download.eclipse.org/tools/cdt/releases/galileo '' 
    246  
     245'' Cédric j'installe le plugins eclipse cdt à l'aide du gestionnaire d'extensions d'éclipse http://download.eclipse.org/tools/cdt/releases/galileo '' 
     246{{{ 
     247################################################# 
     248Initial notes for OSGeo4W: RSB 090117-20 
     249 
     250Run in OSGeo4W console, after setting: 
     251 
     252set OSGEO4W_BUILD=yes 
     253set GDAL_HOME=%OSGEO4W_ROOT% 
     254 
     255cd rgdal/src 
     256 
     257cl /MT /Ox /EHsc /D "WIN32" /c /I "C:/Program Files/R/R-2.8.1/include" /I C:/OSGeo4W/include /I "C:\Program Files\Microsoft Visual Studio 9.0\VC\include" /D OSGEO4W *.cpp 
     258 
     259link /dll /out:rgdal.dll /def:rgdal.def *.obj "C:\Program Files\R\R-2.8.1\bin\Rdll.lib" /libpath:"C:\Program Files\Microsoft Visual Studio 9.0\VC\lib" /libpath:"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib" /libpath:"C:\OSGeo4W\lib" gdal_i.lib proj_i.lib 
     260 
     261cd ../.. 
     262 
     263Set Makefile.win as below to all:!! 
     264 
     265R CMD INSTALL --build rgdal 
     266 
     267Post-installation, start R from the OSGeo4W console (command line). If you want 
     268to check that the OSGeo4W-aware rgdal is present, check the reported support 
     269file locations, and consider running: 
     270 
     271source(system.file("OSGeo4W_test", package="rgdal"), echo=TRUE) 
     272 
     273The initial version (0.6-6) is preliminary. 
     274 
     275############################################################################### 
     276## Building rgdal binary against FWTools binary using VC++ 
     277 
     278MDSumner 30 April 2007 
     279 
     280Windows XP2, SP2, .NET 2.0 
     281Rtools in C:/R/Rtools. 
     282 
     283Here I am using a  
     284 
     285        source install of R 2.5.0 in C:/R/Rsrc/R-2.5.0 
     286        with a source install of sp 0.9-14, and  
     287        binary install of FWTools 1.2.2 in C:/FWTools.   
     288 
     289gdalinfo --version 
     290GDAL 1.4.0.0, FWTools 1.2.2, released 2007/02/22 
     291 
     292I have Visual C++ 2005, Express Edition. 
     293http://msdn.microsoft.com/vstudio/express/visualc/download/ 
     294Version 8.0.50727.42  (RTM.050727-4200) 
     295 
     296 
     297I obtain rgdal_0.5-9 source via CVS: 
     298 
     299cvs -d:pserver:anonymous@rgdal.cvs.sourceforge.net:/cvsroot/rgdal login  
     300cvs -z3 -d:pserver:anonymous@rgdal.cvs.sourceforge.net:/cvsroot/rgdal co -P 
     301rgdal 
     302 
     303[R]/bin, [FWTools]/bin and [Rtools]/bin (as per standard R windows) are all in 
     304the path. 
     305 
     3061. Ensure you have Rdll.lib 
     307 
     308## Build Rdll.lib and place in [R]\libs\ (see example below in link step, and 
     309see 
     310##  
     311http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/readme.packages.t 
     312xt) 
     313 
     314## [R]src\gnuwin32 
     315 
     316make R.exp 
     317lib /def:R.exp /out:Rdll.lib 
     318 
     3192. Ensure the configure.win, Makefile.win and RGDAL.def are all correct.  
     320 
     321 
     322 
     323## set the location of GDAL_HOME in configure.win (mine is GDAL_HOME="C:/FWTools") 
     324## Also change libgdal-1.dll to gdal_fw.dll in configure.win 
     325 
     326Specifically, mine looks like this: 
     327 
     328-//-- start configure.win 
     329 
     330#!/bin/sh 
     331if test -z "$GDAL_HOME" ; then 
     332    GDAL_HOME="C:/FWTools" 
     333fi 
     334echo "GDAL_HOME=${GDAL_HOME}" > src/Makeconf.win 
     335 
     336echo "using GDAL_HOME: ${GDAL_HOME}" 
     337 
     338mkdir $DPKG/libs 
     339cp ${GDAL_HOME}/bin/gdal_fw.dll $DPKG/libs 
     340 
     341-//-- end configure.win 
     342 
     343 
     344## [rgdal]/src   
     345##   - includes a Makefile.win with one line:   all: 
     346##   - and RGDAL.def as supplied in rgdal/src 
     347 
     348Place Makefile.win in src/, containing a single line: 
     349 
     350all: 
     351 
     352 
     353## run command window with VC++ (I can't see how else to include it in the path) 
     354## First compile the C++ against R and FWTools include 
     355 
     356 
     3573. Compile and link 
     358 
     359cl /MT /Ox /EHsc /D "WIN32" /c /I C:/R/Rsrc/R-2.5.0/include /I C:/FWTools/include 
     360*.cpp 
     361 
     362## Then link the resulting files with R and gdal: 
     363##  (note that this includes all the present .obj files, and the gdal_ and proj_ libs from GDAL_HOME 
     364 
     365link /dll /out:rgdal.dll /def:rgdal.def *.obj C:\R\Rsrc\R-2.5.0\libs\Rdll.lib /libpath:"C:\FWTools\lib" gdal_i.lib proj_i.lib 
     366 
     3674. Then build and install rgdal as normal. 
     368 
     369R CMD build --binary rgdal 
     370 
     371or (better) 
     372 
     373R CMD INSTALL --build rgdal 
     374 
     375to build a Windows binary package (zipfile) 
     376or 
     377 
     378R CMD INSTALL rgdal  
     379 
     380to install. 
     381 
     382This step will fail if src/Makefile.win is not in place. 
     383 
     384At this stage you will see errors if gdal_fw.dll (libgdal-1.dll) can't be found 
     385(I don't know the difference, it seems to work) 
     386 
     387R CMD INSTALL --library [path-to-[R]/library-of-choice] rgdal_[version#].tar.gz 
     388 
     389 
     390 
     391 
     392------------------------------- Earlier notes (RSB) 
     393 
     394Setting the FWTools bin/ directory in the PATH environmental variable is essential, (GDAL_DATA is set internally to the copy included in the rgdal package). 
     395 
     396The R Windows binary rgdal package can built against an FWTools Windows binary, using VC++. 
     397 
     398Notes: 
     399 
     400Building rgdal.dll in rgdal/src: 
     401 
     402Makefile.win with just all: on a single line. 
     403 
     404cl /MT /Ox /EHsc /D "WIN32" /c /I E:\rsb\R\R-2.2.1pat\include /I C:\Programfiler\FWTools1.0.0a7\include *.cpp 
     405 
     406link /dll /out:rgdal.dll /def:RGDAL.def gdal-bindings.obj ogr_geom.obj ogr_proj.obj ogrsource.obj E:\rsb\R\R-2.2.1pat\lib\Rdll.lib /libpath:"C:\Programfiler\FWTools1.0.0a7\lib" gdal_i.lib 
     407 
     408for RSBs locations of current R and FWTools 
     409 
     410 
     411}}} 
    247412 
    248413...url[http://download.osgeo.org/fdo/3.4.1/binaries/]