[GRASS-dev] undefined reference to G_alloc_matrix()
Yann Chemin
yann.chemin at gmail.com
Sun Aug 3 06:05:18 EDT 2008
I added the few lines of code of G_alloc_matrix() inside my code,
since otherwise it would indeed require the whole suite of advanced
math libraries
to be able to use it, and in this case I just needed a trusted Grass way to
allocate to images in memory for a small module (gipe/i.eb.h_SEBAL01).
I would go to move those G_alloc_(i)(f)matrix() to libgis somewhere,
as they dont particularly require anything to work.
2008/8/2 Glynn Clements <glynn at gclements.plus.com>:
>
> Glynn Clements wrote:
>
>> > I am trying to keep temporary files in DCELL **G_alloc_matrix(nrows,ncols)
>> >
>> > on compilation I get an undefined reference to that function...
>> >
>> > Checked in gis.h it is referring to gisdefs.h which has the definition.
>> > I just svn up on trunk with full distclean and full recompile, still same.
>>
>> Contrary to what you would naturally assume from the headers,
>> G_alloc_matrix() is actually in the gmath library, so you need to add
>> $(GMATHLIB) to LIBES.
>
> I'm wondering whether those functions (matrix/vector alloc/free)
> really belong in the gmath library. It can be quite a heavy
> dependency, optionally requiring FFTW, BLAS and LAPACK.
>
> The significance of this is that, if a user installs a binary GRASS
> package, and they don't have FFTW (or their version of FFTW is
> incompatible with the one used to build the gmath library), it won't
> just be the handful of programs which need FFTW which fail to work.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
--
Yann Chemin
International Rice Research Institute
Office: http://www.irri.org/gis
Perso: http://www.freewebs.com/ychemin
More information about the grass-dev
mailing list