[GRASS-user] Re: Trying python scripts.

Marcello Gorini gorini at gmail.com
Sun May 30 20:25:38 EDT 2010



stephen sefick wrote:
> 
> This is a script that I wrote this morning to grab the latest 6.4 svn
> sources and the addons, and then compile the addons that I want and
> install grass.  the sources are checked out to
> ~/sources/grass/grass64_release and ../grass-addons.  I don't know if
> you are on *nix, but this has made me a happy camper.  Any tweaks to
> this would be helpful if there is a glaring error in my logic, but is
> did work.
> kindest regards,
> 
> Stephen
> 
> ###bash script below###
> #!/bin/bash
> 
> sudo -v
> 
> #change when major version number changes
> grass_dir='grass64_release'
> 
> #get latest GRASS Sources
> svn checkout https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4
> /home/$USER/source/grass/$grass_dir
> 
> #get latest grass-addons
> svn checkout https://svn.osgeo.org/grass/grass-addons
> /home/$USER/source/grass/grass-addons
> 
> cd /home/$USER/source/grass/$grass_dir
> 
> #ubuntu configuration for Grass 6.5
> CFLAGS="-g -Wall" ./configure \
>      --with-libs=/usr/lib64 \
>      --with-cxx --with-freetype=yes \
>      --with-postgres=no --with-sqlite=yes --enable-largefile=yes \
>      --with-tcltk-includes=/usr/include/tcl8.4 \
>      --with-freetype-includes=/usr/include/freetype2 \
>      --with-python=/usr/bin/python2.6-config \
>      --with-wxwidgets=yes \
>      --with-nls --enable-largefile \
>      --with-proj-share=/usr/share/proj \
>      --with-readline \
>      --with-cairo
> 
> make -j4
> 
> cd /home/$USER/source/grass/grass-addons/raster
> cp -r r.stream* /home/$USER/source/grass/$grass_dir/raster
> cd /home/$USER/source/grass/$grass_dir/raster
> 
> #make r.stream* modules
> folders=$(ls | grep r.stream)
> for k in $folders ; do
> cd $k
> make -j4
> cd /home/$USER/source/grass/$grass_dir/raster
> done
> 
> cd /home/$USER/source/grass/$grass_dir
> 
> sudo make install
> 
> 
> Stephen Sefick
> 
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> 


Now you got a problem, because I want to make this script work bad,
especially the add-on part, so you need to help me :)

And the big problem is that I am VERY limited, but "GOD rewards the
patient...." (I just made that out :))

First I just ran the script and obviously, problems ocurred with respect to
the folders it was looking at. 
This line for instance:

/home/$USER/source/grass/grass-addons

implies that I must have this folder already in my computer, right? The
script is not creating it, right?

Assuming I am right, I created all the folders the script points to, before
running it again. But it creates a folder called releasebranch_6_4 and then
one called grass-addons in my home directory (because that is where I ran
the script).
So when you do:
 cd /home/$USER/source/grass/$grass_dir
There is nothing there.

But then, trying to make it right, I cd to the folder releasebranch_6_4 and
tried to keep going with the code.
Then after:
CFLAGS="-g -Wall" ./configure \
     --with-libs=/usr/lib64 \
     --with-cxx --with-freetype=yes \
     --with-postgres=no --with-sqlite=yes --enable-largefile=yes \
     --with-tcltk-includes=/usr/include/tcl8.4 \
     --with-freetype-includes=/usr/include/freetype2 \
     --with-python=/usr/bin/python2.6-config \
     --with-wxwidgets=yes \
     --with-nls --enable-largefile \
     --with-proj-share=/usr/share/proj \
     --with-readline \
     --with-cairo

I got the following result:

checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc -g -Wall ) works... yes
checking whether the C compiler (gcc -g -Wall ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for executable suffix... no
checking for full floating-point support... yes
checking for pwd... /bin/pwd
checking for source directory... /home/marcello/releasebranch_6_4
checking for build directory... /home/marcello/releasebranch_6_4
checking for MacOSX App... no
checking for MacOSX architectures... no
checking for MacOSX SDK... no
checking how to build libraries... shared
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking if 64bit support is requested... no
checking if 64bit Sparc VIS support is requested... no
checking system version (for dynamic loading)... Linux-2.6.31-21-generic
checking for dlopen in -ldl... yes
checking for ar... ar
checking for additional include dirs... 
checking for additional library dirs... /usr/lib64
checking for a BSD compatible install... /usr/bin/install -c
checking for flex... lex
checking for yywrap in -ll... no
checking for lex... no
configure: error: *** Unable to locate lex.

And then that's it.

Am I COMPLETELY wrong in everything? Can you help me with that?
I was just waiting (because I just got here) to ask for help in the list
with respect to installing add-ons (I really need those fuzzy add-ons), when
you sent me this great script, so now....LET'S GET IT ON!!  :)

Best regards,
Marcello.

P.S. I use Ubuntu 9.10 64 bits.
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Trying-python-scripts-tp5109105p5120096.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list