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. js 的数据类型转换

    一直对js的类型转换一直半解,今天理一下思路,首先说一下几个特殊的数值 null null是特殊的object,故 typeof null 返回object, null派生于undefined ,故 ...

  2. C#委托的异步调用

    本文将主要通过“同步调用”.“异步调用”.“异步回调”三个示例来讲解在用委托执行同一个“加法类”的时候的的区别和利弊. 首先,通过代码定义一个委托和下面三个示例将要调用的方法: /*添加的命名空间 u ...

  3. Sublime Text 3 入门(插件控制台安装)

    下载地址:http://www.sublimetext.com/3 以windows 32位系统为例 直接点击Windows下载: Package Control插件控制台(有这个才可以安装插件) h ...

  4. discuz X3.2邮箱非必填

    最近有个需求是:邮箱非必答,但是X3.2是邮箱必填: 找到资料:http://www.51php.com/discuz/17147.html 但是修改后不起作用!提示‘Email 地址无效’! 用fi ...

  5. php入门变量之数字

    在介绍变量时,我明确指出PHP具有整型和浮点型(小数)数字类型.但是,依据我的经验,这两种类型都可以归类到一般的数字之下(在极大程度上是这样的). 下面列举下PHP中有效的数字类型的变量: 8 3.1 ...

  6. 【git】借助github学习成果

    1.创建分支 git branch dev   //创建分支 git checkout dev  //切换分支 或者用一句  git checkout -b dev 删除一个分支  git check ...

  7. [译] ASP.NET 生命周期 – ASP.NET 上下文对象(八)

    使用 HttpResponse 对象 HttpResponse 对象是与 HttpRequest 对象相对应的,用来表示构建中的响应.它当中提供了方法和属性可供我们自定义响应,有一些在使用 MVC 视 ...

  8. UIView局部点击(转)

      今天上班遇到一种情况,需要局部响应点击事件,比如在一个UIImageView中设置一个小圆圈图片,要求点击圆圈里面不响应点击,点击小圆圈外面的部分响应点击.可以通过重写hitTest:withEv ...

  9. 基于Python+协程+多进程的通用弱密码扫描器

    听说不想扯淡的程序猿,不是一只好猿.所以今天来扯扯淡,不贴代码,只讲设计思想. 0x00 起 - 初始设计 我们的目标是设计一枚通用的弱密码扫描器,基本功能是针对不同类型的弱密码,可方便的扩展,比如添 ...

  10. EF4.1之覆盖EF的默认的约定

    覆盖EF默认的约定可以通过两种方式: 1.拦截模型构建器,使用流畅的API 2.通过给 类添加标签 好的,我还用之前定义的订单类来做例子: public class Order { public in ...