레이블이 GNU Scientific Library인 게시물을 표시합니다. 모든 게시물 표시
레이블이 GNU Scientific Library인 게시물을 표시합니다. 모든 게시물 표시

2012년 9월 29일 토요일

How to build GSL 1.15 on Visual Studio Express 2012

※ Elliott Pattern Helper Add In
  • Download Add In for Excel 2007 
  • Download Add In for Excel 2003 

1. Download GSL 1.15 sources

  • Download GSL 1.15 sources archive file
  • Extract the archive into a directory, let's say, 'GSL root'

2. Download Visual Studio 2010 GSL files


Follow the instructions in 'GSL root'/build.vc10/gsl.vc10.readme file. For static library build,

3. Open Visual Studio solution file 'GSL root'/build.vc10/gsl.lib.sln in Visual Studio 2012 Express
  • On 'VC++ compiler and library update' prompts, Click 'Update'
  • Build 'gslhdrs' project. There'll be no build errors.
  • Open Command Prompt window, and change directory to 'GSL root'/build.vc10/gslhdrs
  • Run 'build arch'/'build mode'/gslhdrs.exe, where 'build arch' is either win32 or x64, 'build mode' is either Debug or Release.
  • Build 'cblaslib' project. There'll be no build errors.
  • Build 'gslib' project. Compiler may complaints with error 'illegal initialization' on rk4imp.c
  • Edit the source as follows. Replace the original source
        const double c[] = { (3 - sqrt (3)) / 6, (3 + sqrt (3)) / 6 };
        with
        const double c[] = { (3 - M_SQRT3) / 6, (3 + M_SQRT3) / 6 };
  • Build 'gslib' project again. Compiler also returns an error on bspline.c, which caused by a #if block before a declaration block.
  • Edit the source as follows. Replace the original source
    double
    gsl_bspline_greville_abscissa(size_t i, gsl_bspline_workspace *w)
    {
    #if GSL_RANGE_CHECK
      if (GSL_RANGE_COND(i >= gsl_bspline_ncoeffs(w)))
        {
          GSL_ERROR_VAL ("Greville abscissa index out of range", GSL_EINVAL, 0);
        }
    #endif
      const size_t stride = w->knots->stride;
      size_t km1 = w->km1;
      double * data = w->knots->data + (i+1)*stride;

with
    double
    gsl_bspline_greville_abscissa(size_t i, gsl_bspline_workspace *w)
    {
      const size_t stride = w->knots->stride;
      size_t km1;
      double * data;
    #if GSL_RANGE_CHECK
      if (GSL_RANGE_COND(i >= gsl_bspline_ncoeffs(w)))
        {
          GSL_ERROR_VAL ("Greville abscissa index out of range", GSL_EINVAL, 0);
        }
    #endif
      //const size_t stride = w->knots->stride;
      //size_t km1 = w->km1;
      //double * data = w->knots->data + (i+1)*stride;
      km1 = w->km1;
      data = w->knots->data + (i+1)*stride;
  • Rebuild 'gsllib', then there'll be no build errors.
  • All done.