[preds, probs]=feval(mh,'generate_path_structure',A,tols);
where "A" is a sparse matrix with 1s and "tols" is a vector of doubles. Running the matlab code using feval displays the following error message:
Invalid C++ MEX-file 'generate_path_structure': dlopen(/Users/robertbenassai/Documents/UOC/MCM/mcm/generate_path_structure.mexmaca64, 0x0006):
Symbol not found: _mexPrintf
Referenced from: <C58C4F04-7EBD-313D-A9BD-61548F72625D> /Users/robertbenassai/Documents/UOC/MCM/mcm/generate_path_structure.mexmaca64
Expected in: <A1867563-F598-3005-B8E0-8FFDD5D68CA6> /Applications/MATLAB_R2023b.app/interprocess/bin/maca64/mex/libmex.dylib
Which I think happens because Matlab doesn't find the libmex.dylib library. Before having a "Symbol not found" with 'mexPrintf' I had the same issue with 'mexErrMsgIdAndTxt' but I was able to comment the lines where it appeared, which I can't do with mexPrintf because it is probably included in another mex function I am using.
I have tried changing the DYLD_LIBRARY_PATH variable to add the path /Applications/MATLAB_R2023b.app/interprocess/bin/maca64/mex/libmex.dylib but I haven't succeeded.
My compilation line is:
mex -largeArrayDims generate_path_structure.cpp -I"/opt/homebrew/include" -I"/Applications/MATLAB_R2023b.app/extern/include" -L"/opt/homebrew/lib" -L"/Applications/MATLAB_R2023b.app/bin/maca64" -lboost_system -lboost_filesystem -lboost_graph CXXFLAGS="\$CXXFLAGS -std=c++20 -fopenmp" LDFLAGS="\$LDFLAGS -Xpreprocessor -fopenmp"
And compiles just fine. I've also tried to compile linking /Applications/MATLAB_R2023b.app/interprocess/bin/maca64/mex but it gives the following error on compilation related to mexPrintf:
Undefined symbols for architecture arm64:
"_mexPrintf", referenced from:
_mexFunction in generate_path_structure.o
_mexFunction.omp_outlined in generate_path_structure.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
I am quite new to Matlab and I would really appreciate if someone could help me find the reason of the issue. I am also not a computer scientist so I'm sorry for being messy and incorrect in my question, my knowledge is pretty limited...
Thank you beforehand