gpt4 book ai didi

c++ - libDAI 编译错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:51:43 24 4
gpt4 key购买 nike

尝试在我的 ubuntu 14.04LTS 系统上安装 libDAI(一个用于离散近似推理方法的免费/开源 C++ 库)时,我遇到了编译错误。我从 github 克隆了 repo ,为我的系统编辑了 makefile(唯一的变化是我的 matlab 目录)并运行 make,它遇到了这个错误 -

/usr/bin/ld: cannot find -lboost_program_options-mt

这是在完成所有相关安装之后

apt-get install g++ make doxygen graphviz libboost-dev libboost-graph-dev libboost-program-options-dev libboost-test-dev libgmp-dev cimg-dev

以及在黑暗中拍摄

sudo apt-get install libboost-all-dev

还有一个,显然对其他人有用的东西,即

sudo apt-get libboost-program-options-dev

这给我一个错误(E:无效操作 libboost-program-options-dev)

我似乎没有这个库就无法进步,所以我在墙上

基于直觉

/sbin/ldconfig -p | grep libboost_program

我决定去掉 makefile 中的 -mt 部分,留下

BOOSTLIBS_PO=-lboost_program_options (instead of ...options-mt)

现在我明白了

make /usr/local/MATLAB/R2015a/bin/mex -Iinclude CXX#g++ CXXFLAGS#'-Wno-deprecated -Wall -W -Wextra -fpic' -largeArrayDims -DDAI_WITH_BP -DDAI_WITH_FBP -DDAI_WITH_TRWBP -DDAI_WITH_MF -DDAI_WITH_HAK -DDAI_WITH_LC -DDAI_WITH_TREEEP -DDAI_WITH_JTREE -DDAI_WITH_MR -DDAI_WITH_GIBBS -DDAI_WITH_CBP -DDAI_WITH_DECMAP -lgmpxx -lgmp -output matlab/dai.mexa64 src/matlab/dai.cpp src/matlab/matlab.cpp src/graph.cpp src/dag.cpp src/bipgraph.cpp src/varset.cpp src/daialg.cpp src/alldai.cpp src/clustergraph.cpp src/factor.cpp src/factorgraph.cpp src/properties.cpp src/regiongraph.cpp src/util.cpp src/weightedgraph.cpp src/exceptions.cpp src/exactinf.cpp src/evidence.cpp src/emalg.cpp src/io.cpp src/bp.cpp src/fbp.cpp src/trwbp.cpp src/mf.cpp src/hak.cpp src/lc.cpp src/treeep.cpp src/jtree.cpp src/mr.cpp src/gibbs.cpp src/bbp.cpp src/cbp.cpp src/bp_dual.cpp src/decmap.cpp /home/jeremy/jeremy.rutman@gmail.com/techdev/Research/clothes specific/fashionista/fashionista_v0.2/lib/libdai/libdaigit/libDAI/CXX#g++ not found; check that you are in the correct current folder, and check the spelling of '/home/jeremy/jeremy.rutman@gmail.com/techdev/Research/clothes specific/fashionista/fashionista_v0.2/lib/libdai/libdaigit/libDAI/CXX#g++'.

makefile 有以下内容

# MATLAB
# MatLab version 7.3 (R2006b) or newer?
NEW_MATLAB=true
# Replace the following by the directory where MatLab has been installed
MATLABDIR=/usr/local/MATLAB/R2015a
#echo $MATLABDIR
# The following should resolve to the MatLab mex compile command
MEX=$(MATLABDIR)/bin/mex
# Specify the C++ compiler and flags for MEX
#MEXFLAGS:='g++'
MEXFLAGS:=CXX\#$(CC) CXXFLAGS\#'$(CCFLAGS)'

最佳答案

关于c++ - libDAI 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30703938/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com