- 下载源码:https://github.com/taku910/crfpp.git
- 进入目录:
./configure
make
sudo make install
无论是ubuntu,还是macos,执行make时,一般会出现如下错误:
g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c -o crf_learn.o crf_learn.cpp
g++ -DHAVE_CONFIG_H -I. -O3 -Wall -c -o crf_test.o crf_test.cpp
crf_learn.cpp:9:21: fatal error: winmain.h: No such file or directory
#include "winmain.h"
- ubuntu解决方案
./configure
sed -i '/#include "winmain.h"/d' crf_test.cpp
sed -i '/#include "winmain.h"/d' crf_learn.cpp
make
sudo make install
- macos解决方案
./configure
sed -i '.bak' '/#include "winmain.h"/d' crf_test.cpp
sed -i '.bak' '/#include "winmain.h"/d' crf_learn.cpp
make
sudo make install