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. SSO单点登陆

    一句话,就是能让各个不同的域名带回相同的认证信息即可.实现方法,就是把其中一个登陆后,把认证的信息分别保存在不同域名下的 cookie,当在验证是否登陆时,验证 cookie,如果是子域名,这个则直接 ...

  2. asp.net导出Excel 按照预定格式,以及解决导出乱码

    protected void ToExcel() { //新建一个Gridview,原因:避免当前窗口GridView外层没有直接跟form标签,从而避免“gridview1未包含在run='serv ...

  3. [DevExpress]ChartControl之基准线示例

    关键代码: /// <summary> /// 创建基准线ConstantLine /// </summary> /// <param name="chart& ...

  4. Demo学习: CustomException

    CustomException 捕获程序发生的异常. 1. 抛出各种异常 procedure TMainForm.UniButton1Click(Sender: TObject); begin PBy ...

  5. Spark Streaming揭秘 Day33 checkpoint的使用

    Spark Streaming揭秘 Day33 checkpoint的使用 今天谈下sparkstreaming中,另外一个至关重要的内容Checkpoint. 首先,我们会看下checkpoint的 ...

  6. Java 多线程 简单实例 (Thread)

    package second; public class A extends Thread { public void run(){ for(int i = 1;i <= 10 ; i++){ ...

  7. IOS设备滑动事件

    只要手指触摸屏幕,滑动,从屏幕离开,系统都会产生UIEvent对象类型的事件---当然包括UITouch事件 – touchesBegan:withEvent:   当用户触摸到屏幕时调用方法 – t ...

  8. 【bzoj3110】[Zjoi2013]K大数查询

    Description 有N个位置,M个操作.操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c如果是2 a b c形式,表示询问从第a个位置到第b个位置 ...

  9. MyBatis学习笔记之resultMap

    使用mybatis不能不说的是resultMap 相比resultClass来说resultMap可以适应更复杂的关系映射,允许指定字段的数据类型,支持“select *” ,并不要求定义 Resul ...

  10. python中变量

    在Python中,变量的概念基本上和初中代数的方程变量是一致的. 例如,对于方程式 y=x*x ,x就是变量.当x=2时,计算结果是4,当x=5时,计算结果是25. 只是在计算机程序中,变量不仅可以是 ...