mex giving error in Matlab R2015a
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Riccardo Scorretti
2022-4-22
Can you post the source code and a simple program to test it, so that we can try to compile it?
Kraka Doros
2022-4-22
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
2022-4-22
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
2022-4-22
编辑:Kraka Doros
2022-4-22
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
2022-4-22
Stupid question, but do you have the write access to the folder where you want to build the mexw32 file?
Kraka Doros
2022-4-22
编辑:Kraka Doros
2022-4-22
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
2022-4-22
编辑:Bruno Luong
2022-4-22
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
2022-4-25
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
2022-5-1
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
2022-5-1
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.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)