INSTALL 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. INSTALL GRASS from source code
  2. ------------------------------
  3. Please read *all* text below.
  4. Table of contents
  5. PREREQUISITES
  6. (A) SOURCE CODE DISTRIBUTION
  7. (B) COMPILATION
  8. (C) COMPILATION NOTES for 64bit platforms
  9. (D) INSTALLATION (first time)
  10. (E) INSTALLATION ON MACOSX
  11. (F) RUNNING GRASS
  12. (G) UPDATE OF SOURCE CODE (SVN or SVN snapshot only)
  13. (H) COMPILING INDIVIDUAL MODULES - OWN MODULES
  14. (I) CODE OPTIMIZATION
  15. (J) DEBUGGING OPTIONS
  16. (K) LARGE FILE SUPPORT (for raster maps)
  17. (L) SUPPORT
  18. (M) GRASS PROGRAMMER'S MANUAL
  19. (N) CONTRIBUTING CODE AND PATCHES
  20. (O) DRAFT TUTORIAL
  21. PREREQUISITES
  22. The install order matters. GRASS needs at least two libraries
  23. which have to be installed before installing/compiling GRASS:
  24. For links to the software, see ./REQUIREMENTS.html in this
  25. directory:
  26. Installation order:
  27. 1. PROJ4
  28. 2. GDAL-OGR (compiled without GRASS support)
  29. 3. optionally: databases such as PostgreSQL, MySQL, sqlite
  30. 4. GRASS
  31. 5. optionally: GDAL-OGR-GRASS plugin
  32. (A) SOURCE CODE DISTRIBUTION
  33. GRASS source code is currently distributed in 2 forms:
  34. 1) Officially released source code (e.g. grass-7.2.0.tar.gz or later)
  35. The Full source code version contains all the GRASS source code
  36. required for compilation. It is distributed as one file (*.tar.gz
  37. package) and the version is composed of 3 numbers, e.g. 7.2.0, 7.2.1
  38. etc.
  39. 2) SVN or SVN Snapshots of source code (SVN or SVN snapshot)
  40. This version of the source code can be acquired either from the SVN
  41. repository (https://svn.osgeo.org/grass/) or as a snapshot
  42. (*.tar.gz package) of that SVN repository. The SVN snapshot name
  43. contains the date when the snapshot was created (checked out from
  44. the SVN repository), e.g. grass-7.2.svn_src_snapshot_2016_06_11.tar.gz
  45. from https://grass.osgeo.org/grass73/source/snapshot/
  46. Further instructions at https://trac.osgeo.org/grass/wiki/DownloadSource
  47. (B) COMPILATION
  48. IMPORTANT: All Unix based distributions are different.
  49. For Solaris, see hints below.
  50. The command,
  51. ./configure --help
  52. explains the options used to disable the compilation of non-mandatory
  53. GRASS modules. See REQUIREMENTS.html for details.
  54. First step of the compilation (-g for debugging, or -O2 for optimization):
  55. CFLAGS="-g -Wall" ./configure
  56. Explanation of make targets:
  57. make install - installs the binary
  58. make bindist - make a binary package with install script
  59. make srcdist - make a source package for distribution
  60. make srclibsdist - make a source package for library distribution
  61. make libs - make libraries only
  62. make clean - delete all files created by 'make'
  63. make distclean - 'make clean' + delete all files created by './configure'
  64. make libsclean - clean libraries compiled by 'make libs'
  65. make htmldocs - generate programmer's documentation as HTML files
  66. make packagehtmldocs - package programmer's documentation in HTML
  67. make pdfdocs - generate programmer's documentation as PDF files
  68. Next step is the compilation itself:
  69. make
  70. Detailed Wiki notes for various operating systems (MS-Windows, GNU/Linux distros,
  71. FreeBSD, AIX, etc) are available at:
  72. https://grasswiki.osgeo.org/wiki/Compile_and_Install
  73. Note for Solaris users (see also Wiki page above):
  74. To configure GRASS correctly on a system which doesn't have a suitable
  75. install program (AC_PROG_INSTALL ignores versions which are known to
  76. have problems), you need to ensure that $srcdir is an absolute path,
  77. by using e.g.:
  78. `pwd`/configure ...
  79. or:
  80. ./configure --srcdir=`pwd` ...
  81. Then proceed as described above.
  82. Note when using a compiler different from "gcc":
  83. By setting environment variables, the compiler
  84. names can be defined (C and C++):
  85. CC=cc CPP=cpp ./configure ...
  86. (C) COMPILATION NOTES for 64bit platforms
  87. To successfully compile GRASS on 64bit platforms, the required
  88. FFTW2 library has to be compiled with -fPIC flag:
  89. #this applies to FFTW3, not to GRASS GIS:
  90. cd fftw-3.3.4/
  91. CFLAGS="-fPIC" ./configure
  92. make
  93. make install
  94. To fully enable 64bit library usage for GRASS on 64bit platforms,
  95. the following additional parameters are recommended/required:
  96. ./configure \
  97. --enable-64bit \
  98. --with-libs=/usr/lib64 \
  99. ...
  100. See also CODE OPTIMIZATION below.
  101. (D) INSTALLATION (first time)
  102. After compilation, the resulting code is stored in the directory
  103. ./dist.$ARCH
  104. and the scripts (grass73, ...) in
  105. ./bin.$ARCH
  106. To run GRASS, simply start
  107. ./bin.$ARCH/grass73
  108. or run
  109. make install
  110. grass73
  111. (E) INSTALLATION ON MACOSX
  112. See the ReadMe.rtf in the ./macosx/ folder and the Wiki page above.
  113. (F) RUNNING GRASS GIS
  114. Download a sample data package from the GRASS web site, see
  115. https://grass.osgeo.org/download/sample-data/
  116. Extract the data set and point the "Database" field in the
  117. GRASS GIS startup menu to the extracted directory.
  118. Enjoy.
  119. (G) UPDATE OF SOURCE CODE (SVN or SVN snapshot only)
  120. Assuming that you want to update your current installation from
  121. SVN, you have to perform a few steps. In general:
  122. - update from SVN
  123. - configure, compile
  124. In detail:
  125. cd /where/your/grass7sourcecode/lives/
  126. svn update
  127. ./configure ...
  128. make
  129. make install
  130. (H) COMPILING INDIVIDUAL MODULES - OWN MODULES
  131. To compile (self-made) GRASS modules or to compile modified modules
  132. at least the GRASS libraries have to be compiled locally. This is
  133. done by launching:
  134. make libs
  135. Then change into the module's directory and launch the "make"
  136. command. The installation can be either done with "make install" from
  137. the main source code directory or locally with
  138. "INST_NOW=y make"
  139. You may want to define an alias for this:
  140. alias gmake7='INST_NOW=y make'
  141. Then simply compile/install the current module with
  142. gmake7
  143. Note: If you keep your module source code outside the standard GRASS
  144. source code directory structure, you will have to change the relative
  145. path(s) in the Makefile to absolute path(s).
  146. (I) CODE OPTIMIZATION
  147. If you would like to set compiler optimisations, for a possibly faster
  148. binary, type (don't enter a ";" anywhere):
  149. CFLAGS=-O ./configure
  150. or,
  151. setenv CFLAGS -O
  152. ./configure
  153. whichever works on your shell. Use -O2 instead of -O if your compiler
  154. supports this (note: O is the letter, not zero). Using the "gcc" compiler,
  155. you can also specify processor specific flags (examples, please suggest
  156. better settings to us):
  157. CFLAGS="-mcpu=athlon -O2" # AMD Athlon processor with code optimisations
  158. CFLAGS="-mcpu=pentium" # Intel Pentium processor
  159. CFLAGS="-mcpu=pentium4" # Intel Pentium4 processor
  160. CFLAGS="-O2 -msse -msse2 -mfpmath=sse -minline-all-stringops" # Intel XEON 64bit processor
  161. CFLAGS="-mtune=nocona -m64 -minline-all-stringops" # Intel Pentium 64bit processor
  162. Note: As of version 4.3.0, GCC offers the -march=native switch that
  163. enables CPU auto-detection and automatically selects optimizations supported
  164. by the local machine at GCC runtime including -mtune.
  165. To find out optional CFLAGS for your platform, enter:
  166. gcc -dumpspecs
  167. See also: http://gcc.gnu.org/
  168. A real fast GRASS version (and small binaries) will be created with
  169. LDFLAGS set to "stripping" (but this disables debugging):
  170. CFLAGS="-O2 -mcpu=<cpu_see_above> -Wall" LDFLAGS="-s" ./configure
  171. (J) DEBUGGING OPTIONS
  172. The LDFLAGS="" part must be undefined as "-s" will strip the debugging
  173. information.
  174. Don't use -O for CFLAGS if you want to be able to step through function
  175. bodies. When optimisation is enabled, the compiler will re-order statements
  176. and re-arrange expressions, resulting in object code which barely resembles
  177. the source code.
  178. The -g and -Wall compiler flags are often useful for assisting debugging:
  179. CFLAGS="-g -Wall" ./configure
  180. See also the file ./doc/debugging.txt and the Wiki page
  181. https://grasswiki.osgeo.org/wiki/GRASS_Debugging
  182. (K) LARGE FILE SUPPORT (for raster maps)
  183. GRASS >= 7.0.0 includes improved support for reading and writing large files
  184. (> 2GB) if it is possible in your operating system. If you compile with
  185. configure [...] --enable-largefile
  186. you should be able to have raster and vector maps which are larger than 2GB.
  187. While most code has been updated, individual programs may not yet work with
  188. large files - please report.
  189. See also
  190. https://grasswiki.osgeo.org/wiki/GRASS_GIS_Performance
  191. https://grasswiki.osgeo.org/wiki/Software_requirements_specification
  192. (L) SUPPORT
  193. Note that this code is still actively being developed and errors inevitably
  194. turn up. If you find a bug, please report it to the GRASS bug tracking system
  195. so we can fix it. See https://grass.osgeo.org/development/bug-tracking/
  196. If you are interested in helping to develop GRASS, please join the GRASS
  197. developers mailing list. See https://grass.osgeo.org/development/
  198. (M) GRASS PROGRAMMER'S MANUAL
  199. The Programmer's manual is generated with doxygen from the source code.
  200. Please see the README file and the files at:
  201. https://grass.osgeo.org/programming7/
  202. (N) CONTRIBUTING CODE AND PATCHES
  203. Please see ./SUBMITTING in this directory, or better,
  204. https://trac.osgeo.org/grass/wiki/Submitting
  205. (O) DRAFT TUTORIAL
  206. https://grass.osgeo.org/documentation/first-time-users/
  207. ------------------
  208. (C) 1999-2017 by The GRASS Development Team
  209. Last changed: $Date$