g.extension.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <h2>DESCRIPTION</h2>
  2. <!-- TODO: the use of Addon and extension is not coherent -->
  3. <em>g.extension</em> downloads and installs, removes or updates
  4. extensions (addons) from the official
  5. <a href="https://grass.osgeo.org/grass7/manuals/addons/">GRASS GIS Addons repository</a>
  6. or from user-specified source code repositories into the local GRASS GIS
  7. installation.
  8. <p>
  9. Two types of extensions are supported:
  10. <ul>
  11. <li>Python scripts: they are installed without the need of compilation or (usually)
  12. the need of special dependencies.</li>
  13. <li>Source code (mostly written in C programming language; may also be written
  14. in C++, Fortran or other languages): while on MS-Windows systems the requested
  15. GRASS GIS extension is downloaded pre-compiled from the GRASS GIS site, on Unix
  16. based systems the installation is preceded by the automated download of the
  17. extension's source code along with subsequent compilation and installation.
  18. This requires a compiler environment to be present on the user's computer.</li>
  19. </ul>
  20. <h3>Managing installed extensions</h3>
  21. <p>Re-running <em>g.extension</em> on an installed GRASS GIS Addon
  22. extension re-installs the requested extension which may include
  23. updates.
  24. <p>
  25. To bulk-update all locally installed GRASS GIS extensions,
  26. <em><a href="g.extension.all.html">g.extension.all</a></em> module
  27. is available.
  28. <h3>Where the extensions are installed</h3>
  29. GRASS GIS extensions are installed by <em>g.extension</em> into a dedicated
  30. directory.
  31. The default is a directory for application data and settings inside
  32. the user's home directory.
  33. On GNU/Linux it is <tt>$HOME/.grass7/addons</tt>,
  34. on MS-Windows it is <tt>$APPDATA\GRASS7\addons</tt>.
  35. The name of the directory is stored in the <tt>GRASS_ADDON_BASE</tt>
  36. environmental variable.
  37. <p>
  38. The flag <b>-s</b> changes this install target directory to the GRASS GIS
  39. installation directory
  40. (determined by <tt>GISBASE</tt> environmental variable, e.g. <tt>/usr/</tt>)
  41. rather than the default directory defined as per <tt>GRASS_ADDON_BASE</tt>
  42. (see also documentation for <a href="variables.html">variables</a>).
  43. <em>g.extension</em> checks if the user has permission to write to
  44. <tt>GISBASE</tt> or <tt>GRASS_ADDON_BASE</tt>.
  45. <p>
  46. The place where the extensions are installed can be customized by
  47. the option <b>prefix</b>. Ensuring that these extensions will be accessible
  48. in GRASS GIS is in this case in the responsibility of the user.
  49. <h3>Compilation and installation</h3>
  50. On MS-Windows systems, where compilation tools are typically not readily
  51. locally installed, <em>g.extension</em> downloads a precompiled executable
  52. from the GRASS GIS project server. On all other operating systems
  53. where it is not difficult to install compilation tools,
  54. <em>g.extension</em> downloads the source code of the requested
  55. extension (addon) and compiles it locally.
  56. This applies for both C and Python modules
  57. as well as any other extensions. The reason is that more things such
  58. as manual page are compiled, not only the source code (which is really
  59. necessary to compile just in case of C).
  60. <h2>EXAMPLES</h2>
  61. <h3>Download and install of an extension</h3>
  62. Download and install <em>r.stream.distance</em> into current GRASS installation
  63. <div class="code"><pre>
  64. g.extension extension=r.stream.distance
  65. </pre></div>
  66. This installs the extension from the official repository.
  67. For convenience, a shorter syntax can be used:
  68. <div class="code"><pre>
  69. g.extension r.stream.distance
  70. </pre></div>
  71. <h3>Download and install of an extension when behind a proxy</h3>
  72. Example for an open http proxy:
  73. <div class="code"><pre>
  74. # syntax: http://proxyurl:proxyport
  75. g.extension extension=r.stream.distance proxy="http://proxy.example.com:8080"
  76. </pre></div>
  77. <p>
  78. Example for a proxy with proxy authentication:
  79. <div class="code"><pre>
  80. # syntax: http://username:password@proxyurl:proxyport
  81. g.extension extension=r.stream.distance proxy="http://username:password@proxy.example.com:8080"
  82. </pre></div>
  83. <h3>Managing the extensions</h3>
  84. List all available extensions in the official GRASS GIS Addons repository:
  85. <div class="code"><pre>
  86. g.extension -l
  87. </pre></div>
  88. List all locally installed extensions:
  89. <div class="code"><pre>
  90. g.extension -a
  91. </pre></div>
  92. Removal of a locally installed extension:
  93. <div class="code"><pre>
  94. g.extension extension=r.stream.distance operation=remove
  95. </pre></div>
  96. <h2>TROUBLESHOOTING</h2>
  97. Since extensions have to be compiled on Unix based systems (Linux, Mac OSX etc.)
  98. unless a Python extension is installed, a full compiler environment must be
  99. present on the user's computer.
  100. <h3>ERROR: Please install GRASS development package</h3>
  101. While GRASS GIS is available on the user's computer, the respective development
  102. package is lacking. If GRASS was installed from a (Linux) repository, also the
  103. grass-dev* package (commonly named "grass-dev" or "grass-devel", sometimes along
  104. with the version number) must be installed.
  105. <h2>SEE ALSO</h2>
  106. <em>
  107. <a href="g.extension.all.html">g.extension.all</a>
  108. </em>
  109. <p>
  110. <a href="https://grass.osgeo.org/grass7/manuals/addons/">GRASS GIS 7 Addons Manual pages</a>
  111. <br>
  112. <a href="http://grasswiki.osgeo.org/wiki/GRASS_AddOns">GRASS Addons</a> wiki page.
  113. <h2>AUTHORS</h2>
  114. Markus Neteler (original shell script)<br>
  115. Martin Landa, Czech Technical University in Prague, Czech Republic (Python rewrite)
  116. <p>
  117. <i>Last changed: $Date$</i>