mad*_*ode 8 machine-learning large-data vowpalwabbit
我正在努力安装vowpal wobbit并且当我运行make文件时失败,抛出:
cd library; make; cd ..
g++ -g -o ezexample temp2.cc -L ../vowpalwabbit -l vw -l allreduce -l boost_program_options -l z -l pthread
ld: library not found for -lboost_program_options collect2: ld returned 1 exit status make[1]: *** [ezexample] Error 1'
Run Code Online (Sandbox Code Playgroud)
然后我通过指定-L/usr/local/lib将链接添加到boost库中
现在我收到以下错误:
g++ -g -o ezexample temp2.cc -L/usr/local/lib ../vowpalwabbit -l vw -l allreduce -l boost_program_options -l z -l pthread
ld: library not found for -lvw
collect2: ld returned 1 exit status
make: *** [ezexample] Error 1
Run Code Online (Sandbox Code Playgroud)
我碰巧在OS X 10.7上工作了如下:
确保你有一个有效的Boost安装.如" 入门"页面所示,通常我们只需要头文件,但是必须单独构建一些Boost库,包括用于处理命令行或配置文件中的选项的program_options库.进入你的boost
文件夹,然后在你的shell提示符下:
$ ./bootstrap.sh
$ ./bjam
Run Code Online (Sandbox Code Playgroud)
这将编译和构建一切.您现在应该在bin.v2/
目录中有一个目录boost
,其中包含系统的所有内置库(静态和线程库).
$ ls bin.v2/libs/
date_time iostreams python serialization test
filesystem math random signals thread
graph program_options regex system wave
Run Code Online (Sandbox Code Playgroud)
更重要的是,stage/lib/
目录中提供了额外的Boost库.对我来说,这些都是Mach-O 64-bit dynamically linked shared library x86_64
.
在包括路径应该是your_install_dir/boost_x_xx_x
,这里boost_x_xx_x
是你的工作加速的基本部分.(我亲自boost_1_46_1
参与/usr/local/share/
并将其/usr/local/share/boost
符号链接以避免记住版本号.)库路径(用于链接)应该读取your_install_dir/boost_x_xx_x/stage/lib
.但是,最好在常规位置进行符号链接或复制(这就是我所做的),即/usr/local/include/boost
头文件和/usr/local/lib
库.
编辑Makefile
从vowpal_wabbit
目录,并更改包括/库路径,以反映当前的安装.本Makefile
应该是这样的(第12行):
COMPILER = g++
UNAME := $(shell uname)
ifeq ($(UNAME), FreeBSD)
LIBS = -l boost_program_options -l pthread -l z -l compat
BOOST_INCLUDE = /usr/local/include
BOOST_LIBRARY = /usr/local/lib
else
LIBS = -l boost_program_options -l pthread -l z
BOOST_INCLUDE = /usr/local/share/boost # change path to reflect yours
BOOST_LIBRARY = /usr/local/share/boost/stage/lib # idem
endif
Run Code Online (Sandbox Code Playgroud)
然后,您已准备好编译vowpal_wabbit
(make clean
如果您已编译它):
$ make
$ ./vw --version
6.1
$ make test
Run Code Online (Sandbox Code Playgroud)