Closed apozas closed 2 years ago
Edit Makefile.lin64
and:
-DMX_COMPAT_32
to CFLAGS
-DMLINTERFACE=3
-lML64i3
by -lML64i4
Tell us if it works, or post the new error message please.
It worked! Thank you for such a quick and effective answer. Now OpenMATLAB[]
and simple problems like MEvaluate["2+2"]
work without any apparent problem. For completeness, this is the output of running make -f Makefile.lin64
with the proposed changes implemented:
g++ -O -Wall -DMX_COMPAT_32 -I/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions -I/usr/local/MATLAB/R2018a/bin/../extern/include -L/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions -L/usr/local/MATLAB/R2018a/bin/../bin/glnxa64 menginetm.cpp mengine.cpp set.cpp get.cpp main.cpp -Wl,-rpath-link,/usr/local/MATLAB/R2018a/bin/../bin/glnxa64/ -lML64i4 -luuid -lmx -leng -o mengine
In file included from /usr/include/c++/9/cassert:44,
from set.cpp:13:
set.cpp: In function ‘void eng_make_Struct()’:
set.cpp:192:39: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
192 | assert(mxGetNumberOfElements(var) == len);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
But, as I said, it works. Thank you very much! I am closing the issue and writing this solution in the StackExchange post. However, if you decide to write it yourself later, I will happily accept yours as the correct answer.
I am facing issues when trying to run MATLink between Mathematica 13.0.0 and MATLAB R2018a in Ubuntu 20.04.4. The problem is described in this StackExchange post, but I am reproducing it here with more details:
What is happening
After unzipping MATLink in the folder opened by
SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications"}]
, runningproduces the following output:
Automatically compiling the MATLink Engine has failed. See http://matlink.org/troubleshooting/, then try to compile it manually and ensure that the path to the MATLAB directory is set correctly in the makefile.
System specifications
I am running Ubuntu 20.04.4, 64-bit.
which math
returns/usr/local/bin/math
(which itself is a symlink to/usr/local/Wolfram/Mathematica/13.0/Executables/math
,which matlab
returns/usr/local/MATLAB/R2018a/bin/matlab
, andg++ -v
returnsgcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
, although as I described in the StackExchange post I also tried g++ version 6.4.0 (the minimum version for MATLAB R2018a is 6.3.0, but I was unable to find it).The output of
MATLink`Developer`GetInfo[]
is the following:What else I have tried
I tried compiling manually the engine, following the instructions on the website. Running
make -f Makefile.lin64
produces the outputAnd running it as superuser does not seem to make a difference. It was suggested in different places that I edited
Makefile.lin64
and added the flag-DMX_COMPAT_32
toCFLAGS
. Upon doing so, runningmake -f Makefile.lin64
produces the output:Any help in solving this issue would be very much appreciated. Thank you