-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Installation
GoLearn is a Go library that's relatively standard apart from a few optional C dependencies. To install it, you'll need to install Go 1.2 or later first.
GoLearn uses Gonum's BLAS wrapper, which requires OpenBLAS or similar to be installed.
sudo apt-get install libopenblas-dev
sudo zypper in blas-devel cblas-devel
After installing a BLAS implementation, type the following commands
go get github.com/gonum/blas
cd $GOPATH/src/github.com/gonum/blas
go install ./...
On OpenSUSE 13.1, modify $GOPATH/src/github.com/gonum/blas/cblas/blas.go
and modify the line beginning #cgo linux LDFLAGS:
to read #cgo linux LDFLAGS: -lblas -lcblas
.
- Visit the liblinear site and download version 1.94. (Direct link to the tar.gz version)
- Extract the file, change into it, and type
make lib
to build the library - Copy
liblinear.so.1
to/usr/lib64
- Copy
linear.h
to/usr/include
- Create a symbolic link to
liblinear.so.1
in/usr/lib64
usingln -s /usr/lib64/liblinear.so /usr/lib64/liblinear.so.1
- Run
ldconfig -v | grep linear
to check that the library is installed.
After installing go and the system dependencies, type
go get -t -u -v github.com/sjwhitworth/golearn
cd $GOPATH/src/github.com/sjwhitworth/golearn/ext
go run make.go
You'll then need to add $GOPATH/src/github.com/sjwhitworth/golearn/ext/lib
to an appropriate variable.
Add the following to your ~/.bashrc
file:
export LD_LIBRARY_PATH=$GOPATH/src/github.com/sjwhitworth/golearn/ext/lib:$LD_LIBRARY_PATH
Make sure to run source ~/.bashrc
or restart the bash
shell before continuing.
Add the following to your ~/.bashrc
file:
export DYLD_LIBRARY_PATH=$GOPATH/src/github.com/sjwhitworth/golearn/ext/lib:$DYLD_LIBRARY_PATH
Make sure to run source ~/.bashrc
or restart the bash
shell before continuing.
Run the following to complete installation.
cd $GOPATH/src/github.com/sjwhitworth/golearn
go get ./...
On Linux and Mac OS X, you can verify that Go is installed correctly via your terminal. Try compiling the example program to verify that your installation is working correctly.
Your go
directory must exist in your home directory and be writeable.
If it isn't, type cd && mkdir go
to create it.
Your GOPATH
and PATH
variables must be set correctly.
- To verify, type
echo $GOROOT
andecho $GOPATH
. - Your
$GOPATH
variable should include your$GOROOT
, plus abin/
directory. For example, if$GOROOT
is set to/home/sen/go
,$GOPATH
should be set to/home/sen/go/bin
- To make sure that these variables are setup correctly, add
export GOROOT=$HOME/go
andexport PATH=$PATH:$GOROOT/bin
to your Bash configuration file.
Operating Systems | Mac OS X 10.8 Ubuntu 14.04 OpenSUSE 13.1 |
Go version | 1.2 |
GoLearn version | 0.1 |
Support status | Current |
Next revision | On version upgrade |
- BLAS installation via HomeBrew has not been confirmed working.