GSL on SWEETGUM
GSL 1.7 released on September 14th was installed on Sweetgum (IRIX6.5) on Jan 04/2006.
It was compiled using gcc version 3.3. The libraries have been built as dynamic link libraries and are located in:
/usr/local/appl/lib, while the GSL header files are located in /usr/local/appl/include/gsl.
A tool to help in compilation and running of applications using GSL "gsltool" is located in /usr/local/appl/bin
Instructions for Compiling and Linking:
GSL on SWEETGUM - Compiling and Linking manually
Consider the following sample C code "test.c" to test the GSL library
#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;
}
To Compile:
gcc -I/usr/local/appl/include -Wall -mips4 -mabi=64 -c test.c
To Link:
/usr/local/appl/bin/gsltool --mode=link gcc -mips4 -mabi=64 -L/usr/local/appl/lib -lgsl -lgslcblas -lm -o test test.o
Running "test" should give the output:
J0(5) = -1.775967713143382920e-01
GSL on SWEETGUM - Compiling and Linking with a Make file
Alternatively you could use a Makefile such as the following to do the job:
GSLLIBS = -L/usr/local/lib -L/usr/local/appl/lib -lgsl -lgslcblas -lm
GSLINCS = -I/usr/local/appl/include
# space seperated list of source files in program
SOURCES = test.c
COMPILER = gcc -Wall -mips4 -mabi=64 -c
LINKER = gsltool --mode=link gcc -Wall -mips4 -mabi=64 -o
# change 'test' to the name you wish your
# executable program to be
all:test
test.o: $(SOURCES)
$(COMPILER) $(GSLINCS) $(SOURCES)
# space seperated list of object files in program
OBJS = test.o
test: $(OBJS)
$(LINKER) $@ $(GSLINCS) $(GSLLIBS) $(OBJS)
clean:
rm -f test test.o
NOTE:
- Make sure the tab spaces are set appropriately below clean, test and test.o. "make" is very fussy about the tab spaces.
- Additional source files if present can also be added making suitable required changes.
|