Following the instructions in the MATLink website I am posting my issue when compiling MEngine on a Linux machine. I have checked that csh
, g++
and libuuid
are properly installed. I am trying to link Mathematica 13.0.0 with MATLAB R2018a. According to the documentation, the compiler supported is gcc 6.3.x
. I have tried gcc version 6.4.0 20180424 (Ubuntu 6.4.0-17ubuntu1)
and gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
(I have been unable to download any lower version), and both throw the same error. Here are the details:
In[2]:= MATLink`Developer`GetInfo[]
MATLink 1.1 for Unix (Fri 15 Aug 2014)
13.0.0 for Linux x86 (64-bit) (December 3, 2021)
csh:
/bin/csh
g++:
/usr/bin/g++
MATLAB:
/usr/local/MATLAB/R2018a/bin
libuuid:
libuuid.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libuuid.so.1
libuuid.so.1 (libc6) => /lib/i386-linux-gnu/libuuid.so.1
libuuid.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libuuid.so
System PATH:
/usr/local/Wolfram/Mathematica/13.0/Executables
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
/usr/local/MATLAB/R2018a/bin
/snap/bin
/home/apozas/mosek/8/tools/platform/linux64x86/bin
Error:
make -f Makefile.lin64
g++ -O -Wall -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/ -DMLINTERFACE=3 -lML64i3 -luuid -lmx -leng -o mengine
In file included from menginetm.cpp:9:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:22: error: stray ‘\’ in program
116 | /*\ syntax\ error\ */\ )
| ^
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:24: error: expected unqualified-id before ‘)’ token
116 | /*\ syntax\ error\ */\ )
| ^
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:544:2: error: ‘wint’ does not name a type; did you mean ‘_wint’?
544 | wint low, hi;
| ^~~~
| _wint
In file included from mlp.h:11,
from mengine.h:11,
from mengine.cpp:8:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:22: error: stray ‘\’ in program
116 | /*\ syntax\ error\ */\ )
| ^
In file included from mlp.h:11,
from mengine.h:11,
from mengine.cpp:8:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:24: error: expected unqualified-id before ‘)’ token
116 | /*\ syntax\ error\ */\ )
| ^
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:544:2: error: ‘wint’ does not name a type; did you mean ‘_wint’?
544 | wint low, hi;
| ^~~~
| _wint
In file included from mlp.h:11,
from mengine.h:11,
from set.cpp:8:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:22: error: stray ‘\’ in program
116 | /*\ syntax\ error\ */\ )
| ^
In file included from mlp.h:11,
from mengine.h:11,
from set.cpp:8:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:24: error: expected unqualified-id before ‘)’ token
116 | /*\ syntax\ error\ */\ )
| ^
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:544:2: error: ‘wint’ does not name a type; did you mean ‘_wint’?
544 | wint low, hi;
| ^~~~
| _wint
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);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from mlp.h:11,
from mengine.h:11,
from get.cpp:8:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:22: error: stray ‘\’ in program
116 | /*\ syntax\ error\ */\ )
| ^
In file included from mlp.h:11,
from mengine.h:11,
from get.cpp:8:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:24: error: expected unqualified-id before ‘)’ token
116 | /*\ syntax\ error\ */\ )
| ^
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:544:2: error: ‘wint’ does not name a type; did you mean ‘_wint’?
544 | wint low, hi;
| ^~~~
| _wint
In file included from mlp.h:11,
from mengine.h:11,
from main.cpp:8:
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:22: error: stray ‘\’ in program
116 | /*\ syntax\ error\ */\ )
| ^
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:116:24: error: expected unqualified-id before ‘)’ token
116 | /*\ syntax\ error\ */\ )
| ^
/usr/local/Wolfram/Mathematica/13.0/Executables/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/mathlink.h:544:2: error: ‘wint’ does not name a type; did you mean ‘_wint’?
544 | wint low, hi;
| ^~~~
| _wint
make: *** [Makefile.lin64:21: mengine] Error 1
The error is the same when using g++
6 and 9. I also tried the solution suggested here, without success.
Thank you for the assistance.