Code Monkey home page Code Monkey logo

gslwin's Introduction

GSLwin

GSL for windows.

Update on 2017.09.08

Actually, we can compile lib and include for x64. Msys and mingw are two essential compenents. But this time I installed msys and mingw respectively, while I have installed the complex suite, which just for i386.

  1. Download MSYS-20111123.zip and unzip.
  2. Visit the website of mingw_w64, and click Mingw-builds, you would download the mingw-w64-install.exe from sourceforge. Then you just run this file and install.
  3. Note that we just install two seperate program, so we need to "connect" them. Open msys.bat and mingw-w64.bat, both locate in their respective installation directory. Copy the content in mingw-w64.bat and paste in the head of msys.bat. Then run msys.bat, you can use g++ and gcc, which belongs to mingw.
  4. Now we can compile gsl. Download gsl to the file folder of MSYS.
  5. In the unix-like terminal, type
tar xzvf gsl-2.4.tar.gz
cd gsl-2.4
./configure
make
make install

When I run ./configure, there is a warning, "WARNING: cache variable lt_cv_path_LD contains a newline". As a result, I fail to run make. There is a solution libtool. However, after I fix this bug, one more bug about libtool. And there are also mail lists talking about. But I failed to find a solution. I guess these bugs might be incompatible program. Because I choose the latest version when I install mingw_w64, while msys or gsl might not be updated. Then I adopt the mingw32 and mingw64 in Rtools. It need more time to test.


Steps

  1. Download MinGW and install.
  2. In MinGW Installation Manager, choose all packages in basic setup and install.
  3. In cmd, type 'msys.bat MSYS' to open a unix-like terminal.
  4. Download gsl to the file folder of MSYS.
  5. In the unix-like terminal, type
cd gsl-2.4/
./configure
make
make install
  1. The lib is in 'local/lib', and the include is in 'local/include'
  2. Now, you can use gsl on windows.
g++ test.c -o out I"path/to/include" -L"path/to/lib" -lgsl -lgslcblas -lm

NOTE: The include and lib in this repository are just for i386.

Setup Dev-C++

  1. Choose Tools>Compiler Options, select one 32-bit compiler to configure, say TDM-GCC 4.8.1 32-bit Release. DO NOT use 64-bit!

  2. Choose Tools>Compiler Options>Directories, then add the include and libraries path for gsl.

  3. Choose Tools>Compiler Options>General, add the following commands when calling the linker

-lgsl -lgslcblas -lm
  1. Compile and build a C/C++ program, say lm.cpp

The results are as follows:

gslwin's People

Contributors

szcf-weiya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.