Installing the GNU Scientific Library

Brownie (and RBrownie) both depend on the GNU Scientific Library (GSL). This tutorial will go though how to install it in various operating systems.

Linux

Many linux distributions such as Ubuntu and OpenSUSE have great package management systems which probably contain GSL packages. If you use these operating systems then you probably know how to use their package managers. This is the recommend way to install the GSL in linux.

Otherwise, you'll have to download the GSL source manually:

  1. go to: http://www.gnu.org/prep/ftp.html
  2. click on an ftp link close to your location
  3. find the gsl/ directory and click on it
  4. find the gsl-VERSION.tar.gz file, where version is 1.14 or greater. Click on that file to download it.
  5. In a terminal window extract the tar.gz file using tar -xzf gsl-VERSION.tar.gz and then cd to the ./gsl-VERSION directory
  6. Look at the INSTALL file. It will probably tell you to run ./configure, then make, and then make install (and you might have to login as the superuser (sudo)


NOTE: You will want to build the GSL for the same architecture as whatever architecture R is built under (i.e. 64-bit if using 64-bit R).

Mac OSX

Follow the same procedure for Linux, just make sure that you install Xcode (which comes with a C/C++ compiler) and you might need to update Xcode if g++ --version is less than 4.1.0. If you are using an old version of Mac OSX (< 10.5), you might need to use an older version of the GSL.

Windows

It is highly recommended that you install a pre-compiled GSL in Windows. Compiling the GSL from source in Windows is at best tricky and at worst nightmarish. I use the Boost Science Package compiled by Gordon Taft:

  1. Download either the 32-bit or 64-bit version of the GSL (which ever R version you are using)
  2. Open the file go through the installer. Make sure the install directory has a linux-style path name (no spaces). For example, I installed to C:\Boost_Science_library\ .
  3. Once the package has been installed, you need to set an environmental variable pointing to it:
  4. In windows, click on the Start button, right click on "computer" and choose "properties"
  5. Click "Advanced system settings"
  6. Click "Environmental variables"
  7. Click the highest "new..." button
  8. For "Variable name" enter LIB_GSL
  9. For "Variable value" enter the directory you installed the Boost Science Library to (in my case it was "C:/Boost_Science_Library/")

Conclustion
Now you can try to install RBrownie. It should work and if it does not then post here and we will try to help you out.