[GRASS-user] compiling an addon in grass 7

Hi!

I would like to install r.refine addon in grass 7. I have the c/c++ code of r.refine and I installed grass 7 and grass-dev. When I compile it keeps giving me error about grass-src directory. I searched my ubuntu folders and I did not find anything like that. Looks like I need entire source not just header files to compile. I will try tomorrow but I am just wondering why should an addon require entire source to compile? Is it badly written addon or am i missing something?

Thanks
Shashank

Did you install grass-dev on your machine.
It will need it to compile the add-ons.

Try installing grass-dev as below;

> sudo apt-get install grass-dev

best

Venka

On 2015/05/31 14:28, skhare@hotmail.com wrote:

Hi!
    
      I would like to install r.refine addon in grass 7. I have the c/c++ code of r.refine and I installed grass 7 and grass-dev. When I compile it keeps giving me error about grass-src directory. I searched my ubuntu folders and I did not find anything like that. Looks like I need entire source not just header files to compile. I will try tomorrow but I am just wondering why should an addon require entire source to compile? Is it badly written addon or am i missing something?
    
      Thanks
      Shashank

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

On Sun, May 31, 2015 at 7:28 AM, <skhare@hotmail.com> wrote:

Hi!

I would like to install r.refine addon in grass 7. I have the c/c++ code of
r.refine and I installed grass 7 and grass-dev.

Quick question: Is r.refine online available (for testing)? Do you refer to
https://github.com/jontodd/r.refine
?

It appears to be written for an older GRASS GIS version.

When I compile it keeps giving me error about grass-src directory.

You can compile like this (example for path) as on my machine:

make MODULE_TOPDIR=$HOME/software/grass70

Indeed, you need to have the compiled GRASS GIS source code available for that.
As Venka wrote:

sudo apt-get install grass-dev

will get the source code onto your computer.

However, the r.refine version needs to be GRASS GIS 7 ready, otherwise
it won't compile.

Best
Markus

I downloaded the source from https://github.com/jontodd/r.refine. I am willing to port it to grass 7 if i get help. I guess the author is not supporting it since there is no commit after 2006. This is my first project on Grass. Is there any tutorial/documentation on how to to write addons for grass 7? I developed a plugin for qgis and its really easy with so much documentation available online. I wish it were the case with Grass. But nonetheless I want to give Grass a serious try.

Will try with compiled source code today. When i installed grass-dev I do not see the source code of grass on my system. Which dir does it go to?

Thanks
Shashank

----------------------------------------

From: neteler@osgeo.org
Date: Sun, 31 May 2015 14:03:10 +0200
Subject: Re: [GRASS-user] compiling an addon in grass 7
To: skhare@hotmail.com
CC: grass-user@lists.osgeo.org

On Sun, May 31, 2015 at 7:28 AM, <skhare@hotmail.com> wrote:

Hi!

I would like to install r.refine addon in grass 7. I have the c/c++ code of
r.refine and I installed grass 7 and grass-dev.

Quick question: Is r.refine online available (for testing)? Do you refer to
https://github.com/jontodd/r.refine
?

It appears to be written for an older GRASS GIS version.

When I compile it keeps giving me error about grass-src directory.

You can compile like this (example for path) as on my machine:

make MODULE_TOPDIR=$HOME/software/grass70

Indeed, you need to have the compiled GRASS GIS source code available for that.
As Venka wrote:

sudo apt-get install grass-dev

will get the source code onto your computer.

However, the r.refine version needs to be GRASS GIS 7 ready, otherwise
it won't compile.

Best
Markus
                 

On Sun, May 31, 2015 at 5:56 PM, shashank khare <skhare@hotmail.com> wrote:

I downloaded the source from https://github.com/jontodd/r.refine. I am willing to port it to grass 7 if i get help.

Great!

I guess the author is not supporting it since there is no commit after 2006. This is my first project on Grass. Is there any tutorial/documentation on how to to write addons for grass 7?

Yes, sure. It is written like any other GRASS GIS module.

I developed a plugin for qgis and its really easy with so much documentation available online. I wish it were the case with Grass. But nonetheless I want to give Grass a serious try.

Please let us know where you looked for it and didn't find it - I
would like to improve the documentation.
A good chance to make it better!

Will try with compiled source code today. When i installed grass-dev I do not see the source code of grass on my system. Which dir does it go to?

This depends on the package/distro. You can use your package manager
(apt-get or aptitude in your case) to see where the files of the
"grass-dev" package are on your machine.

HTH
Markus

I tried compiling r.refine with grass 7 but gcc could not find definition of Site_head struct. I looked into it and figured out that grass/site.h is missing. Where has it gone? I even downloaded the entire source code of 7.0.0 but even that does not have any file which contains definition of Site_head struct. Can someone enlighten me regarding “site” data structure. I believe site is a way of storing point type data.

Thanks in advance.
Shashank

From: neteler@osgeo.org
Date: Sun, 31 May 2015 21:37:06 +0200
Subject: Re: [GRASS-user] compiling an addon in grass 7
To: skhare@hotmail.com
CC: grass-user@lists.osgeo.org

On Sun, May 31, 2015 at 5:56 PM, shashank khare skhare@hotmail.com wrote:

I downloaded the source from https://github.com/jontodd/r.refine. I am willing to port it to grass 7 if i get help.

Great!

I guess the author is not supporting it since there is no commit after 2006. This is my first project on Grass. Is there any tutorial/documentation on how to to write addons for grass 7?

Yes, sure. It is written like any other GRASS GIS module.

I developed a plugin for qgis and its really easy with so much documentation available online. I wish it were the case with Grass. But nonetheless I want to give Grass a serious try.

Please let us know where you looked for it and didn’t find it - I
would like to improve the documentation.
A good chance to make it better!

Will try with compiled source code today. When i installed grass-dev I do not see the source code of grass on my system. Which dir does it go to?

This depends on the package/distro. You can use your package manager
(apt-get or aptitude in your case) to see where the files of the
“grass-dev” package are on your machine.

HTH
Markus

On Tue, Jun 2, 2015 at 1:35 PM, shashank khare <skhare@hotmail.com> wrote:

I tried compiling r.refine with grass 7 but gcc could not find definition of
Site_head struct. I looked into it and figured out that grass/site.h is
missing. Where has it gone?

It has been eliminated many years back in the update to GRASS GIS 7
(or even 6, don't remember).

I even downloaded the entire source code of
7.0.0 but even that does not have any file which contains definition of
Site_head struct. Can someone enlighten me regarding "site" data structure.
I believe site is a way of storing point type data.

Nowadays the vector library is used for that:

http://grass.osgeo.org/programming7/vectorlib.html

You may want to look at the source code of point related modules (see
keyword index of manual).

Markus

On Tue, Jun 2, 2015 at 8:05 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Tue, Jun 2, 2015 at 1:35 PM, shashank khare <skhare@hotmail.com> wrote:
> I tried compiling r.refine with grass 7 but gcc could not find
definition of
> Site_head struct. I looked into it and figured out that grass/site.h is
> missing. Where has it gone?

It has been eliminated many years back in the update to GRASS GIS 7
(or even 6, don't remember).

Actually quite recently:
https://trac.osgeo.org/grass/ticket/2440

> I even downloaded the entire source code of
> 7.0.0 but even that does not have any file which contains definition of
> Site_head struct. Can someone enlighten me regarding "site" data
structure.
> I believe site is a way of storing point type data.

Nowadays the vector library is used for that:

http://grass.osgeo.org/programming7/vectorlib.html

You may want to look at the source code of point related modules (see
keyword index of manual).

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

On Tue, Jun 2, 2015 at 3:23 PM, Anna Petrášová <kratochanna@gmail.com> wrote:

On Tue, Jun 2, 2015 at 8:05 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Tue, Jun 2, 2015 at 1:35 PM, shashank khare <skhare@hotmail.com> wrote:
> I tried compiling r.refine with grass 7 but gcc could not find
> definition of
> Site_head struct. I looked into it and figured out that grass/site.h is
> missing. Where has it gone?

It has been eliminated many years back in the update to GRASS GIS 7
(or even 6, don't remember).

Actually quite recently:
https://trac.osgeo.org/grass/ticket/2440

Well, this is only the aftermath... The real updates from the sites to
the vector library happened way longer ago.

Markus