My Matlab coder was building stuff fine the last time I used (which was 2 months ago), but now when I try to build a project with it, I get the following error:
\>> coder -build get_scores.prj
Warning: 'perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = "en_GB",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
VSINSTALLDIR'
exceeds MATLAB's maximum name length of 63 characters and has been truncated to
'perl: warning: Setting locale failed.
perl: warning: Please che'.
\> In CompilerConfigurationFactory>CompilerConfigurationFactory.determineLocation at 275
In CompilerConfigurationFactory>CompilerConfigurationFactory.process at 130
In getCompilerConfigurations at 56
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\compilerman.p>parse_opts_file at 57
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\compilerman.p>compilerman at 15
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel/getCompilerName at 148
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel/finalizeProject at 711
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel at 36
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\codeProject.p>codeProject/doit at 8
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\codeProject.p>codeProject at 13
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\emlcprivate.p>emlcprivate at 18
The current MEX compiler '`<unknown>`' is not supported.
Use mex -setup to select a supported compiler.
Use help codegen for more information on using this command.
I've run mex -setup several times, chosen Visual Studio (which was what I was using previously and was working fine), and rerun the Build command, but the same error comes up repeatedly. Also, the part "exceeds MATLAB's maximum name length of 63 characters and has been truncated" seems to say Matlab is somehow interpreting the Perl warning as some variable name - I have no idea what's going on there.
I'm not sure why the Perl warning is coming up either - the LC_ALL was previously unset, and now is en_GB, but the same error comes up any way.
Any steps to rectify this would be highly appreciated.
Ok, after looking carefully at the message, I guessed that Matlab is trying to get the variable name VSINSTALLDIR using Perl internally, and the warning message is throwing it off. I tried running Perl on the command line to confirm the warning appears there too. Then while searching for ways to fix the locale error (Googling gave solutions only for linux and Mac systems), I found a way to simply suppress the Perl warning on this page. After doing that, the above error is gone.
Related
I am using Mac OSX (yosemite V 10.10.1) and running MATLAB 2014a on it.
I wanted to use SPAM library (sparse modeling software by J. Mairal) on MATLAB and for that I have to install XCode6.1 (that has gcc). First I type in command window mex -setup and result is shown below:
mex -setup
MEX configured to use 'Xcode with Clang' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
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
So after that I run the compile.m file in SPAM library and suddenly I saw an error that was:
add_flag =
-mmacosx-version-min=10.6
Warning: Directory already exists.
> In compile at 144
compilation of: -I./linalg/ -I./decomp/ -I./prox/ -I./dictLearn/ dictLearn/mex/mexArchetypalAnalysis.cpp
Building with 'Xcode Clang++'.
clang: warning: argument unused during compilation: '-fopenmp'
Error using mex
ld: warning: directory not found for option '-L/usr/lib/gcc/x86_64-linux-gnu/4.8/'
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in compile (line 439)
mex(args{:});
I don't understand what to do. please help me!
It appears that the actual error is occurring at the point of linking with precompiled libraries. The 2 issues are as follows:
The compile code apparently included in the compile.m file looks like it is intended to compile with gcc (it is trying to include files installed by GCC, possibly even linux-specific ones, are you sure that it's an OSX-compatible toolbox?), and yet the error strongly suggests that you are in fact using clang to compile it - you will either need to change the compiler (easy) or rewrite compile.m (not so easy).
One of the libraries that the code needs to have installed in order to be properly linked hasn't been found. On OSX I think this file should be called libgomp.dylib (any mac afficionados want to confirm this?). If you have it on your computer, then it's not in a directory that clang is looking in. You can confirm the library is installed by running find / | grep libgomp.dylib from the terminal - if it is there, you can add it into the compiler argument in compile.m using the -I /DIRECTORY_HOLDING_LIBRARY syntax.
It is entirely possible that fixing 1. will also remediate 2. - I have never tried using SPAM
I have tried to install the libsvm package with
mex -setup
(since "make" resulted in an error). This was followed by one choice for a compiler, so I chose "1".
Afterwards I typed in "make" got the following error though:
xcrun: error: SDK "macosx10.7" cannot be located
clang: warning: no such sysroot directory: '-mmacosx-version-min=10.7'
libsvmread.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
mex: compile of ' "libsvmread.c"' failed.
If make.m fails, please check README about detailed instructions.
What can I do?
I think the following answer from the matlab support might be helpful (http://www.mathworks.com/matlabcentral/answers/103904-can-i-use-xcode-5-as-my-c-or-c-compiler-in-matlab-8-1-r2013a-or-matlab-8-2-r2013b):
The Mac OS X 10.7 SDK, available in Xcode 4.1 through 4.6, is used by
MEX and related capabilities. This SDK is no longer available in Xcode
5, resulting in errors similar to the following when compiling:
xcodebuild: error: SDK "macosx10.7" cannot be located.
xcrun: error: unable to find utility "clang", not a developer tool or
in PATH
The simplest solution is to avoid updating Xcode to version 5 if you
are using R2013a or R2013b. If you need Xcode 5, or you have already
irreversibly upgraded to it, you can update MEX to use the 10.8 SDK:
In the MATLAB Command Window, execute the following commands:
cd(matlabroot)
cd bin
edit mexopts.sh
Save a backup copy of this file somewhere in case you make a mistake and you need to revert your changes.
Scroll down to the Mac (“maci64”) section of this file, beginning around line 120.
Replace all instances of 10.7 with 10.8; there are four of these in all (a fifth may be found in comments only)
Save the file, then execute the following command in the MATLAB Command Window:
mex -setup
Please note that this workaround links MEX files with a different SDK
than with which MATLAB was tested. Although there are no known
compatibility issues, support may be limited.
I am trying to compile perl(5.12.3) from source on windows(64 bit windows 2008 R2) using visual studio 10 )64 bit compiler.
Following configurations were done done:
Configure visual to compile 64 bit perl:
vcvarsall.bat x64
Changes in makefile:
uncommented:
CCTYPE = MSVC90
Set the value for MSVCDIR
On doing a make I am getting following error message:
..\miniperl.exe -I..\lib bin\exetype.pl ..\wperl.exe WINDOWS
'x' outside of string in unpack at bin\exetype.pl line 39.
NMAKE : fatal error U1077: '..\miniperl.exe' : return code '0xff'
Stop.
Please help me to understand what is missing.
I have tried with visual studion 13, but got same error.
You can try a couple of fixes:
Set CCTYPE = MSVC60
Quote "$offset" on line 37.
It's a known bug that might be fixed on newer versions.
I want to use GPU in matlab, so I installed CUDA toolkit(cuda_6.0.37), downloaded GPUmat 0.28 version. Of course my pc has geforce 850m. I clicked 'GPUstart', and it seems working and type the 'GPUmatSystemCheck', it says CUBLAS, CUFFT, CUDART installed, but there is warning 'GPUmat and SYSTEM architecture are different.'. My pc is 64 bit. Type the GPUsingle(1) on the command window, it says
'Warning: The following error was caught while executing 'GPUtype'
class destructor: Undefined function 'GPUtypeDelete' for input
arguments of type 'double'. Undefined function
'mxNumericArrayToGPUtypePtr' for input arguments of type
'GPUsingle'.'.
What should I do next? What am I missing?
I suppose you installed the newest version of GPUmat, which is a 32 bit version, and hence there is the warning. Maybe it would help to download an older version of GPUmat, which is made for 64 bit systems. I tried it myself and at least I don't get the warning anymore. Instead I have the problem that some DLL files are not found (Invalid MEX-file
'..\GPUmat\win64\bin\GPUfullInfo.mexw64': not found). You could still give it a try and see if it works for you.
I'm trying to make http://iridia.ulb.ac.be/~manuel/hypervolume (version 2.0) on windows using the instructions they've given in their README which is to install MINGW and run "make mex", however I keep getting this error:
$ make mex
mex -D VARIANT=4 Hypervolume_MEX.c hv.c
mex.exe: Invalid command-line option
mex.exe: Data: unknown option
make: *** [mex] Error 1
instructions given:
Guillaume Jacquenot contributed a MEX interface for MATLAB
(Hypervolume_MEX.c). Use make mex to compile it.
Any help would be appreciated thank you
Within matlab change directories to the location of the hypervolume code, then run
mex -DVARIANT=4 Hypervolume_MEX.c hv.c avl.c
at the matlab command prompt. If your c compiler is set up correctly within matlab this should generate an executable named Hypervolume_MEX.xxx (dll in my case).
edit
I used the matlab compiler (Lcc C 2.4) on Matlab 7. No luck with Visual Studio 6 or Watcom 10.6 compilers (although I did not attempt to debug).