This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: examples of Makefile and ODE for stiff equations, please..
Kenji Kadota <kadota@socrates.Berkeley.EDU> writes:
> 1. Example of Makefile for non-default path.
>
> Could you give me an example to compile/link a sample code ( especially
> example of Makefile if available) for the case when GSL is installed in
> non-default path.
This is my makefile, which is based on a gsl-installation in my
home-directory, apparently quite similar to what you have.
CC = gcc
GSL = /home/u4/hove/gsl/gsl
INCLUDE = $(GSL)/include
LIBPATH = $(GSL)/lib
LIBLIST = -lgsl -lm -lgslcblas
EXE = ising
OBJECTS = resample.o ising.o
CFLAGS = -O4
$(EXE): resample.o ising.o
$(CC) -o ising -L$(LIBPATH) resample.o ising.o $(LINKFLAGS) $(LIBLIST)
resample.o: resample.c resample.h
$(CC) $(CFLAGS) -c -I$(INCLUDE) resample.c
ising.o: ising.c resample.o
$(CC) $(CFLAGS) -c -I$(INCLUDE) ising.c
_Observe_:
1. Makefiles are quite picky about spaces/tabs - this will probably be
mixed up if you just cut and paste the message above.
2. This makefile is very verbose.
The file ising.c includes gsl header files as follows:
#include <gsl/gsl_rng.h>
> [...] doesn't work.)
Your chances of getting help on media like this will be much better if
you explain how it failes, and not just simply state "doesn't work".
>Moreover, I also have a problem in the command starting with
>'gsl-config'. It just says 'command not found' when I type, say,
>'gsl-config --libs'. It has to be typed only in specific directory?
Well - this really seems to be a Unix question. Only the executable
files located in your $PATH can be run from everywhere, otherwhise you
have to give full path explicitly. Judging from:
"gcc -I/home/ken/gnu/include/gsl -lgsl"
it seems to me that you have installed gsl with a
prefix=/home/ken/gnu, and in that case you should find 'gsl-config' in
"/home/ken/gnu/bin" - or you could try 'locate gsl-config' if yoy have
the locate program installed.
Good luck
Joakim
--
==== Joakim Hove www.phys.ntnu.no/~hove/ =======================
|| Institutt for fysikk (735) 93637 / E3-166 | Skøyensgate 10D ||
|| N - 7491 Trondheim hove@phys.ntnu.no | N - 7030 Trondheim ||
================================================= 73 93 31 68 =========