This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: to compile a simple program with gsl
- From: Achim Gaedke <achim at zpr dot uni-koeln dot de>
- To: Mael Guillemot <Mael dot Guillemot at idiap dot ch>, gsl discussion list <gsl-discuss at sources dot redhat dot com>
- Date: Mon, 18 Mar 2002 13:27:18 +0100 (MET)
- Subject: Re: to compile a simple program with gsl
- Reply-to: Achim Gaedke <achim at zpr dot uni-koeln dot de>
achim@Sparcy02> gcc -c -I/zpr/gnu/include/gsl demo.c
This caueses errors, just because the gsl headers themself use
include-paths like gsl/gsl_math.h, that can't be found.
Please use #include <gsl/gsl_*.h> ,too.
The command
achim@Sparcy02> gsl-config --cflags
-I/zpr/gnu/include
gives you the flags for compiling gsl-programs:
achim@Sparcy02> gcc -c -I/zpr/gnu/include demo.c
results in demo.o
The same procedure for linking:
achim@Sparcy02> gsl-config --libs
-L/zpr/gnu/lib -lgsl -lgslcblas -lm
achim@Sparcy02> gcc -o demo demo.o -L/zpr/gnu/lib -lgsl -lgslcblas -lm
achim@Sparcy02> ./demo
6 3 6 3 4 7 4 6 4 3
I think, this is the full truth.
Achim Gaedke, ZPR
Weyertal 80, 50931 Köln
Tel: +49 221 470 6021
On Mon, 11 Mar 2002, Mael Guillemot wrote:
> Thanks for felping me:
>
> I have the latest version of gsl: gsl-1.1 downloaded from
> http://sources.redhat.com/gsl
>
> At the beggining of the tutorial for compiling and linking, they speak
> directly about linking without any indication of compiling.
>
> Could you show me how do you compile a program who use gsl ?
>
> Thank you,
>
> Mael
>
>
>