[GRASS-dev] [i.spec.unmix]- Compiling spec.unmix to GRASS6.4

Soeren Gebbert soerengebbert at googlemail.com
Thu Dec 10 07:34:29 EST 2009


Hello António,
you need to compile la.c. But la.c depends on blas and lapack:
la.c line 36
#if defined(HAVE_LIBLAPACK) && defined(HAVE_LIBBLAS) && defined(HAVE_G2C_H)

Additionally the Fortran to C header file g2c.h must be present.
AFAICT there where problems compiling Fortran to C support with gcc4,
but i do not remember correctly.

If la.c is not compiled your get undefined reference errors.

To avoid this you can install the lapack and blas libraries (i have no
clue how to do this on windows), or you can use
the native blas level 1,2 and 3 function in grass 6.5 and grass 7:

http://download.osgeo.org/grass/grass6_progman/blas__level__1_8c.html
http://download.osgeo.org/grass/grass6_progman/blas__level__2_8c.html
http://download.osgeo.org/grass/grass6_progman/blas__level__3_8c.html

The memory allocation is different from the la.c version:
http://download.osgeo.org/grass/grass6_progman/dalloc_8c.html
http://download.osgeo.org/grass/grass6_progman/ialloc_8c.html
http://download.osgeo.org/grass/grass6_progman/sparse__matrix_8c.html

There are several linear equation solver and eigenvalue solver
available in grass,
which are independent from lapack:
http://download.osgeo.org/grass/grass6_progman/ccmath__grass__wrapper_8c.html
http://download.osgeo.org/grass/grass6_progman/solvers__krylov_8c.html
http://download.osgeo.org/grass/grass6_progman/solvers__direct_8c.html

IMHO replacing the lapack dependent functions with the native grass versions
in i.spec.unmix should be preferred.

Best regards
Soeren

2009/12/10 António Rocha <antonio.rocha at deimos.com.pt>:
> Greetings all
>
> A couple of weeks ago I sent an email regarding i.spec.unmix compilation for
> GRASS 6.4.
> I analyzed the question a bit more and:
>
> 1- I included #include <grass/la.h>  at global.h and main.c. I suppose that
> this files are compiled in WinGRASS64 binaries. Am I wrong?
>
> 2- While compiling i.spec.unmix I got this error from main.c and open.c:
> /undefined reference to `G_matrix_init'
> undefined reference to `G_matrix_get_element'
> undefined reference to `G_matrix_set_element'
> undefined reference to `G_matrix_transpose'
> undefined reference to `G_matrix_free'
> undefined reference to `G_matrix_read'
> undefined reference to `G_matvect_get_column'
> undefined reference to `G_vector_norm_maxval'
> undefined reference to `G_vector_free'
> undefined reference to `G_vector_init'
> undefined reference to `G_vector_sub'
> undefined reference to `G_vector_norm_euclid'
> undefined reference to `G_vector_copy'
> undefined reference to `G_vector_product'
> undefined reference to `G_vector_norm1'
>
>
> /These functions are defined in la.c and la.h. Since I included la.h in
> header file, I want to know what is not "right" because compiler is not
> recognizing these functions?
>
> Thanks
>
> Best regards,
> Antonio Rocha
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature
> database 4675 (20091210) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>


More information about the grass-dev mailing list