1. Uninstalling lower versions of GSL
Check whether a lower version of GSL is installed as follows,
Figure 1. Checking installed version |
Figure 2. Uninstalling GSL of lower versions |
2. Downloading GSL 1.16 source files
Download archive file gsl-1.16.tar.gz from GNU's GSL directory.
3. Extracting source files
Open a terminal and change directory to where the downloaded file exists. As root, extract files as follows.
Figure 3. Extracting source files |
4. Compiling and installing
Compile GSL 1.16 sources and install as follows.
Figure 4. Compiling and installing |
5. Registering GSL shared libraries for dynamic linking
As we specified as one of configure options, '--prefix=/usr/local/gsl-1.16' (see Figure 2), installed GSL libraries reside in /usr/local/gsl-1.16/lib, which is not included in ld's lookup path. Force ld to include the path by adding a file in '/etc/ld.so.conf.d' as follows.
Figure 5. Registering shared libraries - 1 |
Insert a line into the file.
Figure 6. Registering shared libraries - 2 |
Call 'ldconfig', and check if GSL libraries are loaded.
Figure 7. Registering shared libraries - 3 |
6. Using GSL
When developing, if you want to compile a source which utilizing GSL libraries, you need to specify the paths of GSL headers and libraries as compile options. For example, see Figure 8.
※ Makefile sample
Figure 8. Include and library path options |
댓글 없음:
댓글 쓰기