help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] unable to compile program with gsl in a MAC OS X


From: Jochen Küpper
Subject: Re: [Help-gsl] unable to compile program with gsl in a MAC OS X
Date: Fri, 17 Oct 2008 15:14:46 -0700

On 17.10.2008, at 11:59, Luis Borda de Agua wrote:

I installed gsl using mac ports. unfortunately when I tried to run one of your examples, it didn't work. Here are the details:

- gsl version 1.11

- Mac OS X 10.5.5 (Leopard); processor 2.5 GHz intel Core 2 Duo

- gcc (lrwxr-xr-x 1 root wheel 7 Mar 14 2008 gcc - > gcc-4.0)

This was the program I used (one of your examples):

#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>

int
main (void)
{
    double x = 5.0;
    double y = gsl_sf_bessel_J0 (x);
    printf ("J0(%g) = %.18e\n", x, y);
    return 0;
}

- This is how I try to compile it

$ gcc -Wall -I/usr/local/include  asd.c

most likely GSL i installed in /opt/local (MacPorts standard)

Then you have to add -I/opt/local/include -L/opt/local/lib -lgsl - lgslcblas to your command...



("asd.c" being the name of file with the code)

- This was the error message:

Undefined symbols:
"_gsl_sf_bessel_J0", referenced from:
   _main in ccnvBbbv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

__________

I realize that mac ports in fact installed the gsd in the directory / opt/local/include
so I also tried

$ gcc -Wall -I/opt/local/include  asd.c

but I got exactly the same error message. I then moved the gsl library to /usr/local/include
and I got the error message described above.

I would appreciate if someone could help me with this.
Yours,

Luís Borda de Água
Dept. of Ecology and Evolutionary Biology
621 Charles E. Young Drive
University of California
LOS ANGELES CA 90095
Phone: +1 (310) 206 2801
Fax: +1 (310) 206 3907
____________________________________
Luís Borda de Água
Dept. of Ecology and Evolutionary Biology
621 Charles E. Young Drive
University of California
LOS ANGELES CA 90095
Phone: +1 (310) 206 2801
Fax: +1 (310) 206 3907







_______________________________________________
Help-gsl mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-gsl

Greetings,
Jochen
--
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        Sex, drugs and rock-n-roll


Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

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