How to install GSL on linux(ubuntu,centos,redhat)
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)的更多相关文章
- linux(Ubuntu/Centos) iproute 路由IP地址等命令集合,查看端口链接
原 linux(Ubuntu/Centos) iproute 路由IP地址等命令集合,查看端口链接 2017年03月20日 16:55:57 风来了- 阅读数:2291 标签: centoslinux ...
- ssh远程连接docker中linux(ubuntu/centos)
ssh远程连接docker中linux(ubuntu/centos) https://www.jianshu.com/p/9e4d50ddc57e centos docker pull centos: ...
- Xrdp - 通过Windows的RDP连接Linux远程桌面(Ubuntu/CentOS/Redhat 7)
Xrdp - 通过Windows的RDP连接Linux远程桌面(Ubuntu/CentOS/Redhat 7) 您多久访问一次Linux桌面? 您使用什么工具来访问远程桌面? Xrdp是一个开源工具, ...
- 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 ...
- Xrdp - 通过Windows的RDP连接Linux远程桌面(Ubuntu/CentOS/Redhat 7)(转载)
您多久访问一次Linux桌面? 您使用什么工具来访问远程桌面? Xrdp是一个开源工具,允许用户通过Windows RDP访问Linux远程桌面. 除了Windows RDP之外,xr ...
- 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 ...
- Linux ubuntu centos 下 grep显示前后几行信息
标准unix/linux下的grep通过下面参数控制上下文 grep -C 5 foo file 显示file文件里匹配foo字串那行以及上下5行grep -B 5 foo file 显示foo及前5 ...
- 如何解决linux(ubuntu/CENTOS)中gedit中文乱码的问题
http://jingyan.baidu.com/article/1709ad80a443c54634c4f09c.html 同时按键盘的Alt 和 F2,就可以打开“运行程序”对话框,这个功能类似于 ...
- linux Ubuntu Centos 增加 TCP 连接数
https://blog.csdn.net/c359719435/article/details/80300433 查看max conn: cat /proc/sys/net/core/somaxco ...
随机推荐
- JQ批量控制form禁用
<script type="text/javascript" src="http://www.joy-city.com.cn/templets/default/sc ...
- CSS3.0动画之hover---Y轴----3D旋转
div#div2{display: table; width: 100%; height: 100%; text-decoration: none; outline: none; -webkit-tr ...
- php总结:1.php介绍
1.什么是php PHP,即“Hypertext Preprocessor”,是一种被广泛应用的开源通用脚本语言,尤其适用于 Web 开发并可嵌入 HTML 中去.它的语法利用了 C.Java 和 P ...
- Spark小课堂Week3 FirstSparkApp(Dataframe开发)
Spark小课堂Week3 FirstSparkApp(代码优化) RDD代码简化 对于昨天练习的代码,我们可以从几个方面来简化: 使用fluent风格写法,可以减少对于中间变量的定义. 使用lamb ...
- 概念:RPG与RPGLE的区别
RPG是OPM编程模式,即RPG编程的代码不能编译成*MODULE:编译只能直接生成一个程序,*PGM. RPGLE是ILE编程模式.OS/400环境下,ILE是集成开发环境.在ILE环境下,所 ...
- 解决rhel相关系统下yum找不到安装包的解决方法
最近重新安装了Linux,用的版本是CentOS 5.1.但老是出现很多包找不到的情况. [root@toughhou /]# yum install rlwrap Loaded plugins: f ...
- Oracle分区表做跨分区查询
问:有一张大表,其中按时间字段(TIME_ID)进行表分区(按季度分区),但是如果业务人员做跨季度的大批量数据的查询时,未能走TIME_ID分区索引,导致全表扫描.此种情况该如何处理? 示例解析: 1 ...
- (转)《深入理解java虚拟机》学习笔记5——Java Class类文件结构
Java语言从诞生之时就宣称一次编写,到处运行的跨平台特性,其实现原理是源码文件并没有直接编译成机器指令,而是编译成Java虚拟机可以识别和运行的字节码文件(Class类文件,*.class),字节码 ...
- 4、WPF应用程序的启动
启动第一步: 启动第二步 启动第三步:
- Linux内核树的建立-基于ubuntu系统
刚看 O'REILLY 写的<LINUX 设备驱动程序>时.作者一再强调在编写驱动程序时必须 建立内核树.先前的内核只需要有一套内核头文件就够了,但因为2.6的内核模块吆喝内核源码树中的目 ...