Compiling GRASS 4.2.1 (V.20) using other platforms (V 1.7 - 9. September 98 1998) (Change history at end of the file) from Markus Neteler Department of Geography Institute of Physical Geography University of Hannover Germany email: neteler@geog.uni-hannover.de This is a text which should show you how to compile the new GRASS 4.2.1 version on other unix platforms. More or less all important modules are there. For the missing modules I have no idea how to solve the compiling problem because I do not know too much about programming. So I hope for _your_ help. Please email to the adress given above. So - now we start. First you have to get the 4.2.1 source code from internet (http://www.geog.uni-hannover.de/grass/). Take Source 4.2.1. Store and uncompress the package with mkdir /usr/local/grass42 (store source code there or somewhere else) gunzip grass_src421v20.tar.gz tar xvf grass_src421v20.tar # Take parameter "x"!! If you succeed (it is really easy) you get a tree ../src421/man ../src421/src ../src421/src.alpha ../src421/src.contrib ... ../src421/untested etc. The dots ../ are your path like /usr/local/grass42 where you have stored all the stuff. 0. If necessary create a new link (GRASS expects mknod in /etc): cd /etc ln -s /bin/mknod mknod Otherwise the GISGEN-script will not work properly. Also, if necessary, when ".h" will not be found during compilation (!): cd /usr/lib ln -s /usr/openwin/share/include/X11 X11 cd /usr/include ln -s /usr/openwin/share/include/X11 X11 Then we proceed with GRASS compilation: GRASS compiling instructions are stored in a specific file. You have to take one of the already stored files there (file collection for several platforms) or you must create a new head file, if your platform is missing there. The easiest way is to edit an existing file for that purpose. 1. Edit the platform specific head-file in ../src42/src/CMD/head/ Choose your compiler and paths (also maybe the compiler options specific to your machine) 2. go to /usr/local/bin create a new file gmake4.2 there. This file is also stored in the package in src421/ directory. The contents are: (text between lines, including colon, change the SRC and CMD path to your installation) ------------------------------------------------------------ : SRC=/usr/local/grass42/src421/src CMD=/usr/local/grass42/src421/src/CMD HEADER=xxxxxxx HASX=yes HASMotif=no . $CMD/generic/gmake.sh ------------------------------------------------------------ Change "xxxxxxx" to the file name of your head file: Example: platform SUN Solaris -> head file: src/CMD/head/solaris -> xxxxxxx: solaris (HEADER=solaris in gmake4.2) 3. Change the paths in ../src421/src/CMD/GISGEN.my and ../src421/src/CMD/MAKELINKS.my The path have to point on "gmake4.2" which we just created. 4. In the file src421/src/CMD/lists/GRASS the modules to compile are specified and the modules to be ignored (commented out) . Usually you do not have to change anything here. 5. Begin the process of compiling. Start the script GISGEN.my: cd src421/src/CMD/ GISGEN.my So - now you can relax and go for tea. [after some time...] The source code should be compiled without problems. Otherwise read here. 6. Now we proceed with standard GRASS installation. Change again to ../src421/src/CMD/ Start the script MAKELINKS.my to create the links onto the binaries. It will run some seconds to minutes depending on your machine. The you have to create the start-script for GRASS. (You can take the old script of 4.1 and copy it to grass4.2 with changing the path). This file is also stored in the ../src421/ directory. Store it in: /usr/local/bin Or create it there: textedit grass4.2 Contents between lines (text incl. colon, change GISBASE paths to your installation): --------------------------------------------------------- : GISBASE=/usr/local/grass42 export GISBASE sh $GISBASE/etc/GIS.sh --------------------------------------------------------- 7. Then we have to compile the 8/24bit XWindow-Driver: This driver is supporting true color as well as 8bit (256 colors). cd src421/src/display/devices/XDRIVER_24 For SGI, HP etc. you might change the Gmakefile in src421/src/display/devices/XDRIVER_24/XDRIVER24/ as documented, leave it untouched for Linux and SUN... Go now to src421/src/display/devices/XDRIVER_24 Say there: gmake4.2 Go to ../grass42/driver Set a link there: ln -s XDRIVER_24 XDRIVER Otherwise GRASS will not find the driver. --------- Finally some files have to be created (copied from samples): cd ../grass42/etc/ cp digcap.sampl digcap cp moncap.sample monitorcap 8. After that correct the monitorcap file: textedit monitorcap Here you have to delete the # character for the drivers x0 - x6 and the cell driver. The paths will be right (look for it). 9. Finally... create the lock-directory: cd ../grass42/locks mkdirchmod ugo+wrx e.g. mkdir apollo chmod ugo+wrx apollo 10. OPTIONAL: - How to install a digitizer: read instructions in - documents/instructions/admin/digitizer.html - src421/src/mapdev/INSTALL-digitizer.txt - How to install the postscript drivers for printing (ps.select, ps.map): read instructions in src421/files_for_binary_installation/README - compile XGRASS with lesstif: read XGRASS instructions - use TclTkGRASS: read src421/src.alpha/tcltkgrass/INSTALLATION_source.txt - install extra modules (e.g. from untested section): Follow the instructions src421/INSTALL_extra_modules.html. ------------------------------------------------------ Yeah! Have fun. And write nice new modules for us. The GRASS-world is waiting for your ideas... Markus Neteler neteler@geog.uni-hannover.de You have found this file here: http://www.geog.uni-hannover.de/grass/ ------------------------------------------------------ Change history of this file: 19.12.97 - If you have problems with BASH, use tcsh instead... - look at the new solution for 12.) r.bilinear. - new points: 17. - 25. You can change later an error, and just say gmake4.2 in this directory. The binaries will be updated. Do not forget to use CMD/MAKELINKS.my after compiling. 6.1.98 - some typing errors were corrected in this text. Important is this: Finally some files have to be created: cd ../grass42/etc/ !! cp digcap.sampl digcap ^ (the p was missing) 7.1.98 - added information for installing digitizer - added information for installing 24bit XDRIVER 8.1.98 - Whats-new file included. 11.1.98 - sorry, certainly you have to untar the package with "x"... - some new modules in "src421/untested" section - new tutorial pages in "src421/documents/tutorials" section 19.1.98 - changed information for 24bit XDRIVER - added information about postscript-drivers for printing 27.1.98 - new beta ... should be first final version now :) 28.1.98 - this text was corrected in some points (mostly to be more clearly) 4.2.98 - added creation of links before installation (section "0.") 5. Feb. 98 - added information to compile XGRASS with lesstif (section 10.) 3. March 98 - added information about installing extra modules (section 10.) 15. April 98 - added information about TclTKGRASS (section 10.) 18. July 98 - corrected information about XDRIVER - added digitizer information 28. August 98 - corrected "step 0": links to X11 9. Sept. 98 - corrected some paths here