Compiling GRASS 4.2.1 (V.20) using Linux (V.1.8 - 9. September 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 this new GRASS 4.2.1 version on a Linux platform (should be possible also on all other unix platforms, see the "others" instructions). At least you need Linux Version 1.2.13. I have used Slackware with Linux 2.0.x with libcurses-library (included in the source and binary package) and gcc 2.7.x (cannot remember these very small numbers). More or less all important modules are there. For the missing modules I have no idea how to solve the 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/src ../src421/src.alpha ../src421/src.contrib etc. The dots ../ are your path like /usr/local where you have stored all the stuff. First we have to adjust the (Slackware-)Linux: 0. 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: cd /usr/lib ln -s ../X11/lib/X11 X11 cd /usr/include ln -s ../X11/include/X11 X11 Then we proceed with GRASS: 1. Copy the linux.head-file to grass42/src421/src/CMD/head/ (file is already there) Change compile, paths etc. in this file. 2. go to /usr/local/bin create a new file gmake4.2 there. This file is also stored in the ../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=linux HASX=yes HASMotif=no . $CMD/generic/gmake.sh ------------------------------------------------------------ 3. Change the paths in grass42/src421/src/CMD/GISGEN.my and grass42/src421/src/CMD/MAKELINKS.my to point on the gmake4.2 program. 4. In the file src421/src/CMD/lists/GRASS the modules are specified to be compiled 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. Start the script src421/src/CMD/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 8. Finally some files have to be created (copied from samples): cd ../grass42/etc/ cp digcap.sampl digcap cp moncap.sample monitorcap 9. 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 allright (look for it). 10. Really finally... create the lock-directory: cd ../grass42/locks mkdirchmod ugo+wrx e.g. mkdir apollo chmod ugo+wrx apollo 11. OPTIONAL: - How to install a digitizer: read instructions in - src421/src/mapdev/INSTALL-digitizer.txt - documents/instructions/admin/digitizer.html - 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 - compile TclTkGRASS: Get the TclTKGRASS package from the server. - install extra modules (e.g. from untested section): Follow the instructions here. ------------------------------------------------------ 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.linux 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 the first final version... :) 28.1.98 - this text was slightly corrected 4.2.98 - before installation and compiling you should create these links, if missing: cd /usr/lib ln -s ../X11/lib/X11 X11 cd /usr/include ln -s ../X11/include/X11 X11 5. Feb. 98 - added information to compile XGRASS with lesstif (section 11.) 3. March 98 - added information about installing extra modules (section 11.) 30. April 98 - small corrections - added information about compiling TclTKGRASS (section 11.) 18. July 98 - corrected information about XDRIVER - added digitizer information 21. July 98 - TclTKGRASS is separated now from GRASS 4.2.1 code. Get it in extra package from the 4.2.1 server. 24. July 98 - simplified information about XDRIVER 9. Sept. 98 - corrected some paths here