How do I avoid the MATLAB R2017b MinGW-w64 setup error in configuremingw.p?

14 views (last 30 days)
Mark Thomas
Mark Thomas on 17 Jan 2018
Commented: Ed Waugh on 29 Jan 2018
I have MinGW-w64 for GCC v5.3.0 installed at 'D:\Programs\mingw64'. [Our firewall prevents running of the Add-on installer, so MinGW-w64 (the POSIX-threaded, SEH (Structured Exception Handler) variant) was installed manually.]
Following the instructions in https://uk.mathworks.com/matlabcentral/answers/313298-i-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with-matlab#answer_244144, I downloaded the obfuscated script file configuremingw.p, ran MATLAB R2017b with admin rights and ran configuremingw (navigating to the installation folder D:\Programs\mingw64 and choosing [Select folder]).
This gave the error message:
Undefined variable "mex_spkg" or class "mex_spkg.getEnvVarName".
Error in configuremingw
Tried again, with configuremingw('D:\Programs\mingw64'), and got the same error.
Running MATLAB R2017b without admin rights, mex -setup looks OK, reporting:
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. You will be required
to update your code to utilize the new API.
You can find more information about this at:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
The MEX compiler reports a warning, every time it is run: mex yprime.c gives:
Building with 'MinGW64 Compiler (C)'.
Warning: MinGW compiler is not configured correctly. Please visit Manually Configure MinGW
for MATLAB to configure the MinGW compiler correctly and recompile your source code.
MEX completed successfully.
Any idea how to fix this, or can we have an un-obfuscated configuremingw.m function, to try and identify the problem, please?
I have searched my MATLAB installation directories [MATLAB with MATLAB Compiler, MATLAB Compiler SDK, Parallel Computing Toolbox & Signal Processing Toolbox] for all files named "mex_spkg*" and all files containing string "mex_spkg": none are found. Am I missing a toolbox dependency?
  1 Comment
Ed Waugh
Ed Waugh on 29 Jan 2018
Hi Mark, I have a similar problem where running configuremingw works when MATLAB is RunAs Admin and mex then works as admin but mex doesn't work when MATLAB is subsequently run as a normal user because it can't find the compiler. A version of configuremingw that works as a normal user or just some description of what it does would help a lot.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by