Compile GRASS on Linux

root root at unit96.iwr.msu.edu
Wed Dec 18 02:02:24 EST 1996


OK, I managed to re-compile GRASS 4.15 on my new Linux box.  However, I don't
have time to package the binaries as I did about one year ago.  So, I put two
files in the pub/grass/incoming directory on the moon:
linuxgrass.tar.gz - several html and text document on how to compile grass on linux
src.extra.tar.gz - extra source codes

You may grep the linuxgrass.tar.gz first and uncompress and untar it.
If you have netscape or other web browser on your linux machine, browse the
linuxgrass.html first and you will get a sense of what's in there.  If you
don't have a web browser, take a look of linuxgrass.txt, lists.txt, and
linux_compile.txt files.

If you decided to give it a try, grep the src.extra.tar.gz and follow the
instruction in the linuxgrass.html or linuxgrass.txt file.  If you have any
questions, please send me an e-mail kangyung at pilot.msu.edu ASAP.  I will fix
it and get back to you ASAP.

I still need to test it before I can package it.  It probably won't happen
until next year.  If you see some commands not included, send me an e-mail
and I will give it a try while I am still in this compilation mood.  Once I
am out of the mood, I have to say sorry.  BTW, this may be my last support for
GRASS on Linux.  Good Luck!

Kang,

Attached is the linuxgrass.txt file
*******************************************************************************
                            GRASS 4.15 for Linux

                                     by

                               Yung-Tsung Kang
           Institute of Water Research, Michigan State University

I have compiled GRASS 4.15 (update 5) on my Linux box, a Pentium pro 180,
and it only takes less than 30 minutes. However, I didn't get a chance to
test it out before I put everything together. If you have any questions,
please send an e-mail to the grassu list (preferred)or
kangyung at pilot.msu.edu (if you are desperated like someone once offerred me
a beer if I ever been his place). Since I will be looking for a new job in
the next three months, your better chance is the grassu list.

I encouraged all to compile GRASS by yourself because you may not have the
same system as I do (kernel 2.0.27 and XFree86 3.2) and it is actually very
simple. So, I will talk about how to compile GRASS on Linux first followed
by installation of my binaries for lazy bugs.

NOTE: I also compiled "lots" of programs in the outgoing directory on moon.
I will refer them as extra through all htmls. Here is a list of compiled
extra programs.

How to compile GRASS on Linux

  1. get the GRASS 4.15 source codes (s5.cpio.Z.0001 to s5.cpio.Z.0016 and
     the README.5)
       1. ftp moon.cecer.army.mil
       2. login as anonymous with your e-mail as the password
       3. cd pub/grass/grass4.1/release/source
       4. get README.5
       5. binary
       6. prompt
       7. mget s5*
       8. quuit
  2. follow the README.5 instruction to unpack the source code to the
     desired directory
       1. cd my_grass_source_code_dir
       2. cat s5.cpio.Z.* | zcat | (cd my_destination_dir; cpio -icud)
       3. you should have core part of the source codes under
          my_grass_source_code_dir
  3. follow the src/CMD/README file to setup the header file
       1. cd my_grass_source_code_dir
       2. cd src/CMD
       3. sh ./utils/setup
       4. answer the question one by one as below:
            1. Compiler to use [cc]: gcc
            2. Is this a SUN system? n
            3. Is this a MASSCOMP system? n
            4. Is this an Integraph system? n
            5. I can't find your Motif include path.
               Path for Motif include files [RETURN for none] --> press
               return
            6. I can't seem to find your X Library.
               Path to your X Library [RETURN for none] --> /usr/X11/lib
            7. Did your system use the GRASS 3.x Portable Vector format [N]?
               y
            8. To be sure, I am going to run a program, which will help in
               answering the question:
               Press RETURN or ENTER to run the test program.
               press return
            9. The program determined that you should answer the question
               YES.
               Do you want to use the Portable Vector format [Y]? y
           10. This release of GRASS supports compilation for multiple
               machine/architectures from the same source directory.
               Do you want this feature enabled? y
           11. ARCH [] : linux
           12. Specify the Unix directory which will contain the GRASS
               startup command. This should be a directory in every users'
               $PATH.
               UNIX_BIN [/usr/local/bin] : press return
           13. COMPILE_FLAGS [-O] : press return
           14. Check complete
               Any problems? n
           15. LDFLAGS [-s] : press return
           16. Check complete
               Any problems? n
           17. XCFLAGS [-D_NO_PROTO] : press return
           18. Check complete
               Any problems? n
           19. XLDFLAGS [] : -
           20. XEXTRALIBS [] : -
           21. MATHLIB [-lm] : press return
           22. Check complete
               Any problems? n (even if there are utils/man.c warnings
               scrolled through)
           23. TERMLIB [] : -
           24. CURSES [-lcurses] : -lncurses
           25. Check complete
               Any problems? n
           26. GISBASE [/app/grass/source/linux] : /app/grass/linux
               /app/grass/linux - directory not found
               Create /app/grass/linux? y
           27. SRC [/app/grass/source/src] : press return
           28. DEFAULT_DATABASE [] : enter your GRASS data path
           29. DEFAULT_LOCATION [xxxxx] : enter a map location
           30. if you may get the "location not foud" error, answer y for
               the next question.
               Acept anyway? y
           31. After something scrolled through the screen,
               Look ok? y
           32. HEADER [linux] : press return
       5. your header file (src/CMD/head/linux) should look like this
  4. now, you need to prepare the src/CMD/lists files
        o if you don't need the extra part,
            1. copy this GRASS list file to the src/CMD/lists directory and
               name it GRASS
            2. copy this GRASS local list fileto the src/CMD/lists directory
               and name it local
        o if you need the extra part,
            1. copy this GRASS extra list file to the src/CMD/lists
               directory and name it GRASS
            2. copy this GRASS extra local list file to the src/CMD/lists
               directory and name it local
            3. get the extra source code from moon.cecer.army.mil
                 1. cd my_grass_source_dir
                 2. ftp moon.cecer.army.mil
                 3. login as anonymous with your e-mail address as the
                    password
                 4. cd pub/grass/outgoing/linuxgrass
                 5. binary
                 6. get src.extra.tar.gz
                 7. quit
                 8. gunzip src.extra.tar.gz
                 9. tar -xvf src.extra.tar
                10. you will have a src.extra directory under
                    my_grass_source_dir
            4. there is one little problem of the extra source code -
               XDRIVER24
                 1. the XDRIVER24 was placed under the
                    src.extra/display/devices/XDRIVER directory and you need
                    to manually move it to the src/display/devices/XDRIVER
                    directory
                 2. so, cd src.extra/display/devices/XDRIVER
                 3. cp -r XDRIVER24 ../../../../src/display/devices/XDRIVER/
  5. it's not read to compile GRASS yet! follow the compilation note to fix
     know bugs first
  6. you may compile GRASS finally
       1. cd my_grass_source_code_dir
       2. cd src/CMD
       3. GISGEN.linux
       4. MAKELINKS.linux
  7. one more problem with the ps.map command
       1. the ps.map need to be compiled with the -fwritable-strings flag
       2. one alternative is to edit the src/CMD/head/linux header file
             + add -fwritable-strings at the end of COMPILE_FLAGS line
               COMPILE_FLAGS = -O -fwritable-strings
             + cd to src.alpha/ps.map
             + simple run gmake4.1 and you are all set
       3. you may need to do the same thing for ps.map.new
  8. create the monitorcap file
       1. now go to your $GISBASE directory (check the grass4.1 file in your
          /usr/local/bin directory)
       2. cp moncap.sample monitorcap
       3. edit the monitorcap
             + take out the "#" in the beginning of each x1-x6 and CELL
               lines
             + if you are using XDRIVER24, you need to either change the
               XDRIVER to XDRIVER24 in all x1-x6 lines or create new entries
               using XDRIVER24
  9. create the fifo.xa and fifo.xb files
     since XDRIVER or XDRIVEr24 uses fifo files, you need to create those
     fifo files in the $GISBASE/dev directory
       1. go to the $GISBASE/dev directory
       2. repeat the following command and substitute x with number 0
          through 8
          mknod fifo.xa p
          mknod fifo.xb p
       3. change the permission with the following command
          chmod og+w fifo.*
       4. alternatively, you can copy the makefifo.sh to the $GISBASE/dev
          and run it to create 11 fifo.xa and fifo.xb files:
          sh ./makefifo.sh
 10. create the digcap file
       1. go to $GISBASE direcotry and you can find the digcap.sampl file
       2. cp digcap.sampl digcap
       3. you may need to add other entries which I don't know too much
          about it

My binaries Installation

     Coming Soon!

Final Notes

The best way to get help probably is the grassu list. I can't promiss that I
will answer all questions. Actually, this may be my last support for GRASS
on Linux. Good Luck!



More information about the grass-user mailing list