Test:

ftp://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz  success.

ftp://ftp.gnu.org/gnu/gsl/gsl-1.13.0.tar.gz  failed.

The GNU Scientific Library is an open source (GPL) library of useful routines for scientific and numerical computing. It will (should) build on ony system with an ANSI C compiler.

Using GSL on the department Linux machines
I did this istallation on atlas, which is running Linux on
Intel and has gcc installed. Results may (but shouldn't)
be different on one of the Sun machines like zeus.

download:

ftp://ftp.gnu.org/gnu/gsl/

wget ftp://ftp.gnu.org/gnu/gsl/gsl-1.7.tar.gz

the current version of GSL and place the file in
your home directory. This tutorial assumes version 1.7, so
change filenames as appropriate.
Unpack the file with the following command:

tar -zxvf gsl-1.7.tar.gz

This will create a directory called gsl-1.7 in your home directory. Change to this directory.

cd gsl-1.7

The next step is to configure the installation and tell the system where to install the files. I have a directory called "dev" in my home directory that I use for this sort of thing. These instructions will install the files in the directory /home/steve/dev.

First, create the dev directory.

mkdir /home/yourname/dev

Now configure the installation and tell it to use your new directory. This step may take a minute.

./configure --prefix=/home/yourname/dev

If there are no errors, compile the library. This step will take several minutes.

make

Now it is a good idea to test the library before actually installing it. Again, this step will take some time.

make check

If there are no errors, go ahead and install the library.

make install

Now we can write a test program to see if the library works. Create the following program and name it example.c

#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;
}

Compile and link the program with the following commands (but use the correct path for your username):

gcc -Wall -I/home/steve/dev/include -c example.c
gcc -L/home/steve/dev/lib example.o -lgsl -lgslcblas -lm

Now try running your program!

./a.out

You should get the following output:

J0(5) = -1.775967713143382920e-01

Now that you have the GSL installed, you can remove the gsl-1.7 directory that was created in your home directory.

====================================================

[root@centos gsl.1.13.0]# ./configure --prefix /root/.opam/4.00.1
make: gsl-config: Command not found
ocaml do_const.ml --mli > lib/const.mli
/bin/sh: gsl-config: command not found
Exception: End_of_file.
make: *** [post-conf] Error 2
E: Failure("Command 'make post-conf' terminated with error code 2")

How to install GSL on linux(ubuntu,centos,redhat)的更多相关文章

  1. linux(Ubuntu/Centos) iproute 路由IP地址等命令集合,查看端口链接

    原 linux(Ubuntu/Centos) iproute 路由IP地址等命令集合,查看端口链接 2017年03月20日 16:55:57 风来了- 阅读数:2291 标签: centoslinux ...

  2. ssh远程连接docker中linux(ubuntu/centos)

    ssh远程连接docker中linux(ubuntu/centos) https://www.jianshu.com/p/9e4d50ddc57e centos docker pull centos: ...

  3. Xrdp - 通过Windows的RDP连接Linux远程桌面(Ubuntu/CentOS/Redhat 7)

    Xrdp - 通过Windows的RDP连接Linux远程桌面(Ubuntu/CentOS/Redhat 7) 您多久访问一次Linux桌面? 您使用什么工具来访问远程桌面? Xrdp是一个开源工具, ...

  4. How to Check if Linux (Ubuntu, Fedora Redhat, CentOS) is 32-bit or 64-bit

    The number of CPU instruction sets has kept growing, and likewise for the operating systems which ar ...

  5. Xrdp - 通过Windows的RDP连接Linux远程桌面(Ubuntu/CentOS/Redhat 7)(转载)

            您多久访问一次Linux桌面? 您使用什么工具来访问远程桌面? Xrdp是一个开源工具,允许用户通过Windows RDP访问Linux远程桌面. 除了Windows RDP之外,xr ...

  6. Ubuntu/centos/redhat/SUSE sipp安装(带rtp支持,3.5.1版本)

    1.ubuntu 12.04 apt-get install ncurses-dev apt-get install libpcap-dev ./configure --with-pcap make ...

  7. Linux ubuntu centos 下 grep显示前后几行信息

    标准unix/linux下的grep通过下面参数控制上下文 grep -C 5 foo file 显示file文件里匹配foo字串那行以及上下5行grep -B 5 foo file 显示foo及前5 ...

  8. 如何解决linux(ubuntu/CENTOS)中gedit中文乱码的问题

    http://jingyan.baidu.com/article/1709ad80a443c54634c4f09c.html 同时按键盘的Alt 和 F2,就可以打开“运行程序”对话框,这个功能类似于 ...

  9. linux Ubuntu Centos 增加 TCP 连接数

    https://blog.csdn.net/c359719435/article/details/80300433 查看max conn: cat /proc/sys/net/core/somaxco ...

随机推荐

  1. IOS 四种保存数据的方式

    在iOS开发过程中,不管是做什么应用,都会碰到数据保存的问题.将数据保存到本地,能够让程序的运行更加流畅,不会出现让人厌恶的菊花形状,使得用户体验更好.下面介绍一下数据保存的方式: 1.NSKeyed ...

  2. 浏览器页面区域大小的js获取方法

    浏览器页面区域大小的获取:  /在IE.FireFox.Opera下都可以使用  document.body.clientWidth  document.body.clientHeight  //即可 ...

  3. delphi 仅带下划线的TEdit控件

    在做录入框的时候,很希望有一个只带下划线的文本框,网上介绍的很多,有自己做组件的,须不知Delphi下只需要简单设置几个属性即可达到目的.

  4. Ubuntu虚拟机与Window、Arm的通信

    Ubuntu虚拟机与Window的通信安装有Ubuntu14.04的虚拟机VMware,将虚拟机的网络适配器配置成NAT类型(默认使用VMnet8进行通信),此时将Ubuntu的IP地址设置成与VMn ...

  5. FPGA初学心得

    有三种方法在模块中产生逻辑:1.使用连续赋值语句“assign”:2.用实例元件 3.用“always”块.所以在always块中赋值不能使用assign,而是直接给变量赋值就行. reg与wire的 ...

  6. 【cheerio】nodejs的抓取页面模块

    http://baike.baidu.com/link?url=8V1CZsEzNE05ujOzISquom_pvFj16sWu1rRb8js11pmd9HNq7ePW_aKfG9oyXj6Txuu5 ...

  7. 【网络】 NAT

    NAT(Network Address Translation,网络地址转换)是1994年提出的.当在专用网内部的一些主机本来已经分配到了本地IP地址(即仅在本专用网内使用的专用地址),但现在又想和因 ...

  8. Lua基础之Function

    概述:1.定义和调用 2.多返回值3.可变参数 原文地址 http://blog.csdn.net/dingkun520wy/article/details/50275387 1.定义和调用 函数,在 ...

  9. 【BZOJ 1084】[SCOI2005]最大子矩阵

    Description 这里有一个n*m的矩阵,请你选出其中k个子矩阵,使得这个k个子矩阵分值之和最大.注意:选出的k个子矩阵不能相互重叠. Input 第一行为n,m,k(1≤n≤100,1≤m≤2 ...

  10. pageControl指示器和图片放大-b

    小编由于篇幅问题,截取了最后一篇,如果需要看其他的三篇文章,可以去笔者的简书看:http://www.jianshu.com/users/9f3739421d15/latest_articles 另外 ...