-
Notifications
You must be signed in to change notification settings - Fork 5
/
HOW_TO_INSTALL_GSL.rtf
115 lines (72 loc) · 2.43 KB
/
HOW_TO_INSTALL_GSL.rtf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
*************************
Installation Instructions for GSL use with Matlab
On Linux system
See end of file for MAC version
Aurelien Bustin (aurelien.bustin@ihu-liryc.fr)
*************************
Go in your home directory: type ‘cd’ wherever you are
In the following example, I use the directory abu17 but please replace it with your own directory
1) Download GSL
wget ftp://ftp.gnu.org/gnu/gsl/gsl-2.3.tar.gz
2) unpack the file with the following command:
tar -zxvf gsl-2.3.tar.gz
This will create a directory called gsl-2.3 in your home directory
3) Change to this directory:
cd gsl-2.3
4) Configure the installation:
mkdir /home/abu17/gsl
./configure —prefix=/home/abu17/gsl
5) If there are no errors, compile the library (This step will take several minutes)
make
6) Check and test the library before installing it
make check
7) If there are no errors, install the library
make install
8) Copy library in path:
sudo cp /home/abu17/gsl/lib/libgsl.a /usr/lib/
sudo cp /home/abu17/gsl/lib/libgsl.la /usr/lib/
sudo cp /home/abu17/gsl/lib/libgsl.so /usr/lib/
sudo cp /home/abu17/gsl/lib/libgsl.so.19 /usr/lib/
sudo cp /home/abu17/gsl/lib/libgsl.so.19.3.0 /usr/lib/
sudo cp /home/abu17/gsl/lib/libgslcblas.a /usr/lib/
sudo cp /home/abu17/gsl/lib/libgslcblas.la /usr/lib/
sudo cp /home/abu17/gsl/lib/libgslcblas.so /usr/lib/
sudo cp /home/abu17/gsl/lib/libgslcblas.so.0 /usr/lib/
sudo cp /home/abu17/gsl/lib/libgslcblas.so.0.0.0 /usr/lib/
9) Test the Library with the following example:
Create the file example.c containing the following lines:
#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>
int
main (void)
{
double x = 15.0;
double y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n”, x, y);
return 0;
}
10) Compile and link the program
gcc -Wall -I/home/abu17/gsl-2.3/ -c example.c
gcc -L/usr/lib/ example.o -lgsl -lgslcblas -lm
./a.out
************************************************
INSTALLATION ON MAC
************************************************
1) Install GSL:
brew install gsl
2) Test the Library with the following example:
Create the file example.c containing the following lines:
#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>
int
main (void)
{
double x = 15.0;
double y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n”, x, y);
return 0;
}
10) Compile and link the program
gcc -Wall -I/usr/local/include/gsl/ -c example.c
gcc -L/usr/lib/ example.o -lgsl -lgslcblas -lm
./a.out