[GRASS-user] Installing r.area

Hi all,

I'm trying to use r.area. For that I need to, of course, install it. As I've
never compiled and installed anything before, these questions might be kind
of stupid... So I apologize. Yes, I've read
http://grass.osgeo.org/wiki/Compile_and_Install#Compiled_C_modules
but although I tried what it asked me to do I didn't get the results I
expected. Here is what I tried on OpenSUSE 11.3, 32 bit:

1. Went to the GRASS AddOns Wiki-page
(http://grass.osgeo.org/wiki/GRASS_AddOns) and tried to add the various the
SVN repository to my repository directories in Yast (the OpenSUSE system
tool). Didn't work, which I think is one of those things that everybody'll
say "duh" about, but when I say "duh" in this case, it comes from my heart
because I'm dumb :stuck_out_tongue:
2. Found the source codes of r.area (consisting of description.html, main.c
and Makefile), copied their content into files with matching names in my
home directory
3. Followed the instructions on
http://grass.osgeo.org/wiki/Compile_and_Install to compile and install C
add-ons (under the assumption that that's correct for r.area - sure looks
like it is). Got the following results:

- Hoping that the add-on was a binary (I know, I know...), I tried compiling
it with
make MODULE_TOPDIR=/usr/bin/grass64/
Result:
Makefile:11: /usr/bin/grass64//include/Make/Module.make: Not a directory
make: *** No rule to make target
`/usr/bin/grass64//include/Make/Module.make'. Stop.

Okay. The computer spoke Latin to me. Noticing that it's got a path with two
slashes right after another after my input, I thought that perhaps it wasn't
finding the proper directory and tried it without the slash at the end:
make MODULE_TOPDIR=/usr/bin/grass64
Result:
Makefile:11: /usr/bin/grass64/include/Make/Module.make: Not a directory
make: *** No rule to make target
`/usr/bin/grass64/include/Make/Module.make'. Stop.

Alright. No more double slash, but for all intents and purposes the same
message. So I then tried setting up an alias, not because I understand what
that means but because it was also suggested on the page:
alias gmake64='make MODULE_TOPDIR=/usr/bin/grass64/'
Computer seemed to like this and gave no reply. However, the next line was
ready, so I guess the alias was set up. Then I tried installing it:
make MODULE_TOPDIR=/usr/bin/grass64/ install
Result:
Makefile:11: /usr/bin/grass64//include/Make/Module.make: Not a directory
make: *** No rule to make target
`/usr/bin/grass64//include/Make/Module.make'. Stop.

Obviously I'm doing something wrong. Thinking that I might be dealing with
source code that still needed to be prepared, I entered:
./configure
To which my computer replied:
bash: ./configure: No such file or directory

No luck. Can anybody help me? I know this is a relatively simple question,
but I don't seem to be able to make anything of the online help texts.
Thanks!!

Best,
Daniel
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5340139.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On 27/07/2010 01:41, LeeDaniel wrote:

Hi all,

I'm trying to use r.area. For that I need to, of course, install it. As I've
never compiled and installed anything before, these questions might be kind
of stupid... So I apologize. Yes, I've read
   

My dad used to say "The only stupid question is the one not asked".

http://grass.osgeo.org/wiki/Compile_and_Install#Compiled_C_modules
but although I tried what it asked me to do I didn't get the results I
expected. Here is what I tried on OpenSUSE 11.3, 32 bit:
   

First off, there's a module g.extension that is designed to make this whole addon business smoother. I don't know about OpenSuse: You should check first if it's available. If you have it, then just run:
g.extension r.area
and it does all the dirty work.

1. Went to the GRASS AddOns Wiki-page
(http://grass.osgeo.org/wiki/GRASS_AddOns) and tried to add the various the
SVN repository to my repository directories in Yast (the OpenSUSE system
tool). Didn't work, which I think is one of those things that everybody'll
say "duh" about, but when I say "duh" in this case, it comes from my heart
because I'm dumb :stuck_out_tongue:
   

SVN is not a YAST repository. It's just way to maintain a collection of source code. If you run the command that appears in the above wiki page, you'll get on your computer the source code for all the addons. Then you have to go into each subdir and compile the ones you want.

2. Found the source codes of r.area (consisting of description.html, main.c
and Makefile), copied their content into files with matching names in my
home directory
3. Followed the instructions on
http://grass.osgeo.org/wiki/Compile_and_Install to compile and install C
add-ons (under the assumption that that's correct for r.area - sure looks
like it is). Got the following results:

- Hoping that the add-on was a binary (I know, I know...), I tried compiling
it with
make MODULE_TOPDIR=/usr/bin/grass64/
Result:
Makefile:11: /usr/bin/grass64//include/Make/Module.make: Not a directory
make: *** No rule to make target
`/usr/bin/grass64//include/Make/Module.make'. Stop.

I think you have to be "inside" the directory where put the r.area source.

Okay. The computer spoke Latin to me. Noticing that it's got a path with two
slashes right after another after my input, I thought that perhaps it wasn't
finding the proper directory and tried it without the slash at the end:
make MODULE_TOPDIR=/usr/bin/grass64
Result:
Makefile:11: /usr/bin/grass64/include/Make/Module.make: Not a directory
make: *** No rule to make target
`/usr/bin/grass64/include/Make/Module.make'. Stop.

Alright. No more double slash, but for all intents and purposes the same
message. So I then tried setting up an alias, not because I understand what
that means but because it was also suggested on the page:
alias gmake64='make MODULE_TOPDIR=/usr/bin/grass64/'
Computer seemed to like this and gave no reply. However, the next line was
ready, so I guess the alias was set up. Then I tried installing it:
make MODULE_TOPDIR=/usr/bin/grass64/ install
Result:
Makefile:11: /usr/bin/grass64//include/Make/Module.make: Not a directory
make: *** No rule to make target
`/usr/bin/grass64//include/Make/Module.make'. Stop.

Obviously I'm doing something wrong. Thinking that I might be dealing with
source code that still needed to be prepared, I entered:
   

Yes, you need to have the whole GRASS source available for this. You go into wherever you unpacked the source and there you run ./configure
Try to follow this wiki page:
http://grass.osgeo.org/wiki/Compile_and_Install#Addons

./configure
To which my computer replied:
bash: ./configure: No such file or directory

No luck. Can anybody help me? I know this is a relatively simple question,
but I don't seem to be able to make anything of the online help texts.
Thanks!!

Best,
Daniel
   
--
Micha Silver
http://www.surfaces.co.il/
Arava Development Co. +972-52-3665918

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 <r.area> 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 <r.area>...
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
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5341684.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Tue, Jul 27, 2010 at 12:58 PM, LeeDaniel <Lee.Daniel.1986@gmail.com> 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 <r.area> 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 <r.area>...
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

Phew, I didn't think it'd be so complicated :wink: Sorry! And the question mark
that should be an equals sign was a typo as I was typing that line over (the
other stuff I copy-pasted, but I'm a fast typer that's lazy with the mouse
so I didn't do it for those two lines).

As far as the binaries are concerned, in that case I got the files by
running
g.extension r.area
in the terminal within a GRASS session. I'd downloaded GRASS from the
OpenSUSE Geo-Repository (URL:
http://download.opensuse.org/repositories/Application:/Geo/openSUSE_11.3/).

The binaries had later on were obtained with the command
svn checkout https://svn.osgeo.org/grass/grass-addons/ grass-addons
performed in the terminal outside a GRASS session.

Best,
Daniel
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5342221.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi there...

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!

Best,
Daniel
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5347486.html
Sent from the Grass - Users mailing list archive at Nabble.com.

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

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 <r.area> 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 <r.area>...
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

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.

Hamish:
I tried building GRASS from source and failed miserably. I know, it must
sound pathetic. I went through all of the packages that are required for
GRASS - really all of them - following the instructions on
http://grass.osgeo.org/wiki/Compile_and_Install. This was my process:
- Downloaded all of the packages listed on the requirements page
(http://grass.osgeo.org/grass64/source/REQUIREMENTS.html) with the package
manager. Yes, some of them weren't there and I had to compile and install
them from source. I managed that.
- Made /usr/local/src/grass and gave myself rights to it.
- Downloaded GRASS with
svn checkout https://svn.osgeo.org/grass/grass/branches/develbranch_6
grass6_devel
Had to do it as super user because I didn't have rights to /usr/local/src/.
No problem, did it as a super user and then gave myself rights to it.
- Navigated into /usr/local/src/grass6_devel/ and tried ./configure

Results:
The terminal spit out a bunch of things that found and then was unable to
find PROJ.4. Here's the message:
checking for location of External PROJ.4 includes...
checking for proj_api.h... no
configure: error: *** Unable to locate External PROJ.4 includes.

Now, I know I have PROJ.4 because I installed it with the package manager.
And it's still there. So... I'm confused. But this seems like a whole lot of
trouble for just one little extension - I think the problem is more that I
can't get the extension to compile.

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

Since I didn't compile GRASS myself, I'm not sure exactly where the module
top directory is. I've got opt/grass/etc/python/grass, for example, and a
bunch of other grass folders (12 of them) and am not exactly sure where that
is. It seems like it might be in /opt/grass/ but I'm not sure. That's
definitely where my script directory is. However, when I navigate into
~/grass-addons/raster/r.area/ and type
./configure MODULE_TOPDIR=/opt/grass/
it says it can't find the file or folder "./configure". Also very strange.
And all I want to do is compile this stupid add on!

If I search my computer for any files/folders with "grass* -dev*" I don't
find a thing.

Anyway... Sadly, I haven't managed to come any further.

Leonardo:
Thanks for the tip. As you'll see above, I can't seem to use ./configure on
the GRASS source... It always fails to find PROJ.4, even though PROJ.4 is
installed, and the command "locate PROJ.4" doesn't help either. Therefore I
don't come any further.

I've searched for any grass raster directory to move r.area to and it's not
anywhere on my computer.

*sigh* So it looks like I'm still miles away from getting this addon. I also
tried it with g.extension. Here's the error I get:
Fetching <r.area> from GRASS-Addons SVN (be patient)...
A r.area/main.c
A r.area/description.html
A r.area/Makefile
Ausgecheckt, Revision 42949.
Compiling <r.area>...
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
compilation terminated.
make: *** [OBJ.i686-pc-linux-gnu/main.o] Fehler 1
FEHLER: Compilation failed, sorry. Please check above error messages.

"Datei oder Verzeichnis nicht gefunden" = Didn't find file or folder.
It doesn't find grass/gis.h. I definitely DO have gcc, I also installed that
with the packet manager. Just to be sure, I installed the newest gcc for
every language that I could see in YaST.

I'm at my wit's end...
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5347803.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Thu, Jul 29, 2010 at 8:30 PM, LeeDaniel <Lee.Daniel.1986@gmail.com> 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 :slight_smile: We'll figure it out.

I also tried it with g.extension. Here's the error I get:
Fetching <r.area> from GRASS-Addons SVN (be patient)...
A r.area/main.c
A r.area/description.html
A r.area/Makefile
Ausgecheckt, Revision 42949.
Compiling <r.area>...
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

Hi ya'll!

Alright, r.area still isn't functional, 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. Bad news is, it still didn't
work. The good news is, my new error message is different from my last one!

GRASS 6.4.0RC6 (DornbirnTest):~ > g.extension r.area
Fetching <r.area> 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 <r.area>...
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.

It's a lot shorter than the old error message because it didn't make
directories, apparently.

However, maybe I'm just really missing the point here, because the
directories are still there from the last time I tried to build it.

So much to that. As far as the other stuff is concerned:

Markus Neteler wrote:

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?

Markus Neteler wrote:

Please check if grass-dev (or whatever it is called in Ubuntu) is
installed.
Then retry.

Yep.

Thanks so much for the help!
Best,
Daniel
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5358726.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Sat, Jul 31, 2010 at 6:09 PM, LeeDaniel <Lee.Daniel.1986@gmail.com> 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 <r.area> 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 <r.area>...
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

Hello Daniel,

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

Then afterwards Milton Ribeiro sent me another way to get the same results
in a rather fast way.

I don't want to interrupt your struggle to get r.area working, but if you
need some fast results, I believe you could try this alternative:

r.stats -na input=clumped_map | awk '{print $1,"=",int($2/10000)+1}' |
r.reclass input=clumped_map output=clumped_map_AreaHA - --o

The area is calculated in squared meters than converted to hectares by awk
(but you can probably change units within r.stats) than sent to r.reclass.

Hope this helps in anyway.

Cheers,

Marcello.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5360992.html
Sent from the Grass - Users mailing list archive at Nabble.com.

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 <my_raster_clumped> not found in mapset
          <my_raster_clumped>
ERRO:<my_raster_clumped> is not of type CELL, probably not
crated with r.clump

this bug is now fixed in svn.

Hamish

Alright, sorry, was gone over the weekend. Now I'm back. Here some additional
information.

Concerning installing the add-on r.area with g.extension:

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

After using g.extension to get r.area I get the following error:
GRASS 6.4.0RC6 (DornbirnTest):~ > g.extension r.area
Fetching <r.area> 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 <r.area>...
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.

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?

The path
/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass/
is on my machine, but the directory is empty. It was made on the Thursday,
leading me to believe that g.extension made it.

Concerning the include/ directory in my grass install, that apparently
should be installed with the grass-devel package that I installed with my
package manager:

...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 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.

Is it possible that you have two GRASS version installed?
Don't think so. I deinstalled GRASS with the package manager and then tried
to compile it (see previous entries), but it didn't work. Then I installed
GRASS again with my package manager. Since the compilation failed, I don't
think I've got two version. Plus, the error messages have stayed the same,
both before and after my attempts.

My present course of action:
- Copied the contents of /opt/grass/include/grass/ (all the *.h files)
temporarily to
/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/include/grass/
to see if g.extension can use them now. Then I tried
g.extension r.area
in the shell in a GRASS session. Result:
Fetching <r.area> from GRASS-Addons SVN (be patient)...
A r.area/main.c
A r.area/description.html
A r.area/Makefile
Ausgecheckt, Revision 42961.
Compiling <r.area>...
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
make: *** Keine Regel vorhanden, um das Target
»/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/lib/libgrass_gis.so«,
  benötigt von
»/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/bin/r.area«,
zu erstellen. Schluss.
FEHLER: Compilation failed, sorry. Please check above error messages.

So that's a different error than before. Here's the old one:
GRASS 6.4.0RC6 (DornbirnTest):~ > g.extension r.area
Fetching <r.area> 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 <r.area>...
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.
The new area says it can't find the rule to make the target
»/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/lib/libgrass_gis.so«,
which is needed by
»/usr/src/packages/BUILD/grass-6.4.0RC6/dist.i686-pc-linux-gnu/bin/r.area«.

- I looked in those directories for a "main.o" and a "libgrass_gis.so", but
they weren't there. Now I've deleted the contents of the directory that I'd
temporarily copied so that my folders are back to the state they were in
before I copied them.

Thanks a bunch, by the way, to Marcello for the tip - you mean that, when I
do that, I get the clumped areas back with their value as their area in
hectar? Then I can reclass and take out the areas that are too small? It
should keep the values in m² if I use
r.stats -na input=clumped_map | awk '{print $1,"=",$2}' | r.reclass
input=clumped_map output=clumped_map_AreaHA - --o
instead of
r.stats -na input=clumped_map | awk '{print $1,"=",int($2/10000)+1}' |
r.reclass input=clumped_map output=clumped_map_AreaHA - --o
right?

Best,
Daniel
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5363725.html
Sent from the Grass - Users mailing list archive at Nabble.com.

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

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

On Mon, Aug 2, 2010 at 3:14 PM, Hamish <hamish_b@yahoo.com> 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

Alright... I tried the following:
Lee@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.
Lee@pc19384:~> cd r.area/
Lee@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
main.c:19:23: schwerwiegender Fehler: grass/gis.h: Datei oder Verzeichnis
nicht gefunden
Kompilierung beendet.
make: *** [OBJ.i686-pc-linux-gnu/main.o] Fehler 1

Same error message, it doesn't find what it's looking for.

I looked at the error report and was a bit confused. Does this mean that
there's no way around this other than compiling GRASS from source? Or is it
perhaps possible to download the GRASS source and keep my distributed GRASS
version and just use the source to compile r.area?

Thanks,
Daniel
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5367915.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hello all,

I am trying to run a script in GRASS 7 (which was kindly written for me by Micha Silva for GRASS 6.4) which requires the g.ask module that I believe has been removed (http://trac.osgeo.org/grass/wiki/Grass7/NewFeatures). With what should I replace this this command?

Thanks in advance,
Rebecca


From: LeeDaniel Lee.Daniel.1986@gmail.com
To: grass-user@lists.osgeo.org
Sent: Tue, 3 August, 2010 12:37:33
Subject: [GRASS-user] Re: Installing r.area

Alright… I tried the following:
Lee@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.
Lee@pc19384:~> cd r.area/
Lee@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
main.c:19:23: schwerwiegender Fehler: grass/gis.h: Datei oder Verzeichnis
nicht gefunden
Kompilierung beendet.
make: *** [OBJ.i686-pc-linux-gnu/main.o] Fehler 1

Same error message, it doesn’t find what it’s looking for.

I looked at the error report and was a bit confused. Does this mean that
there’s no way around this other than compiling GRASS from source? Or is it
perhaps possible to download the GRASS source and keep my distributed GRASS
version and just use the source to compile r.area?

Thanks,
Daniel

View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-r-area-tp5340139p5367915.html
Sent from the Grass - Users mailing list archive at Nabble.com.


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