TcltkGRASS/Linux:1,2,3

Cao Changyong changyoc at daisy.siue.edu
Thu Apr 7 12:08:54 EDT 1994


Hi,

    I am trying to summarize the steps in compiling tcltkgrass on Linux. 
Please feel free to correct me if I am wrong: 

Step 1. Before compiling tcltkgrass:

     Get the tcltkgrass package from moon.cecer.army.mil in pub/incoming.  
Then untar it in you Linux box.  If you don't have the tcl/tk package, you
need to get the source code(and binaries) from sunsite.unc.edu in pub/Linux
/devel/tcl.  Please note that the source codes for tcl/tk are needed because
it will look for some .h files such as tk.h when you compile tcltkgrass.

     Make sure that you have the binaries and the Xlib kit for X Window.  You
will need files such as Xlib.h.

     Change the tcltkgrass Makefile in the ../grass/src directory to reflect 
the configuration of your machine.  Pay attention to the TCL and TK path 
(should point to the source directories).  GRASS should point  to the GRASS
src directory.  You do need the source codes for GRASS because it will look for
such things as gis.h. 

     Add a line CC=gcc to use the gcc compiler, and add a flag on the EXTRAFLAG
line: -fwritable-strings(this will avoid the segmentation fault caused by the
env(TCLTKGRASSBASE). Thanks to Mark Line. 

     To be safe, add #include <stdlib.h> in all .c files to avoid such problems
as "floating point exceptions" when zooming.

     Change to the ../grass/src directory and type "make"
     It takes a few minutes to compile.


Step 2. After tcltkgrass is compiled:

    Before you can run tcltkgrass, you need to make some changes in the 
../script/tcltkgrass file.  Mainly the TCLTKGRASS=  and GISBASE = should be 
modified to point to the right places on your system.  Otherwise, it will 
complain about it.
    TCLTKGRASSBASE = wherever your tcltkgrass packages is.  ex: ../grass
    GISBASE=wherever your grass binary package is. ex: ../grass

    It's not necessary to move tcltkgrass to another directory.  To run 
tcltkgrass, cd to its script directory, for example, ../grass/script.  Then 
just type: tcltkgrass.

  
Step 3. Some problems and solutions:

    1) In the Makefile, the compiler flag "A 10" was not recongnized on my
system.  Therefore, I only used the -O flag.
    2) The access(..., R_OK) in one of those .c files: the R_OK was not 
recognized for some reason.  Therefore, I changed R_OK to 0.
    3) Mark Line suggested to use gcc with the -fwritable-strings option to
compile in order to avoid segmentation fault caused by env(TCLTKGRASSBASE) 
in the TclTkInit.c.
    4) Xin suggested to include stdlib.h in .c files to avoid the floating
point exception error(comes from the atof?) in SuperView when zooming.

Step 4. Unsolved mysteries...
    1) How to use those regular grass commands in the SuperView?
    2) What's the best way to run start tcltkgrass?  Create a link in the
/usr/bin for tcltkgrass?
    ...
     Finally, please realize that this is the Alpha version of the summary.
So please do not complain if things go wrong.


    If you have suggestions or comments, please let me know.
 
    Thank you.

Changyong Cao
changyoc at daisy.siue.edu
   



More information about the grass-user mailing list