[GRASS-user] Compilation of GRASS 6.4.2 from svn on Ubuntu 10.04

nikos ves vesnikos at gmail.com
Mon Jun 11 01:39:10 PDT 2012


Rebecca, 


To compile grass (or any other software for a matter of fact), you must
first meet the pre-requirement, usually libraries which provide
secondary functions of some-kinds. As a program grows in complexity so
does the number of those libraries it depends upon.  


Since you're in a debian-based distribution (ubuntu), which has an older
version of grass in its repositories you can one-shot the installation
of the required libraries with the following :

$ sudo apt-get update
$ sudo apt-get build-dep grass 

The above commands will install all dependencies the package grass needs
to compile/run. Even if the grass package that residents in the
repositories is an older version, with that way you will have installed
the majority of the libraries the updated versions of grass depend on,
and thus minimize the library hunt later on.


After you've installed the dependencies you run the ./configure script
which produces a file with all the variables that they will be used in
the compilation phase. 
The best way to run the ./configure is to create a basic script which it
will call the ./configure with its all its parameters. 

$ cd <folders where grass src code residents>
$ touch grass-install.sh
$ chmod +a grass-install.sh  


Open grass-install.sh with your favorite text editor and copy/paste this
[1]:
CFLAGS="-g -Wall" ./configure \
       --with-cxx --with-freetype=yes \
       --with-postgres=no --with-sqlite=yes --enable-largefile=yes \
       --with-readline --with-python=yes
       

Save it and run it. (From terminal you just type ./grass-install.sh )

The script will NOT complete successfully since most likely will
encounter a tcl.h error. this means that the ./configure script can find
the tcl header file, because either its not where the script expects it
to be or because you don't have it installed. Since most likely you will
encounter same errors for others files, i'll describe bellow a
semi-universal way locating  the libraries you need: 

Say the script can't find tcl.h , so you must install the package which
contains it. One way is to google the name of the package which contains
is, find the corresponding name of that package and then apt-get it. The
smart way tho is to make the apt-get do the searching for you:

$ sudo apt-get install apt-file
$ sudo apt-file update
$ apt-file search <name-of-file> 

and for this example  
$ apt-file search tcl.h 

which is the commands which you ask apt to answer you for all the
packages which contain the tcl.h . Normally you want the package which
ends in -dev: 


$ sudo apt-get install tcl8.5-dev

after the isntallation ofthe package completes, dont forget to run 

$ sudo updatedb 

which refreshes the file database.

After updatedb completes, locate where the file tcl.h lingers

locate tcl.h

which in my case is :  /usr/include/tcl8.5/tcl.h .

Open again grass-install.sh you created before and add at the end the
following 

--with-tcltk-includes="/usr/include/tcl8.5"

I found about the parameter "--with-tcltk-includes=" by
running ./configure --help | grep tcl from the grass directory.

Re-run the script and it should complete the tcl check successfully,
only to hinder in another error. Re-run the above patern for the new
error, adjust your configuration script accordingly until it completes
successfully.

Then you can run :

$ make 
$ make install 

(I recommend installing grass in userland  (check the --prefix argument
for ./configure).

Compiling from source is really fun! 

Regards, 

Nick Ves

--------------------------
[1] modified version of http://grass.osgeo.org/wiki/Compile_and_Install


On Fri, 2012-06-08 at 15:41 +0100, Rebecca Bennett wrote:
> Hello,
> 
> 
> Great idea but the reason I need to compile from source is to get a
> newer version than the 6.4.1 in the repo so it won't work for me this
> time. :(
> 
> 
> 
> Cheers,
> Rebecca
> 
>         
>         ______________________________________________________________
>         From: nikos ves <vesnikos at gmail.com>
>         To: Rebecca Bennett <rabennett at ymail.com> 
>         Cc: GRASS user List <grass-user at lists.osgeo.org> 
>         Sent: Friday, 8 June 2012, 15:17
>         Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2 from svn
>         on Ubuntu 10.04
>         
>         
>         Dear Rebecca,
>         
>         
>         Since you're on ubuntu I suggest downloading a pre-compiled
>         binary for
>         grass ready for use for your distribution (unless you want
>         grass to be
>         able to handle something more exotic):
>         
>         sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
>         sudo apt-get update
>         sudo apt-get install grass grass-dev
>         
>         
>         Regards,
>         Nick Ves
>         
>         
>         On Fri, 2012-06-08 at 15:00 +0100, Rebecca Bennett wrote:
>         > Thanks for your response.
>         > 
>         > 
>         > 
>         > No apparently the configure did not complete without error,
>         as I got
>         > 
>         > 
>         > checking whether to use Tcl/Tk... yes
>         > checking for location of Tcl/Tk includes... 
>         > checking for tcl.h... no
>         > configure: error: *** Unable to locate Tcl includes.
>         > 
>         > 
>         > So that explains why the make won't run. Here is the
>         configure command
>         > I'm trying to use (which probably isn't perfect it was just
>         culled of
>         > the instructions site)
>         > 
>         > 
>         > 
>         > --with-sqlite --with-cairo --with-freetype --with-cxx
>         > --with-geos=usr/bin/geos-config
>         --with-gdal=/usr/bin/gdal-config
>         > --with-python=/usr/bin/python-config
>         > --with-wxwidgets=/usr/bin/wx-config --enable-largefile
>         > --with-proj-share=/usr/share/proj/
>         > 
>         > 
>         > full output in text file attached.
>         > 
>         > 
>         > 
>         > Cheers!
>         > Rebecca
>         > 
>         > 
>         > 
>         >        
>         >
>         ______________________________________________________________
>         >        From: nikos ves <vesnikos at gmail.com>
>         >        To: Rebecca Bennett <rabennett at ymail.com> 
>         >        Cc: GRASS user List <grass-user at lists.osgeo.org> 
>         >        Sent: Friday, 8 June 2012, 14:32
>         >        Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2
>         from svn
>         >        on Ubuntu 10.04
>         >        
>         >        
>         >        Hey Rebecca,
>         >        
>         >        
>         >        Does the ./configure prior issuing the make command
>         ends
>         >        successfully?
>         >        
>         >        
>         >        Nick Ves 
>         >        
>         >        
>         >        On Fri, 2012-06-08 at 14:17 +0100, Rebecca Bennett
>         wrote:
>         >        > Hello all
>         >        > 
>         >        > 
>         >        > 
>         >        > Trying to update my GRASS installation from the svn
>         to 6.4.2
>         >        on Ubuntu
>         >        > Lynx using these instructions
>         >        > 
>         >        > 
>         >        >
>         http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu
>         >        > 
>         >        > 
>         >        > Having worked through all the dependencies I get as
>         far as
>         >        > 
>         >        > 
>         >        >    make -j2 && sudo make install && sudo ldconfig
>         >        > 
>         >        > 
>         >        > and get the following error
>         >        > 
>         >        > 
>         >        >    make: *** No rule to make target
>         >        `include/Make/Platform.make'.
>         >        > Stop.
>         >        > 
>         >        > 
>         >        > I'm not very good at this so any ideas most
>         welcome!
>         >        > 
>         >        > 
>         >        > best wishes,
>         >        > Rebecca
>         >        >        
>         >        > _______________________________________________
>         >        > grass-user mailing list
>         >        > grass-user at lists.osgeo.org
>         >        > http://lists.osgeo.org/mailman/listinfo/grass-user
>         >        
>         >        
>         >        
>         >        
>         >        
>         
>         
>         
>         
>         




More information about the grass-user mailing list