Compilation Error: libDAI-0.3.2 in Ubuntu 14.04 with MATLAB

Compilation Error: libDAI-0.3.2 in Ubuntu 14.04 with MATLAB

我正在尝试在 Ubuntu 14.04 中安装 libDAI-0.3.2。我需要在 MATLAB 中使用它。

我做了以下更改:

  1. 在Makefile.conf中:

    CC=g++-4.7

    MEXFLAGS:=CXX=#$(CC) CXXFLAGS#'$(CCFLAGS)'

  2. 在Makefile.ALL中:WITH_MATLAB=true

  3. 由于Ubuntu 14.04 中的默认编译器是gcc 4.8.4,我安装了gcc-4.7 和g++4.7。

仍然出现以下编译错误:

    libDAI-0.3.2$ make
    /usr/local/MATLAB/R2015a/bin/mex -Iinclude CXX= -largeArrayDims  -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/cobwebgraph.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 src/glc.cpp
    Building with 'g++'.
     /tmp/mex_11282758003780_5023: -c: not found

make: *** [matlab/dai.mexa64] Error 255

这是什么意思?知道如何解决这个问题吗?

感谢和问候, Swagatika

尝试替换

MEXFLAGS:=CXX=#$(CC) CXXFLAGS#'$(CCFLAGS)'

MEXFLAGS:=CXX=$(CC) CXXFLAGS='$(CCFLAGS)'

MEXFLAGS:=CXX=$(CC) CXXFLAGS='$(CCFLAGS)' 替换这个