Chinaunix首页 | 论坛 | 博客
  • 博客访问: 11784
  • 博文数量: 1
  • 博客积分: 97
  • 博客等级: 民兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-09 18:10
文章分类
文章存档

2012年(1)

我的朋友
最近访客

分类: WINDOWS

2012-06-19 16:53:15

GNU Scientific Library 安装方法

Gsl for Windows

Gsl: GNU Scientific Library

1.8

GSL is the GNU scientific library for numerical computing. It is a collection of routines for numerical computing in e.g. linear algebra, probability, random number generation, statistics, differentiation, integration, optimization, and differential equations.

The routines are written from scratch by the GSL team in ANSI C, and are meant to present a modern API for C programmers, while allowing wrappers to be written for very high-level languages.

The port of GSL has been contributed by Jerry St Clair. If you will be using one of the dynamic libraries, add GSL_DLL to the list of predefined macros; so for use with Mingw / GCC, add -DGSL_DLL

This is an unofficial port of GNU GSL to Microsoft Windows -- please report problems to our SourceForge bug tracker / mailing list <>, not the GNU Project mailing lists or GSL developers.

Description

Download

Size

Last change

Md5sum

• Complete package, except sources

 

 

6476814

 

11 July 2006

 

d0c114f842933622a156bfa757ee14c2

• Sources

 

 

2145579

 

11 July 2006

 

71ee925eb86d7772fa8b4904dc755508

• Binaries

 

 

982270

 

11 July 2006

 

94635ae687c4f39d5f4e5985e31c1360

• Developer files

 

 

1202181

 

11 July 2006

 

ff1be5ca621f2e7849b6405c132f4d59

• Documentation

 

 

5077599

 

11 July 2006

 

8c97d5a31f179b066c6db885fd42ca22

• Sources

 

 

4361954

 

11 July 2006

 

5c0df6ca6798ef666b6f89af161b76ba

You can also download the files from the GnuWin32 .

You can  new releases of the port of this package.

If you will be using one of the dynamic libraries, add GSL_DLL to the list of predefined macros; so for use with Mingw / GCC, add -DGSL_DLL This is an unofficial port of GNU GSL to Microsoft Windows -- please report problems to our SourceForge bug tracker / mailing list <>, not the GNU Project mailing lists or GSL developers.

  • Win32, i.e. MS-Windows 95 / 98 / ME / NT / 2000 / XP / 2003 with msvcrt.dll and msvcp60.dll. If msvcrt.dll or msvcp60.dll is not in your Windows/System folder, get them from , or (msvcrt.dll only) by installing  4.0 or higher.
  •  (for developing with the Gsl library)

 

 是一个内含许多数值及科学运算函式的 C/C++ 函式库,内含超过 1000 个以上的(例如︰..等等) ,并且可以使用在各种操作系统平台。
  中有简单说明如何在 Windows 环境使用 GSL ,以下则是再详细一点介绍如何在 Visual C++ 6.0 IDE (整合型窗口接口) 下使用︰

1.
首先到  下载  
2.
  package bin 子目录下的 libgsl.dll, libgslcblas.dll 两个档案复制到 C:\Windows\System32 中。
3.
  解压缩后,在 VC IDE 中设定 include, lib 子目录的路径。
4.
由于此版本的 lib 子目录中不含 .lib 文件,必须用以下指令产生。请先开启 DOS 模式窗口(附属应用程序/命令提式字符),切换目录到 lib 目录下,并下达︰
lib /machine:i386 /def:libgsl.def

lib /machine:i386 /def:libgslcblas.def

可产生 libgsl.lib, libgslcblas.lib 两个档案。
5.
VC 项目中加入 libgsl.lib, libgslcblas.lib 2 lib link 参数中。
6.
VC 项目的 Preprocessor definitions 中加入 GSL_DLL
6.
可用函式及说明请见  

ps. GSL
是使用C语法写成,故并没有使用类别(class),而是以结构(struct)及函式(function)组成,不过 GSL 仍可以用在 C++ 编绎器,并与 C++ 程序兼容。

 

使用GNU Scientific Library(GSL)GSL的配置

近来帮朋友编译一个SIFT匹配的程序,可是里面不仅用到了OpenCV,而且用到了GSL,但是在编译的过程中,OpenCV的配置是没有什么问题了,可是GSL一直不行,在用VC6.0进行编译的时候,总是出现类似与如下的错误:

xform.obj : error LNK2001: unresolved external symbol _gsl_rng_free
xform.obj : error LNK2001: unresolved external symbol _gsl_rng_set
xform.obj : error LNK2001: unresolved external symbol _gsl_rng_alloc
xform.obj : error LNK2001: unresolved external symbol _gsl_rng_mt19937
xform.obj : error LNK2001: unresolved external symbol _gsl_sf_choose
xform.obj : error LNK2001: unresolved external symbol _gsl_rng_uniform_int

一想既然是LINK时的错误,肯定是lib文件有关系了。看到GSLlib文件夹下面并没有后缀名为lib的文件。但是又看到有后缀名为def的文件,我知道通过def文件是可以导出dlllib文件的了。而且在网络上也看到可以用VSlib命令来导出适合VS用的.lib文件,于是打开cmd窗口。

D:\Program Files\GnuWin32\lib>lib /machine:i386 /def:libgsl.def
Microsoft (R) Library Manager Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

   Creating library libgsl.lib and object libgsl.exp

D:\Program Files\GnuWin32\lib>lib /machine:i386 /def:libgslcblas.def
Microsoft (R) Library Manager Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

   Creating library libgslcblas.lib and object libgslcblas.exp

D:\Program Files\GnuWin32\lib>

可以看到lib文件夹下已经有了libgsl.liblibgslcblas.lib这样的话,我们只要将这两个lib文件添加到工程Link页中就可以了,如下:

当然了,要用GSL的话,也需要在VC的目录中添加GSLinclude目录、lib目录和bin目录,如下:

从添加的Include目录可以看出,当你用GSL里面的头文件时,需要类似与这样的引用:

#include

当然,如果你在添加Include目录是添加的是:D:\Program Files\GnuWin32\include\gsl

那么就不需要前面的gsl,只要如此引用就可以了:#include

还有一点需要说明的是GSL中已经没有gsl_rng_free.h了,所以你需将其改为gsl_rng.h

你可以在这里下载这个经典SIFT的图像匹配程序的VC程序:

你可以在这里下载GSLGNU Scientific Library1.8

 

阅读(3427) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~