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 | ################################################# |
| 248 | Initial notes for OSGeo4W: RSB 090117-20 |
| 249 | |
| 250 | Run in OSGeo4W console, after setting: |
| 251 | |
| 252 | set OSGEO4W_BUILD=yes |
| 253 | set GDAL_HOME=%OSGEO4W_ROOT% |
| 254 | |
| 255 | cd rgdal/src |
| 256 | |
| 257 | cl /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 | |
| 259 | link /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 | |
| 261 | cd ../.. |
| 262 | |
| 263 | Set Makefile.win as below to all:!! |
| 264 | |
| 265 | R CMD INSTALL --build rgdal |
| 266 | |
| 267 | Post-installation, start R from the OSGeo4W console (command line). If you want |
| 268 | to check that the OSGeo4W-aware rgdal is present, check the reported support |
| 269 | file locations, and consider running: |
| 270 | |
| 271 | source(system.file("OSGeo4W_test", package="rgdal"), echo=TRUE) |
| 272 | |
| 273 | The initial version (0.6-6) is preliminary. |
| 274 | |
| 275 | ############################################################################### |
| 276 | ## Building rgdal binary against FWTools binary using VC++ |
| 277 | |
| 278 | MDSumner 30 April 2007 |
| 279 | |
| 280 | Windows XP2, SP2, .NET 2.0 |
| 281 | Rtools in C:/R/Rtools. |
| 282 | |
| 283 | Here 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 | |
| 289 | gdalinfo --version |
| 290 | GDAL 1.4.0.0, FWTools 1.2.2, released 2007/02/22 |
| 291 | |
| 292 | I have Visual C++ 2005, Express Edition. |
| 293 | http://msdn.microsoft.com/vstudio/express/visualc/download/ |
| 294 | Version 8.0.50727.42 (RTM.050727-4200) |
| 295 | |
| 296 | |
| 297 | I obtain rgdal_0.5-9 source via CVS: |
| 298 | |
| 299 | cvs -d:pserver:anonymous@rgdal.cvs.sourceforge.net:/cvsroot/rgdal login |
| 300 | cvs -z3 -d:pserver:anonymous@rgdal.cvs.sourceforge.net:/cvsroot/rgdal co -P |
| 301 | rgdal |
| 302 | |
| 303 | [R]/bin, [FWTools]/bin and [Rtools]/bin (as per standard R windows) are all in |
| 304 | the path. |
| 305 | |
| 306 | 1. Ensure you have Rdll.lib |
| 307 | |
| 308 | ## Build Rdll.lib and place in [R]\libs\ (see example below in link step, and |
| 309 | see |
| 310 | ## |
| 311 | http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/readme.packages.t |
| 312 | xt) |
| 313 | |
| 314 | ## [R]src\gnuwin32 |
| 315 | |
| 316 | make R.exp |
| 317 | lib /def:R.exp /out:Rdll.lib |
| 318 | |
| 319 | 2. 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 | |
| 326 | Specifically, mine looks like this: |
| 327 | |
| 328 | -//-- start configure.win |
| 329 | |
| 330 | #!/bin/sh |
| 331 | if test -z "$GDAL_HOME" ; then |
| 332 | GDAL_HOME="C:/FWTools" |
| 333 | fi |
| 334 | echo "GDAL_HOME=${GDAL_HOME}" > src/Makeconf.win |
| 335 | |
| 336 | echo "using GDAL_HOME: ${GDAL_HOME}" |
| 337 | |
| 338 | mkdir $DPKG/libs |
| 339 | cp ${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 | |
| 348 | Place Makefile.win in src/, containing a single line: |
| 349 | |
| 350 | all: |
| 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 | |
| 357 | 3. Compile and link |
| 358 | |
| 359 | cl /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 | |
| 365 | link /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 | |
| 367 | 4. Then build and install rgdal as normal. |
| 368 | |
| 369 | R CMD build --binary rgdal |
| 370 | |
| 371 | or (better) |
| 372 | |
| 373 | R CMD INSTALL --build rgdal |
| 374 | |
| 375 | to build a Windows binary package (zipfile) |
| 376 | or |
| 377 | |
| 378 | R CMD INSTALL rgdal |
| 379 | |
| 380 | to install. |
| 381 | |
| 382 | This step will fail if src/Makefile.win is not in place. |
| 383 | |
| 384 | At 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 | |
| 387 | R CMD INSTALL --library [path-to-[R]/library-of-choice] rgdal_[version#].tar.gz |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | ------------------------------- Earlier notes (RSB) |
| 393 | |
| 394 | Setting 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 | |
| 396 | The R Windows binary rgdal package can built against an FWTools Windows binary, using VC++. |
| 397 | |
| 398 | Notes: |
| 399 | |
| 400 | Building rgdal.dll in rgdal/src: |
| 401 | |
| 402 | Makefile.win with just all: on a single line. |
| 403 | |
| 404 | cl /MT /Ox /EHsc /D "WIN32" /c /I E:\rsb\R\R-2.2.1pat\include /I C:\Programfiler\FWTools1.0.0a7\include *.cpp |
| 405 | |
| 406 | link /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 | |
| 408 | for RSBs locations of current R and FWTools |
| 409 | |
| 410 | |
| 411 | }}} |