You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
mex giving error in Matlab R2015a
2 views (last 30 days)
Show older comments
MatlabR2015a in Windows10 Pro (Version 10.0.14393)
>> mex FGG_Convolution1D.c
Building with 'lcc-win32'.
Error using mex
Writing library for FGG_Convolution1D.mexw32.
Since 12 hours, i tried everything with no success. I already had install SDK, but after did not work, uninstall it. Now i have installed Microsift NET Framework 4.62 SDK and Microsift NET Framework 4.62 Targeting Pack, (not work, too). I also have installed MATLAB Runtime 8.5. I download NUFFT codes but do not work (even for FORTRAN).
I have very little expirience with compiling. If somebody can help me , must explaine very detailed and step by step.
My goal is to make a Non Uniform Fast Fourier Analysis.
Thanks
11 Comments
Riccardo Scorretti
on 22 Apr 2022
Can you post the source code and a simple program to test it, so that we can try to compile it?
Kraka Doros
on 22 Apr 2022
Hi Riccardo.
Do you mean, the source code of the Non Uniform Fast Fourier Analysis ? I have download from here :
I put what i received (after unziped) in the installation folder of Matlab (in the" bin" subfolder).
May be i did not explain exactly what i was tried to do.
I have input a two columns data, first for time and second for values. Then (after i used table2aray and define the first column to be time and second to be value) i wrote :
nufft(value,time)
and then i received this :
Undefined function or variable 'nufft'.
Did you mean:
>> fft(value,time)
Then i read that in Matlab2015, does not include the nufft, so i download the code from th above link. But when i try to make
mex FGG_Convolution1D.c, as described in the link, i received :
Building with 'lcc-win32'.
Error using mex
Writing library for FGG_Convolution1D.mexw32.
Can i use Non Uniform Fourier Transform analysis, with MatlabR2015a ? My PC is X32bit, and i think i can not use any newer Matlab version (that include nufft), because as i read Matlab2015 was the last version for x32 architecture based machines.
Benjamin Thompson
on 22 Apr 2022
The instructions with NUFFT say that the C code is meant to be compiled by mex directly. Can you do mex -v FGG_Convolution1D.c and provide the output of the verbose compile? Did you run "mex -setup C" successfully?
Kraka Doros
on 22 Apr 2022
Edited: Kraka Doros
on 22 Apr 2022
OK. Thanks for help.
I did mex -v FGG_Convolution1D.c and i received these :
>> mex -v FGG_Convolution1D.c
Verbose mode is on.
Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require the use of
-largeArrayDims and remove the -compatibleArrayDims option.
For more information:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
... Looking for compiler 'lcc-win32' ...
... Looking for folder 'C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc' ...Yes.
Found installed compiler 'lcc-win32'.
Set PATH = C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\bin;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include\win32\;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\lib\win32;C:\Program Files\Windows Kits\10\Windows Performance Toolkit\;C:\Users\ΑρχιμήδηςAeroSpaceProjectJapan\AppData\Local\Microsoft\WindowsApps;
Set INCLUDE = C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include;;
Set LIB = C:\Program Files\MATLAB\MATLAB Production Server\R2015a\lib\win32;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc;;
Set LIBPATH = C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\lib\;C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex;
Options file details
-------------------------------------------------------------------
Compiler location: C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc
Options file: C:\Users\ΑρχιμήδηςAeroSpaceProjectJapan\AppData\Roaming\MathWorks\MATLAB\R2015a\mex_C_win32.xml
CMDLINE100 : lcc -c -noregistrylookup -DMX_COMPAT_32 -DMX_COMPAT_32 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex" "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c" -DNDEBUG /FoC:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.obj
CMDLINE101 : lcc -noregistrylookup -DMX_COMPAT_32 -DMX_COMPAT_32 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -DMATLAB_MEX_FILE "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex\lccstub.c" /Fo"FGG_Convolution1Dlib2.obj"
CMDLINE200 : "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\bin\lcclnk" -o FGG_Convolution1D.mexw32 -dll "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc\mexFunction.def" -L"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\lib" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\lib\win32" "FGG_Convolution1Dlib2.obj" -s C:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.obj libmx.lib libmex.lib libmat.lib
CMDLINE300 : del "FGG_Convolution1Dlib2.obj" C:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.obj FGG_Convolution1D.lib FGG_Convolution1D.exp
COMPILER : lcc
COMPFLAGS : -noregistrylookup -DMX_COMPAT_32 -DMX_COMPAT_32 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex"
COMPDEFINES : -DMX_COMPAT_32 -DMX_COMPAT_32 -DMATLAB_MEX_FILE
MATLABMEX : -DMATLAB_MEX_FILE
OPTIMFLAGS : -DNDEBUG
INCLUDE : -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex"
DEBUGFLAGS : -g4
LINKER : "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\bin\lcclnk"
LINKFLAGS : -o FGG_Convolution1D.mexw32
LINKEXPORT : -dll "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc\mexFunction.def"
LINKTYPE : -dll
LINKLIBS :
LLIBS : libmx.lib libmex.lib libmat.lib
LINKLIBPATH : -L"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\lib" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\lib\win32"
LINKDEBUGFLAGS :
LINKOPTIMFLAGS : -s
OBJEXT : .obj
LDEXT : .mexw32
SETENV : set COMPILER=lcc
set COMPFLAGS=-c -noregistrylookup -DMX_COMPAT_32 -DMX_COMPAT_32 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex"
set OPTIMFLAGS= -DNDEBUG
set DEBUGFLAGS=-g4
set LINKER="C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\bin\lcclnk"
set LINKFLAGS= -dll "%MATLAB%\extern\lib\win32\lcc\%ENTRYPOINT%.def" -L"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\lib" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\lib\win32" "%LIB_NAME%2.obj"
set LINKFLAGSPOST=libmx.lib libmex.lib libmat.lib
set LINKDEBUGFLAGS=
set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%"
LCCROOT : C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc
MATLABROOT : C:\Program Files\MATLAB\MATLAB Production Server\R2015a
ARCH : win32
SRC : "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c"
OBJ : C:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.obj
OBJS : C:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.obj
SRCROOT : C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D
DEF : C:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.def
EXP : FGG_Convolution1D.exp
LIB : FGG_Convolution1D.lib
EXE : FGG_Convolution1D.mexw32
ILK : FGG_Convolution1D.ilk
MANIFEST : FGG_Convolution1D.mexw32.manifest
TEMPNAME : FGG_Convolution1D
EXEDIR :
EXENAME : FGG_Convolution1D
OPTIM : -DNDEBUG
LINKOPTIM : -s
-------------------------------------------------------------------
Building with 'lcc-win32'.
lcc -c -noregistrylookup -DMX_COMPAT_32 -DMX_COMPAT_32 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex" "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c" -DNDEBUG /FoC:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.obj
lcc preprocessor warning: C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c:161 No newline at end of file
Warning C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c: 62 local `int R' is not referenced
Warning C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c: 62 local `int ind' is not referenced
Warning C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c: 61 local `double V1i' is not referenced
Warning C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c: 61 local `double V1r' is not referenced
Warning C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin\FGG_Convolution1D.c: 59 local `int l2' is not referenced
0 errors, 6 warnings
lcc -noregistrylookup -DMX_COMPAT_32 -DMX_COMPAT_32 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\simulink\include" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex" -I"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\include" -DMATLAB_MEX_FILE "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\mex\lccstub.c" /Fo"FGG_Convolution1Dlib2.obj"
"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\bin\lcclnk" -o FGG_Convolution1D.mexw32 -dll "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc\mexFunction.def" -L"C:\Program Files\MATLAB\MATLAB Production Server\R2015a\sys\lcc\lib" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\lib\win32\lcc" -libpath "C:\Program Files\MATLAB\MATLAB Production Server\R2015a\lib\win32" "FGG_Convolution1Dlib2.obj" -s C:\Users\85DF~1\AppData\Local\Temp\mex_187568925875188_9908\FGG_Convolution1D.obj libmx.lib libmex.lib libmat.lib
Error using mex
Writing library for FGG_Convolution1D.mexw32
>>
With first view i understand nothing. If somebody teach me, i will understand where is the problem, if there is.
I also make ,(as you told me), mex -setup C. As i told in my previous comment i had install SDK, and after it, i show as option the SDK compiler, choose it but did not help. Now, that i uninstalled it, i do not see it as an option. I see only lcc-win32 and a compiler in FORTRANT. The compiler in FORTRANT do not work at all (receiving error message).
Bruno Luong
on 22 Apr 2022
Stupid question, but do you have the write access to the folder where you want to build the mexw32 file?
Kraka Doros
on 22 Apr 2022
Edited: Kraka Doros
on 22 Apr 2022
Bruno hi.
As i told somewhere before, i have no big expirience with compilers, but from your question, (s.. or not), i understand that in the proccessing of compiling the FGG_Convolution1D.c , i can determine-choose the folder where i want to build the mexw32 file. If you tell me how i can do this, i will tel you if i have the write access to this file.
I have no idea how to determine this folder. I only learn the command need to compile the FGG_Convolution1D.c.
Do you mean, the folder "bin" (C:\Program Files\MATLAB\MATLAB Production Server\R2015a\bin) where i placed the nufft codes that i had download ? I have the write access to this folder, as i have the write access in all folders in my PC.
But, do you mean something else ? Because i have noticed that there is (in Matlab interface) a window named "current folder", and when i place my cursor over the file contains the nufft codes (showing in this "current folder" window), i receive a message :
"This folder is not in your Matlab path. Double click it to make it your current folder or select "add to path" from its context menu".
So i double click it, but nothing hapened..
Bruno Luong
on 22 Apr 2022
Edited: Bruno Luong
on 22 Apr 2022
You cannot write the file where you want, this is system protection to prevent user to erase important system file.
You have you document folder where you should store your stuffs. This is not specific to MATLAB compiler but Windows OS.
To put the output where you want, use
mex -o ...
option. Alternatively you can also move/copy the c file to your own folder, where you are allowed to write files, cd there before invoke mex command.
Kraka Doros
on 24 Apr 2022
Edited: Kraka Doros
on 24 Apr 2022
Can, anybody, help solve this problem ?
Thanks.
Kraka Doros
on 25 Apr 2022
Problem, half Solved. As Bruno Luong, talked about "the write access to the folder where you want to build the mexw32 file", i search if the files were in a wrong folder and , they were.
So after i made "mex FGG_Convolution1D.c", i received :
>> mex FGG_Convolution1D_type2.c
Building with 'lcc-win32'.
MEX completed successfully.
Well, after that, i create a sin function (x) over non uniform time intervals, but when i made : X=nufft(x)
i received this error message :
>> X=nufft(x);
Undefined function or variable 'nufft'
Anybody can help ?
Kraka Doros
on 1 May 2022
Finaly i was able to use the FGG_1d_type1, but i am not sure if i used it correct. Can somebody tell me how to use it ? My question is this :
I have 32 samples arrived from a sin function over 32 points of un-uniform time intervals. FGG_1d_type1 has as inputs, "f", "knots", "N" and optional, "accourancy" and "GridListX".
What is the correspondence, between my data and "f", "knots", "N", "accourancy" and "GridListX" ?
I know that, this is described analytic in the overview, but English is not my lanquage, and i have a difficult to understand, as also i am new in the NUFFT, and i need help.
So far, i used as "f" : the 32 samples arrived from the sin function, as "knots" : the 32 points of un-uniform time intervals, as "N" : the number 32, and as "accourancy" the number 4. For "GridListX", nothing, because i completly cannot imagine or assume, what is it.
Bruno Luong
on 1 May 2022
Such question seems to be more appropriate to be directed to whom ever the author of the code.
Here most of us don't kwow this code (I guess) I can't answer how to use it.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)