GSL(GNU Scientific Library)作为三大科学计算库之一,除了涵盖基本的线性代数,微分方程,积分,随机数,组合数,方程求根,多项式求根,排序等,还有模拟退火,快速傅里叶变换,小波,插值,基本样条,最小二乘拟合,特殊函数等。下面介绍一下GSL的安装和使用。

方法一:

首先从官网下载到源代码(我用的版本是 gsl-1.9)压缩包,解压后进入目录,执行

./configure
make
make install

这个过程需要几分钟。这里还有一点需要注意的是,执行 make install 时,会自动将动态库和头文件分别拷贝到/usr/local/lib和 /usr/local/include 下面,但如果这两个目录没有写权限,就无法创建此二目录,导致安装失败,此时改用 ‘sudo make install’或者手动去赋予权限,便能解决此问题。

安装就此完成,下面来跑官网上的这个样例

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

编译之(假设该文件存为 test.c):

gcc test.c -lgsl -lgslcblas   test.c -o test

输出了可执行文件 test .

方法二:

GSL源码包提供了以下二进制包:

  • gsl-bin:GNU Scientific Library (GSL) -- binary package
  • libgsl0-dbg: GNU Scientific Library (GSL) -- debug symbols package
  • libgsl0-dev: GNU Scientific Library (GSL) -- development package
  • libgsl0ldbl: GNU Scientific Library (GSL) -- library package

终端键入以下命令即可安装:

sudo apt-get install libgsl0ldbl

说明:根据不同的需要选择安装不同的版本,使用 gsl-bin 将会安装所有的内容(gsl - bin 依赖 libgsl0ldbl

GSL 的更多例程用法,参考官方指导手册, 更深入的了解还可以参考GSL设计文档

ubuntu14.04 下安装 gsl 科学计算库的更多相关文章

  1. Ubuntu14.04下安装Hadoop2.5.1 (单机模式)

    本文地址:http://www.cnblogs.com/archimedes/p/hadoop-standalone-mode.html,转载请注明源地址. 欢迎关注我的个人博客:www.wuyudo ...

  2. 二、Ubuntu14.04下安装Hadoop2.4.0 (伪分布模式)

    在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置 一.配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml ...

  3. Ubuntu14.04下安装Flash Player

    Ubuntu14.04下安装Flash Player youhaidong@youhaidong:~$ sudo apt-get install flashplugin-nonfree [sudo] ...

  4. Ubuntu14.04下 安装p4c

    参考: Github p4c README Ubuntu14.04下 安装p4c 这里提供一个直接安装p4c的脚本:install_p4c.sh. 1.git clone下来p4c: $ git cl ...

  5. Ubuntu14.04下安装Libsvm,并使用Libsvm

    (1)Ubuntu14.04下安装Libsvm 转载:https://blog.csdn.net/katrinawj/article/details/78915874 一.下载: 网址:http:// ...

  6. ubuntu14.04下安装ffmpeg

    ubuntu14.04下安装ffmpeg 一.安装各种依赖包 1.yasm(libx264需要依赖yasm) sudo apt-get install yasm 2.libx264 sudo apt- ...

  7. ubuntu14.04下安装cudnn5.1.3,opencv3.0,编译caffe及配置matlab和python接口过程记录

    已有条件: ubuntu14.04+cuda7.5+anaconda2(即python2.7)+matlabR2014a 上述已经装好了,开始搭建caffe环境. 1. 装cudnn5.1.3,参照: ...

  8. 在Ubuntu14.04下安装Docker CE(1) - repository篇

    从2017年3月开始,Docker开始分为社区版本和企业版,也就是Docker CE和Docker EE, 原来Ubuntu14.04下,通过sudo apt-get install docker.i ...

  9. ubuntu14.04下安装爬虫工具scrapy

    scrapy是目前准备要学习的爬虫框架,其在ubuntu14.04下的安装过程如下: ubuntu14.04下默认安装了2.7的python以及setuptools,若未安装,可通过下面指令安装: s ...

随机推荐

  1. importlib 模块

    根据字符串的模块名实现动态导入模块的库 目录结构 ├── aaa.py ├── bbb.py └── mypackage ├── __init__.py └── xxx.py bbb.py impor ...

  2. Java 8 的 Metaspace

    Java 8 的 Metaspace https://www.cnblogs.com/xrq730/p/8688203.html 被废弃的持久代 想起之前面试的时候有面试官问起过我一个问题:Java ...

  3. suoi21 高能显示屏 (cdq分治)

    可以把翻倍的操作看作是一个查询和修改(增加刚查询得来的值)的符合操作,然后做cdq就行了 #include<bits/stdc++.h> #define pa pair<int,in ...

  4. 1: Myeclipse10 优化设置

    一.myeclipse字体设置 Window->Preferences->General->Appearance->Colors and Fonts 在右侧找到”Aa Test ...

  5. ​python高级数据可视化视频Dash1

    在谷歌浏览器输入http://127.0.0.1:8050/后,回车,看到下图可视化结果 # -*- coding: utf-8 -*- """ Created on S ...

  6. 函数和常用模块【day06】:datetime模块(二)

    本节内容 1.datetime.datetime.now 2.datetime.date.fromtimestamp 3.datetime.timedelta 4.时间替换 1.datetime.da ...

  7. javascript 模块化规范

    服务器端规范 - CommonJS Node.js 浏览器端规范 - AMD RequireJS - CMD SeaJS

  8. cdqz2017-test10-柚的策略(期望DP & 组合数学)

    根据期望的可加性,我们可以算出每一位客人的期望等待时间,将他们累加 即 每一位客人所有可能情况的时间之和 / n! 设S= 每一位客人所有可能情况的时间之和 如果有f(i,p)种方案使客人i是恰好第p ...

  9. currentColor

    http://www.zhangxinxu.com/wordpress/2014/10/currentcolor-css3-powerful-css-keyword/

  10. Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

    使用JProfiler监控JAVA程序内存,JVM报错: A fatal error has been detected by the Java Runtime Environment: EXCEPT ...