bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undefined reference to `gsl_spmatrix_uchar_norm1'


From: Patrick Alken
Subject: Re: Undefined reference to `gsl_spmatrix_uchar_norm1'
Date: Fri, 25 Jun 2021 12:46:49 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Hello,

  Unsigned versions of this function were excluded (uchar, uint, ushort), because there is the possibility of adding two large uchar values together during the 1-norm calculation and ending up with a smaller value due to it wrapping back to 0. This didn't make much sense to me when I wrote the function, so I excluded the unsigned versions.

Do you think it makes sense to have a uchar_norm1 function?

Patrick

On 6/25/21 11:45 AM, Håkon Hægland wrote:
I am on Ubuntu 21.04, using GSL 2.7. Here is my test program norm.c :


#include <stdio.h>
#include <gsl/gsl_spmatrix.h>
int
main()
{
     gsl_spmatrix_uchar *A = gsl_spmatrix_uchar_alloc(2, 2);

     gsl_spmatrix_uchar_set(A, 0, 0, 1);
     gsl_spmatrix_uchar_set(A, 0, 1, 2);
     gsl_spmatrix_uchar_set(A, 1, 0, 3);
     gsl_spmatrix_uchar_set(A, 1, 1, 4);

     double norm = gsl_spmatrix_uchar_norm1(A);
     printf("norm = %g\n", norm);
     gsl_spmatrix_uchar_free(A);

     return 0;
}

When I compile this I get an error message from the linker:

$ gcc -Wall -I/opt/gsl/gsl-2.7/include -c norm.c
$ gcc -L/opt/gsl/gsl-2.7/lib -o norm norm.o -lgsl -lgslcblas -lm
/bin/ld: norm.o: in function `main':
norm.c:(.text+0x93): undefined reference to `gsl_spmatrix_uchar_norm1'
collect2: error: ld returned 1 exit status

Best regards,
Håkon Hægland



reply via email to

[Prev in Thread] Current Thread [Next in Thread]