Hi,
I‘m trying to build lidDAI matlab interface under Cygwin64. I first try to use the following setting to build.
(1)ME=.mexw64
(2)CC=g++
(3)CCFLAGS=-Wno-deprecated -Wall -W -Wextra -DCYGWIN
(4)MEX=$(MATLABDIR)/bin/mex
(5)MEXFLAGS:=CXX=$(CC) CXXFLAGS='$(CCFLAGS)'
As showed in the following, an error occurs. It seems like matlab command "mex" is not found.
$ make
/cygdrive/c/Program\ Files/MATLAB/R2014a/bin/mex -Iinclude -I/cygdrive/c/sdk/boost/boost_1_59_0 -I/cygdrive/d/cygwin64/usr/local/include CXX=g++ CXXFLAGS='-Wno-deprecated -Wall -W -Wextra -DCYGWIN' -largeArrayDims -lgmpxx -lgmp -output matlab/dai.mexw64 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
make: /cygdrive/c/Program Files/MATLAB/R2014a/bin/mex:No such file or directory
Makefile:193: recipe for target 'matlab/dai.mexw64' failed
make: *** [matlab/dai.mexw64] Error 127
Then, I try to make the change: MEX=$(MATLABDIR)/bin/win64/mex.exe. I think it is true path of "mex" command.
Still I get an error, which shows that "mex" command is using "Microsoft Visual C++ 2012" compiler, and not using Cygwin g++ compiler. That is, with this setting we cannot change the compiler that "mex" command use. Is it because format or parameters of "mex" command in Windows is different from that in other OS? Thanks a lot.
Bests, Sun
$ make
/cygdrive/c/Program\ Files/MATLAB/R2014a/bin/win64/mex.exe -Iinclude -I/cygdrive/c/sdk/boost/boost_1_59_0 -I/cygdrive/d/cygwin64/usr/local/include CXX=g++ CXXFLAGS='-Wno-deprecated -Wall -W -Wextra -DCYGWIN' -largeArrayDims -lgmpxx -lgmp -output matlab/dai.mexw64 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
▒▒▒▒: MEX ▒Ҳ▒▒▒▒▒ 'gmpxx'▒▒▒▒Ĭ▒▒▒▒▒▒Ϊ 'libgmpxx.lib'▒▒
▒▒▒▒: MEX ▒Ҳ▒▒▒▒▒ 'gmp'▒▒▒▒Ĭ▒▒▒▒▒▒Ϊ 'libgmp.lib'▒▒
ʹ▒▒ 'Microsoft Visual C++ 2012' ▒▒▒롣
dai.cpp
include\dai/util.h(22) : fatal error C1083: ▒▒▒▒▒▒▒ļ▒:▒▒boost/foreach.hpp▒▒: No such file or directory
Makefile:193: recipe for target 'matlab/dai.mexw64' failed
make: *** [matlab/dai.mexw64] Error 127