[GRASS-dev] undefined reference to G_alloc_matrix()

Markus Neteler neteler at osgeo.org
Sat Aug 2 10:06:26 EDT 2008


On Sat, Aug 2, 2008 at 4:03 PM, Glynn Clements <glynn at gclements.plus.com> wrote:
>
> 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.

In some cleanup activity we moved it to gmath. Later, gmath got enriched
with FFTW support and such.

It should possibly go back to libgis (in GRASS 7).

Markus


More information about the grass-dev mailing list