Building the GNU Scientific Library with Microsoft Visual Sudio 2012
====================================================================
This is GSL, the GNU Scientific Library, a collection of numerical
routines for scientific computing. Please see the readme.txt file
for futher information on GNU and GSL. This file only describes
how this version is configured.
The following sections describe how to compile GSL using Microsoft
Visual Studio 2012.
Although The files are designed for use with the full versions of
Visual Studio 2012, they can be used with Microsoft Visual C++
Express 2012 and/or the Windows 7.1 SDK. To run the GSL tests,
Python also needs to be installed (2.6 or later).
1. Set Up Directories and Files
===============================
First the GSL zip file for version 1.16 needs to be obtained and
expanded into a directory tree under a an appropriate root directory.
This direcrtory will be assumed to be 'gsl-1.16' here. Next, the zip
file gsl-1.16.vc11.zip needs to be expanded so that its directories
and files are in the gsl-1.16 directory - this should add a
'build.vc11' directory at the top level inside your GSL root directory.
It will also overwrite a number of GSL files that need to be changed
(see the text file gsl.vc11.changes.txt).
The GSL solution files gsl.lib.sln or gsl.dll.sln can then be opened
to build GSL either as a static library or a dynamic link library
respectively. The projects in these solutions are:
Utilities build:
gsldefs - a utility that generates GSL and CBLAS DEF files
gslhdrs - a utility that adds DLL import/export directives
to the GSL and CBLAS header files.
GSL build:
gsldll - builds the GSL dynamic link library
cblasdll - builds the BLAS dynamic link library
gsllib - builds the GSL static library (multi-threaded)
cblaslib - builds the BLAS static library (multi-threaded)
In addition there are also a large number of test projects that
will be described later.
2. Building GSL
===============
Copying or Modifying GSL Header Files
-------------------------------------
Either the 'gsldefs' or the 'gslhdrs' project has to be built
BEFORE any GSL libraries are built. Do NOT run both -- gslhdrs
is preferred. This step only needs to be done ONCE.
After either gslhdrs or gsldefs is built, they will then be run
automatically and will copy all the GSL header files into the
gsl subdirectory within the GSL root directory. You should now
have the following directory layout:
gsl-1.16 - the GSL root directory
blas )
block ) - GSL subdirectories
bspline )
build.vc11 - the Visual Studio build files
.... - more GSL subdirectories
gsl - should now contain the GSL header files
....
The follwoing two sections describe what gslhdrs and gsldefs programs
do - you can skip these if you have completed this step successfully.
GSLHDRS
-------
The gslhdrs.exe executable collects all the headers into the gsl
sub-directory in a modified form:
(a) it adds the symbols GSL_FUN (for gsl functions) or CBL_FUN
(for cblas functions) before each GSL or CBLAS function
definition;
(b) it then inserts the following text into each header so that
so that the symbols GSL_FUN and CBL_FUN can be used to
declare GSL and CBLAS symbols for static library, DLL import
or DLL export depending on what is being built at the time.
In GSL headers:
#if !defined( GSL_FUN )
# if !defined( GSL_DLL )
# define GSL_FUN extern
# elif defined( BUILD_GSL_DLL )
# define GSL_FUN extern __declspec(dllexport)
# else
# define GSL_FUN extern __declspec(dllimport)
# endif
#endif
In CBLAs headers (gsl_cblas.h):
#if !defined( CBL_FUN )
# if !defined( CBLAS_DLL )
# define CBL_FUN extern
# elif defined( BUILD_CBLAS_DLL )
# define CBL_FUN extern __declspec(dllexport)
# else
# define CBL_FUN extern __declspec(dllimport)
# endif
#endif
GSLDEFS
-------
The project gsldefs can be used as an ALTERNATIVE to gslhdrs. This
copies the header files as before but then creates DEF files that
can be added to the DLL projects to create the exports needed. This
avoids the need to modify the header files. If this approach is
used the DEF files gsl.def and cblas.def need to be added to the
respective DLL projects manually as the default build approach is
based on the use of gslhdrs.
Static Library Build
--------------------
At this point the two library projects can be built. The resulting
libraries are placed in appropriate subdirectories within the
gsl-1.16 directory as follows:
gsl-1.16
lib
win32
release
debug
x64
release
debug
DLL Build
---------
The VC++ DLL build projects can be built as required. Note, however,
that either gslhdrs.exe or gsldefs.exe must be run first as described
esrlier. The resulting DLLs and libraries are placed in appropriate
subdirectories within the gsl-1.16 directory:
gsl-1.16
dll
win32
release
debug
x64
release
debug
Testing
-------
The GSL solution files test.gsl.lib.sln or test.gsl.dll.sln can be used
to test the GSL static or DLL libraries. The configuration set for these
projects has to be the same as that used to build the GSL libraries.
Each of the test projects runs and puts its output in the appropriate
subdirectory:
gsl-1.16
<lib|dll>
win32
release
debug
x64
release
debug
as a name.out file where 'name' indicates the test in question. These
output files will contain failure messages if there are any problems.
If you have Python installed you can run the static library or the DLL
tests (after the tests have been built in Visual Studio by running the
programs run_tests.py found in the libtests and dlltests directories
respectively.
NOTE
----
The DLL projects can be built using either method but the method using
gslhdrs, although more complex, allows the direct import of DLL symbols
and direct static and dynamic linking.
GSL Use in Windows Applications.
================================
The GSL and CBLAS static libraries can be used in a straightforward way
with Windows Applications. These are multi threaded since single threaded
libraries are no longer available for VC++.
The GSL and CBLAS DLLs are fairly easy to use but there are a few issues to
watch out for. Firstly the application must be able to locate the DLLs so
they must be on the DLL search path or in the same directory as the
application. Secondly it is necessary to link to the lib files in the dll
folder rather than those in the lib folder. Thirdly GSL_DLL must be defined
to tell the application that a DLL is being used.
The GSL build projects create GSL with range checking turned off. If you
wnat it turned on you should add the symbol GSL_RANGE_CHECK to the lists
of pre-processor defines in the cbaslib and gsllib build projects.
Brian Gladman, Worcester UK, July 2013
没有合适的资源?快使用搜索试试~ 我知道了~
gsl-1.16 vc2012
共116个文件
vcxproj:94个
c:6个
sln:4个
5星 · 超过95%的资源 需积分: 9 107 下载量 11 浏览量
2015-02-28
09:56:16
上传
评论 5
收藏 217KB ZIP 举报
温馨提示
gsl-1.16 vc2012 编译代码, 可配合我的另外一个资源gsl-1.16的源代码一起使用
资源推荐
资源详情
资源评论
收起资源包目录
gsl-1.16 vc2012 (116个子文件)
gsldefs.c 9KB
gslhdrs.c 8KB
test.c 7KB
test.c 6KB
env.c 3KB
fp-win.c 2KB
gsldll.vcxproj.filters 78KB
gsllib.vcxproj.filters 78KB
config.h 9KB
unistd.h 0B
dll_tests.props 1KB
lib_tests.props 1KB
run-tests.py 2KB
run-tests.py 2KB
test.gsl.lib.sln 34KB
test.gsl.dll.sln 34KB
gsl.dll.sln 3KB
gsl.lib.sln 3KB
gsl.vc11.readme.txt 7KB
gsl.vc11.changes.txt 3KB
gsldll.vcxproj 280KB
gsllib.vcxproj 276KB
cblasdll.vcxproj 56KB
cblaslib.vcxproj 20KB
testcblas.vcxproj 12KB
testcblas.vcxproj 11KB
testspecfunc.vcxproj 10KB
testhistogram.vcxproj 10KB
testfft.vcxproj 10KB
testmultiroots.vcxproj 10KB
testmultimin.vcxproj 10KB
testroots.vcxproj 10KB
testrandist.vcxproj 10KB
teststatistics.vcxproj 9KB
testintegration.vcxproj 9KB
testmin.vcxproj 9KB
testinterpolation.vcxproj 9KB
testpermutation.vcxproj 9KB
testcombination.vcxproj 9KB
testmultiset.vcxproj 9KB
testmultifit.vcxproj 9KB
testode2.vcxproj 9KB
testcomplex.vcxproj 9KB
testwavelet.vcxproj 9KB
testode.vcxproj 9KB
testbspline.vcxproj 9KB
testieee.vcxproj 9KB
testmatrix.vcxproj 9KB
testntuple.vcxproj 9KB
testlinalg.vcxproj 9KB
testvector.vcxproj 9KB
testsiman.vcxproj 9KB
testderiv.vcxproj 9KB
testmonte.vcxproj 9KB
testconst.vcxproj 9KB
testblock.vcxproj 9KB
testeigen.vcxproj 9KB
testpoly.vcxproj 9KB
testsort.vcxproj 9KB
testqrng.vcxproj 9KB
testdiff.vcxproj 9KB
testcheb.vcxproj 9KB
testerr.vcxproj 9KB
testsys.vcxproj 9KB
testfit.vcxproj 9KB
testdht.vcxproj 9KB
testrng.vcxproj 9KB
testcdf.vcxproj 9KB
testsum.vcxproj 9KB
gsldefs.vcxproj 9KB
gslhdrs.vcxproj 9KB
testspecfunc.vcxproj 9KB
testhistogram.vcxproj 9KB
testmultiroots.vcxproj 9KB
testmultimin.vcxproj 9KB
testroots.vcxproj 9KB
teststatistics.vcxproj 9KB
testintegration.vcxproj 9KB
testmin.vcxproj 9KB
testfft.vcxproj 9KB
testinterpolation.vcxproj 9KB
testpermutation.vcxproj 9KB
testcombination.vcxproj 9KB
testmultifit.vcxproj 9KB
testode2.vcxproj 9KB
testmultiset.vcxproj 9KB
testcomplex.vcxproj 9KB
testieee.vcxproj 9KB
testbspline.vcxproj 9KB
testwavelet.vcxproj 9KB
testode.vcxproj 9KB
testrandist.vcxproj 9KB
testlinalg.vcxproj 9KB
testntuple.vcxproj 9KB
testvector.vcxproj 9KB
testmatrix.vcxproj 9KB
testsiman.vcxproj 9KB
testblock.vcxproj 9KB
testconst.vcxproj 9KB
testmonte.vcxproj 9KB
共 116 条
- 1
- 2
lusteryu
- 粉丝: 22
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页