Skip to content

szcf-weiya/GSLwin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

Releases

No releases published

Packages

No packages published