1. Install G++
2. $ ./configure
$ make
$ sudo su
$ make install
3. gedit ~/.bashrc
add following lines:
export LD_LIBRARY_PATH=/usr/local/lib
Then you can use crf_learn to train data and crf_test to decode.
Reference: http://crfpp.sourceforge.net/