The GNU Scientific Library (GSL) includes convenient use to matrices among other things. One convenient way to install GSL is using homebrew. Once installed a quick “brew install gsl” will do the work for you. To then use GSL with Xcode, do the following:
- Create a new Xcode Project
- Edit Build Settings
- Under “Other Linker Flags” add the following:
- -lgsl
- -lgslcblas
- Under “Header Search Path” add the following:
- /usr/local/Cellar/gsl/1.15/include
- Under “Library Search Path” add the following:
- /usr/local/Cellar/gsl/1.15/lib
- Add the appropriate #include to your source files for the GSL library you wish to use. For example: #include <gsl/gsl_rng.h>
- Code and Compile.
I recommend this blog post for more information – particularly if you wish to compile GSL by hand.
Gary Elston
/ July 1, 2013Excellent post – really helpful, thanks!
joking
/ September 6, 2013xCode version? gsl version?
pete
/ September 9, 2013I’m currently running Xcode 4.6.3 and GSL 1.16.