Re: [GRASS-user] Re: Installing r.area

2010-07-27 Thread Markus Neteler
On Tue, Jul 27, 2010 at 12:58 PM, LeeDaniel  wrote:
>
> Thanks for the replies! I've tried it out and here are my responses to the
> suggestions:
>
> @ Markus - Downloaded the script and put it in my scripts folder, made it
> executable and made it assigned rights to myself.

[the next release will include it]

> Just as a test I tried
> opening it as a GUI and, lo and behold, it worked. However, it couldn't find
> my add-on path,

Yes, by default it is undefined which is bad IMHO. I'll fix that to $GISBASE
with a parameter to change it optionally.

> of course, when I tried to add r.area. So I went to the
> terminal and entered:
>
> export GRASS_ADDON_PATH?$GISBASE

? -> =

> g.extension r.area
>
> Now things looked good. It did the following:
>
> Fetching  from GRASS-Addons SVN (be patient)...
> A    r.area/main.c
> A    r.area/description.html
> A    r.area/Makefile
> Checked out revision 42910.
> - Great, got the files needed. Then it started compiling:
> Compiling ...
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/bin.i686-pc-linux-gnu
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/lib
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/bin
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/etc
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/driver
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/driver/db
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/fonts
> test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
> gcc -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include
> -O2       -DPACKAGE=\""grassmods"\"
> -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include -o
> OBJ.i686-pc-linux-gnu/main.o -c main.c
> main.c:19:23: fatal error: grass/gis.h: No such file or directory
> compilation terminated.

The include files have not been packaged which we/the packager
should change. Where did you get the binaries from? I have to
understand who's omission that is (GRASS itself or the packaging).


> make: *** [OBJ.i686-pc-linux-gnu/main.o] Error 1
> ERROR: Compilation failed, sorry. Please check above error messages.
> - So it looks like it was able to make a bunch of directories. I checked,
> they're there, new as of today. The entire directory of /usr/src/packages/
> is new. However, GRASS wasn't able to compile. I checked for
>
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass/gis.h
> since it seemed that it was looking for it and couldn't find it, and
> discovered that the directory
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass/
> is completely empty. Could that be the problem?

Yes.

> I also tried using
> sudo g.extension r.area
> And got the usual error that I have to be in GRASS GIS to run the program. I
> didn't try starting GRASS as a super user because I don't want to do
> anything wrong and I also don't want it to install r.area only for super
> users.

sure.

> But that would be a nice way of loading add-ons, because it looks like I
> wouldn't have to have the source code all on my hard drive. Any idea why
> it's not working?

Because it has been only lightly tested we'll figure out!
Please answer to above question (binaries).

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-07-29 Thread Hamish
LeeDaniel wrote:
> Sorry to pester, but does anybody know where I could look to find a
> solution to this problem? I can't finish my analysis without either
> r.area or a complicated vector analysis, and it's something we have to
> do a lot over here, so I'd be very grateful for any further help. Thanks
> a bunch!


Hi,

I've not tried r.area yet, and don't really know it at all, but on the
surface I wonder how is it different from the results you already get
from r.report or r.stats?


Hamish



  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-07-29 Thread Hamish
fyi I get what it does now, and just fixed a small bug in it which was
stopping it from reading CELL maps.

I have the full svn version of grass built from source, and from the
addons svn dir I built it with:
  make MODULE_TOPDIR=/usr/local/src/grass/svn/grass65/

(I just run grass out of the source dir, so never 'make install' it)

at minimum I think you have to cd to the main source dir and do ./configure

if you installed grass from a package, check if there is an associated
-dev package, and then point MODULE_TOPDIR towards where it install its
files.


Hamish



LeeDaniel wrote:
> Thanks for the replies! I've tried it out and here are my
> responses to the
> suggestions:
> 
> @ Markus - Downloaded the script and put it in my scripts
> folder, made it
> executable and made it assigned rights to myself. Just as a
> test I tried
> opening it as a GUI and, lo and behold, it worked. However,
> it couldn't find
> my add-on path, of course, when I tried to add r.area. So I
> went to the
> terminal and entered:
> 
> export GRASS_ADDON_PATH?$GISBASE
> g.extension r.area
> 
> Now things looked good. It did the following:
> 
> Fetching  from GRASS-Addons SVN (be
> patient)...
> Ar.area/main.c
> Ar.area/description.html
> Ar.area/Makefile
> Checked out revision 42910.
> - Great, got the files needed. Then it started compiling:
> Compiling ...
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/bin.i686-pc-linux-gnu
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/lib
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/bin
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/etc
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/driver
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/driver/db
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/fonts
> test -d OBJ.i686-pc-linux-gnu || mkdir -p
> OBJ.i686-pc-linux-gnu
> gcc
> -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include
> 
> -O2   
>-DPACKAGE=\""grassmods"\" 
> -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include
> -o
> OBJ.i686-pc-linux-gnu/main.o -c main.c
> main.c:19:23: fatal error: grass/gis.h: No such file or
> directory
> compilation terminated.
> make: *** [OBJ.i686-pc-linux-gnu/main.o] Error 1
> ERROR: Compilation failed, sorry. Please check above error
> messages.
> - So it looks like it was able to make a bunch of
> directories. I checked,
> they're there, new as of today. The entire directory of
> /usr/src/packages/
> is new. However, GRASS wasn't able to compile. I checked
> for
> 
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass/gis.h
> since it seemed that it was looking for it and couldn't
> find it, and
> discovered that the directory 
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass/
> is completely empty. Could that be the problem? I also
> tried using
> sudo g.extension r.area
> And got the usual error that I have to be in GRASS GIS to
> run the program. I
> didn't try starting GRASS as a super user because I don't
> want to do
> anything wrong and I also don't want it to install r.area
> only for super
> users.
> 
> But that would be a nice way of loading add-ons, because it
> looks like I
> wouldn't have to have the source code all on my hard drive.
> Any idea why
> it's not working?
> 
> @ Micha - Tried running it with g.extension (see above); it
> didn't work, so
> I tried to do the thing manually again. Entered
> svn checkout https://svn.osgeo.org/grass/grass-addons/
> grass-addons
> to get the source codes. It worked and all the source codes
> were downloaded
> to my home directory in the folder grass-addons. Then I
> navigated into the
> directory
> ~/grass-addons/raster/r.area/
> and entered the command
> ./configure
> This is similar to last time; last time, I also had been
> inside the
> directory when I tried the commands. But I thought hey,
> maybe I'd copied the
> source codes wrong. Sadly, that doesn't seem to be the
> problem; just like
> last time, I got the message
> bash: ./configure: No such file or directory
> I then tried it as super user. Same problem.
> 
> Any other ideas? Thanks a lot again for the help,
> everyone!
> Daniel



  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-07-31 Thread Markus Neteler
On Thu, Jul 29, 2010 at 8:30 PM, LeeDaniel  wrote:
>
> Hi everyone,
>
> Thanks for the responses. I'm really sorry that I'm struggling so much here,
> but... It just isn't working for me.

Apparently only now g.extension gets the needed testing...
It should not require code compilation but needs the include subdirectory
being present (and complete) in the binary installation directory.

...
> I ended up reinstalling GRASS with my packet manager. It works now. But I
> still don't have the extension.

You mean g.extension? It was only added recently and won't be packaged
yet for your distro. You can download it here (I made some bugfixes a few
days ago):

http://svn.osgeo.org/grass/grass/branches/releasebranch_6_4/scripts/g.extension/

You can copy it to $GISBASE/scripts/
chmod a+x $GISBASE/scripts/g.extension

Then use it in GRASS:

g.extension r.area

Again, this needs GRASS to be properly packaged. Perhaps the include/
stuff was separated out into an extra grass-devel package for your distro?

...
> *sigh* So it looks like I'm still miles away from getting this addon.

Don't give up :) We'll figure it out.

> I also tried it with g.extension. Here's the error I get:
> Fetching  from GRASS-Addons SVN (be patient)...
> A    r.area/main.c
> A    r.area/description.html
> A    r.area/Makefile
> Ausgecheckt, Revision 42949.
> Compiling ...
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/bin.i686-pc-linux-gnu
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/lib
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/bin
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/etc
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/driver
> mkdir -p
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/driver/db
> mkdir -p /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/fonts
> test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
> gcc -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include
> -O2       -DPACKAGE=\""grassmods"\"
> -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include -o
> OBJ.i686-pc-linux-gnu/main.o -c main.c
> main.c:19:23: fatal error: grass/gis.h: Datei oder Verzeichnis nicht
> gefunden

--> the include/ directory is missing from your binary installation.
Please check if grass-dev (or whatever it is called in Ubuntu) is installed.
Then retry.

Cheers
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-07-31 Thread Markus Neteler
On Sat, Jul 31, 2010 at 6:09 PM, LeeDaniel  wrote:
>
> Hi ya'll!
>
> Alright, r.area still isn't functional,

(you mean the installation via g.extension isn't functional on your machine)

> but I think we might be a few steps
> closer to the goal... I got the new and improved g.extension script from
> http://svn.osgeo.org/grass/grass/branches/releasebranch_6_4/scripts/g.extension/
> and popped it as an executable into $GISBASE/scripts/, then changed the
> rights so that I can use it. I tried it again.

Perfect. In any case, it will be in the next release.

> Bad news is, it still didn't
> work. The good news is, my new error message is different from my last one!

No, it is the same...

> GRASS 6.4.0RC6 (DornbirnTest):~ > g.extension r.area
> Fetching  from GRASS-Addons SVN (be patient)...
> A    r.area/main.c
> A    r.area/description.html
> A    r.area/Makefile
> Checked out revision 42954.
> Compiling ...
> test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
> gcc -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include
> -O2       -DPACKAGE=\""grassmods"\"
> -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include -o
> OBJ.i686-pc-linux-gnu/main.o -c main.c
> main.c:19:23: fatal error: grass/gis.h: No such file or directory

You see that grass/gis.h is missing which should be there in your
binary installation in include/.
Ah I just realise that it looks in
/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include
which is unlikely to exist on your machine, right?

...
>> Again, this needs GRASS to be properly packaged. Perhaps the include/
>> stuff was separated out into an extra grass-devel package for your distro?
>>
> Not sure. My distro is OpenSUSE 11.3 and I have the grass-devel package
> installed. I used the packet manager to get it. I have found a directory
> /opt/grass/include/ - could that be it?

Yes but does /opt/grass/include/ contain anything? Does it have a subdirectory
grass/ with a series of .h files? This are needed and not found above since
there is something wrong with your paths.

The relevant compile line is
make MODULE_TOPDIR="$GISBASE"

so it should find /opt/grass/ but it doesn't. What reports

echo $GISBASE
in a GRASS session?

Is it possible that you have two GRASS version installed?

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-08-01 Thread Hamish
Marcello wrote:
> I also wanted to use r.area, so I installed it but had an
> error, as posted here
> http://osgeo-org.1803224.n2.nabble.com/New-modules-in-svn-add-on-r-area-and-r-convergence-td5161926.html#a5199839
... :
> But then I get the following error:
> ATENÇÃO: Raster map  not found in mapset
>   
> ERRO: is not of type CELL, probably not
>  crated with r.clump 


this bug is now fixed in svn.


Hamish




___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-08-02 Thread Hamish
Markus N:
> > ...does /opt/grass/include/ contain anything? Does it have
> > a subdirectory grass/ with a series of .h files? This are
> > needed and not found above since there is something wrong
> > with your paths.

LeeDaniel:
> The directory /opt/grass/include/grass/ does indeed exist
> and it's got 89 *.h files and four folders. Maybe it's just
> looking at the wrong path?
 
> > What reports
> > echo $GISBASE
> > in a GRASS session? 
> 
> It returns
> /opt/grass
> So it looks like my GISBASE is where my package manager
> installed it. At least that's where the relevant files are.


try 

cd /to/where/r.area/is/
# should see main.c here

make MODULE_TOPDIR=/opt/grass/


Hamish



  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-08-03 Thread Jarek Jasiewicz

Hamish pisze:

fyi I get what it does now, and just fixed a small bug in it which was
stopping it from reading CELL maps.
  

Thanks, Hamish, I was offline for over the week so I cannot fix it myself...


Hamish
  
If someone is interested in result of r.stats and r.area are the same 
(as I tested). r.area is a simple alternative for mixed 
r.report/awk/r.recalss command with additional option to remove small 
(lower than treeshold) areas.

Is also very fast...


Hope now it works, if no, please all report it to me (I little lost in 
previous discussion but I notice that main problem was with compiling it 
in some binary GRASS distributions)


thanks for trying it.

Jarek


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-08-03 Thread Markus Neteler
On Mon, Aug 2, 2010 at 3:14 PM, Hamish  wrote:
> Markus N:
>> > ...does /opt/grass/include/ contain anything? Does it have
>> > a subdirectory grass/ with a series of .h files? This are
>> > needed and not found above since there is something wrong
>> > with your paths.
>
> LeeDaniel:
>> The directory /opt/grass/include/grass/ does indeed exist
>> and it's got 89 *.h files and four folders. Maybe it's just
>> looking at the wrong path?
>
>> > What reports
>> > echo $GISBASE
>> > in a GRASS session?
>>
>> It returns
>> /opt/grass
>> So it looks like my GISBASE is where my package manager
>> installed it. At least that's where the relevant files are.
>
>
> try
>
> cd /to/where/r.area/is/
> # should see main.c here
>
> make MODULE_TOPDIR=/opt/grass/

I guess he's hit by this problem:
http://trac.osgeo.org/grass/ticket/620

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-08-03 Thread Markus Neteler
On Tue, Aug 3, 2010 at 1:37 PM, LeeDaniel  wrote:
>
> Alright... I tried the following:
> l...@pc19384:~> svn checkout
> https://svn.osgeo.org/grass/grass-addons/raster/r.area/
> A    r.area/main.c
> A    r.area/description.html
> A    r.area/Makefile
> Ausgecheckt, Revision 42981.
> l...@pc19384:~> cd r.area/
> l...@pc19384:~/r.area> make MODULE_TOPDIR=/opt/grass/
> test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
> gcc -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include
> -O2       -DPACKAGE=\""grassmods"\"
> -I/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include -o
> OBJ.i686-pc-linux-gnu/main.o -c main.c

This will never work unless the OpenSuse packager fixes the
wrong path (.../BUILD/... is wrong and needs to be /opt/...).

Or you do it yourself... AFAIK, it is in your case in
/opt/grass/include/Make/Platform.make

(see also the ticket 620 as mentioned previously)

Then also g.extension will work for you.

Please let us know,
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-08-04 Thread Glynn Clements

LeeDaniel wrote:

> > wrong path (.../BUILD/... is wrong and needs to be /opt/...).
> > 
> > Or you do it yourself... AFAIK, it is in your case in
> > /opt/grass/include/Make/Platform.make 
> 
> Alright, I think I understood what to do.  I edited
> /opt/grass/include/Make/Platform.make (made a backup) and changed these two
> lines from:
> # GRASS dirs
> GRASS_HOME  = /usr/src/packages/BUILD/grass-6.4.0RC6
> RUN_GISBASE =
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu
> 
> to:
> # GRASS dirs
> GRASS_HOME  = /opt/grass
> RUN_GISBASE = /opt/grass/dist.i686-pc-linux-gnu

GRASS_HOME is the location of the GRASS source tree. If you don't have
the GRASS source tree, it should be unset.

Its value is used to initialise a few other variables, which need to
be changed when building without the source tree:

ARCH_DISTDIR= $(GRASS_HOME)/dist.$(ARCH)
ARCH_BINDIR = $(GRASS_HOME)/bin.$(ARCH)
ERRORLOG= $(GRASS_HOME)/error.log

If you're building against an installed version, ARCH_DISTDIR should
be set to the installation directory (e.g. /usr/local/grass-6.4.0RC6),
ARCH_BINDIR shouldn't matter, and ERRORLOG can be set to any absolute
filename.

Also, you need to override MODULE_TOPDIR on the command line, e.g.:

make MODULE_TOPDIR=/usr/local/grass-6.4.0RC6

This is used to locate the *.make files, so setting in those files
won't work.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: Installing r.area

2010-08-04 Thread Glynn Clements

LeeDaniel wrote:

> Its value is used to initialise a few other variables, which need to
> > be changed when building without the source tree:
> > 
> > ARCH_DISTDIR = $(GRASS_HOME)/dist.$(ARCH)
> > ARCH_BINDIR = $(GRASS_HOME)/bin.$(ARCH)
> > ERRORLOG= $(GRASS_HOME)/error.log
> > 
> > If you're building against an installed version, ARCH_DISTDIR should
> > be set to the installation directory (e.g. /usr/local/grass-6.4.0RC6),
> > ARCH_BINDIR shouldn't matter, and ERRORLOG can be set to any absolute
> > filename.
> Alright. I took out the variable $ARCH_DISTDIR and replaced it with
> /opt/grass/. So the three lines the GRASS dirs are now:

> RUN_GISBASE = 
> /usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu

This should also be /opt/grass (or wherever GRASS is installed).

> Alright. Tried it out by navigating into the folder with r.area. Here are
> the results:

> gcc -I/dist.i686-pc-linux-gnu/include

It would appear that any change to ARCH_DISTDIR was incorrect. The
above is what you would get if you left

ARCH_DISTDIR = $(GRASS_HOME)/dist.$(ARCH)

but GRASS_HOME was unset.

> main.c:19:23: schwerwiegender Fehler: grass/gis.h: Datei oder Verzeichnis
> nicht gefunden
> Kompilierung beendet.

If you're going to post build output to the mailing list, run:

export LC_ALL=C

in the shell before running "make".

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user