GSL 1.15 and 1.16 building with Visual Studio 2010 --FROM 4fire
Posted yfceshi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GSL 1.15 and 1.16 building with Visual Studio 2010 --FROM 4fire相关的知识,希望对你有一定的参考价值。
http://4fire.wordpress.com/2012/03/18/gsl-1-15-building-with-visual-studio-2010/
Update 05/02/2014: A good book for GSL (updated with 1.16 version) is GNU Scientific Library Reference Manual – Third Edition.
Update 14-11-2013: Building GSL 1.16 with Visual Studio 2010 (VC++ 10): In July, GSL 1.16 was released, the source code files can be obtained fromthis. If one wants to build it with Visual Studio 2012 (VC++ 11), the VS solution file can be downloaded fromthis URL and the same steps (from 1 to 6) as doing with GSL 1.15 and VS 2010 are needed. Based onVC++ 11 solution files, I have created solution for some one who still works with Visual Studio 2010 (VC++ 10), and that file can be downloaded fromthis address.
Today I build
GSL 1.15 for using with Visual Studio 2010. After downloading
GSL 1.15 source code, I download
VS 2010 solution files and start building GSL’s .dll and .lib for my own. And these are the steps:
1. Exatracting file gsl-1.15-vc10.zip into a folder (GSL_build for example). You should have the folder GSL_build\gsl-1.15-vc10after this step.
2. Exatracting file gsl-1.15.tar.gz into folderGSL_build\gsl-1.15.
3. Copy all gsl_*.h files from GSL_build\gsl-1.15 folder to
GSL_build\gsl-1.15-vc10\gsl folder (you should do a search here and make a copy on the found files).
4. Copy all files from folder GSL_build\gsl-1.15 to GSL_build\gsl-1.15-vc10 folder, do not overwrite the two filetemplates_on.h and env.c or you will encounter errors withRelease build.
5. Open file GSL_build\gsl-1.15-vc10\build.vc10\gsl.lib.sln with VS 2010 and startDebug andRelease build.
6. Open file GSL_build\gsl-1.15-vc10\build.vc10\gsl.dll.sln with VS 2010 and start Debug and Release build. You may need to copy cblas.lib file from folder build.vc10\lib\Win32to
folder build.vc10\dll\Win32 (Debug or Release sub folder) to make this step runs.
7. If you encounter errors (like me), then these are the fixings:
+ file bspline.c: moving variables declarations to the first part of the function:gsl_bspline_greville_abscissa(size_t i, gsl_bspline_workspace *w)
+ file rk4imp.c: replacing sqrt(3) with
M_SQRT3.
It’s done now. You should have your .dll in gsl_build\gsl-1.15-vc10\build.vc10\dll and .lib in the foldergsl_build\gsl-1.15-vc10\build.vc10\lib.
8. Notes:
+ When copying these above files and folders, do not over write anyfiles.
+ You can build GSL with other blas library like
Goto Blas,
Atlas. Just replacing the cblas.lib with the suitable .lib file in buildinggsl.dll.
+ For using GSL, you need both .lib file in the gsl_build\gsl-1.15-vc10\build.vc10\lib folder and .dll file in thegsl_build\gsl-1.15-vc10\build.vc10\dll
folder. Do not use .lib files fromgsl_build\gsl-1.15-vc10\build.vc10\dll folder.
+ You can use examples from
Physics 780.20 Computational Physics course for testing your .dll and .lib files.
+ Another source you can use is located at:
Data Analysis with Open source Tools. This is a good book with good examples.
+ Even though I did not test the above process of building GSL with other Visual Studio versions (VS Express, VS 2008, VS 2012) but I strongly believe that the same details can be applied.
!!! PS: add #define GSL_DLL at the beginning of the code.
!!! PPS: when using win32 application, ‘include stdafx.h‘ should be placed ahead.
!!! PPPS: the binary and src exe files can be downloaded from: http://download.csdn.net/detail/aldenphy/7407527
以上是关于GSL 1.15 and 1.16 building with Visual Studio 2010 --FROM 4fire的主要内容,如果未能解决你的问题,请参考以下文章
1.13 单用户模式;1.14 救援模式;1.15 克隆虚拟机;1.16 Linux机器相互登录