public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* stupid question
@ 2001-12-19 13:20 Matthew J. Doller
  2001-11-19 10:26 ` Matthew J. Doller
  2001-12-19 13:20 ` Achim Gaedke
  0 siblings, 2 replies; 8+ messages in thread
From: Matthew J. Doller @ 2001-12-19 13:20 UTC (permalink / raw)
  To: gsl-discuss

can someone shed a tiny bit of light on why this seemingly simple
routine is not compiling for me?

--- BEGIN CODE ---

#include "matrix-generic.h"
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>

gsl_matrix * matrix_return_upper ( gsl_matrix *m ){
  
  int num_rows, num_cols, error;

  num_rows = m->size1;
  num_cols = m->size2;

  gsl_matrix * return_matrix = gsl_matrix_alloc ( num_rows , num_cols );

  ...
  ...
  
  return (gsl_matrix *) return_matrix;
}

--- END CODE ---


compile command: 
gcc -o mytest matrix-generic.c -lgsl -lgslcblas -lm

compile errors:
matrix-generic.c: In function `matrix_return_upper':
matrix-generic.c:30: parse error before `*'

the * in question is from the line:
gsl_matrix * return_matrix = gsl_matrix_alloc ( num_rows , num_cols );


for now, i have stripped out all the rest of the code after that line to
simplify debugging.  please tell me that i'm over looking something
simple.

thanks in advance
matt


-- 
Matthew J. Doller 
mdoller@wpi.edu
http://www.wpi.edu/~mdoller

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Stupid question...
@ 2009-10-11 13:52 Robert G. Brown
  2009-10-11 14:06 ` Robert G. Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Robert G. Brown @ 2009-10-11 13:52 UTC (permalink / raw)
  To: GSL Discussion list

I'm trying to get gsl to be correctly detected in a configure.ac
(something that has never quite worked, for reasons I don't understand).

The following lines are what I've got.  I don't quite understand either
why the gsl check fails or why the gslcblas succeeds.  I've tried lots
of different functions (including [main]) in the gsl check, but they all
return no.  I've tried including an argument such as gsl_sf_gamma(1.0),
no go.  Is there a simple one liner solution to this somebody could
contribute, or is somebody enough of an expert with autoconf that they
can tell me why this works/doesn't work?

#==================================================================
# Checks for libraries, and headers.
#==================================================================
AC_CHECK_HEADER([gsl/gsl_sf_gamma.h],,[AC_MSG_ERROR([Couldn't find GSL headers! Please install gsl-devel.])])
AC_CHECK_LIB([gsl],[gsl_sf_gamma])
# FIXME: Replace `main' with a function in `-lgslcblas':
AC_CHECK_LIB([gslcblas], [main])


checking gsl/gsl_sf_gamma.h usability... yes
checking gsl/gsl_sf_gamma.h presence... yes
checking for gsl/gsl_sf_gamma.h... yes
checking for gsl_sf_gamma in -lgsl... no
checking for main in -lgslcblas... yes


TIA,

    rgb

Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb@phy.duke.edu


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-10-11 17:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19 13:20 stupid question Matthew J. Doller
2001-11-19 10:26 ` Matthew J. Doller
2001-12-19 13:20 ` Achim Gaedke
2001-11-20  2:00   ` Achim Gaedke
2009-10-11 13:52 Stupid question Robert G. Brown
2009-10-11 14:06 ` Robert G. Brown
2009-10-11 16:49 ` John D Lamb
2009-10-11 17:42 ` Andrew W. Steiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).