Error in generating code with custom FFT library in Matlab Coder
10 次查看(过去 30 天)
显示 更早的评论
I downloaded the latest FFTW library from their website, I built the wrapper class for custom FFT library and executed the coder.
The Matlab coder returns several compilation errors.
Which means that the generated code doesn't compile.
I'm giving here a code example. In order to replicate the problem you'll need to download the FFTW library
Here is the Foo() function I'm trying to compile
function [voxelAfterFFT] = Foo()
v = single(magic(16));
voxel = repmat(v,1,1,16);
voxelAfterFFT = fftn(voxel);
end
Here is the custom FFT class I build
%#codegen
classdef CustomWFFTLibrary < coder.fftw.StandaloneFFTW3Interface
methods (Static)
function th = getNumThreads
coder.inline('always');
th = int32(coder.const(1));
%% Shahar Sar Shalom
% TODO: Insert number of threads needed
%% Shahar Sar Shalom
end
function updateBuildInfo(buildInfo, ctx)
fftwLocation = 'D:\ClassifierExample\fftw-3.3.5-dll64';
%includePath = fullfile(fftwLocation, 'include');
includePath = fftwLocation;
buildInfo.addIncludePaths(includePath);
%libPath = fullfile(fftwLocation, 'lib');
libPath = fftwLocation;
%Double
libName1 = 'libfftw3-3.lib';
[~, libExt] = ctx.getStdLibInfo();
libName1 = [libName1 libExt];
addLinkObjects(buildInfo, libName1, libPath, 1000, true, true);
%Single
libName2 = 'libfftw3f-3.lib';
[~, libExt] = ctx.getStdLibInfo();
libName2 = [libName2 libExt];
addLinkObjects(buildInfo, libName2, libPath, 1000, true, true);
end
end
end
Here is the compilation script
%% COMPILE THE CODE INTO C++
cfg = coder.config('dll','ecoder',false);
cfg.GenerateReport = true;
cfg.TargetLang = 'C++';
cfg.MATLABSourceComments = true; %isDebug;
cfg.Verbose = true;
cfg.CustomFFTCallback = 'CustomWFFTLibrary';
%------------------------------- Debugging -----------------------------
%---------------------------- Code Generation --------------------------
cfg.GenCodeOnly = false;
% Value: 'C' | 'C++' Default: 'C'
cfg.TargetLang = 'C++';
% Dynamic memory only since 16MB
cfg.DynamicMemoryAllocationThreshold = 16 * 1024 * 1024;
%% COMPILE TO MEX (NOT NEEDED)
% cfg = coder.config('mex');
% cfg.GenerateReport = true;
% cfg.EnableJIT = true;
%% Invoke MATLAB Coder.
codegen("-config", cfg, "Foo", "-nargout", 1);
During compilation I get these compilation erros:
FFTWApi.cpp(37): error C2440: '=': cannot convert from 'void *' to 'float *'
FFTWApi.cpp(82): error C2664: 'void fftwf_execute_dft(const fftwf_plan,fftwf_complex (*),fftwf_complex (*))': cannot convert argument 1 from 'void *' to 'const fftwf_plan'
'D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo_rtw.mk' is up to date
### Building 'Foo': nmake -f Foo_rtw.mk all
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" AMD64
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo_data.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo_data.cpp"
Foo_data.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo_initialize.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo_initialize.cpp"
Foo_initialize.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo_terminate.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo_terminate.cpp"
Foo_terminate.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo.cpp"
Foo.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"magic.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\magic.cpp"
magic.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"mod.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\mod.cpp"
mod.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"repmat.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\repmat.cpp"
repmat.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fix.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fix.cpp"
fix.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fftn.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fftn.cpp"
fftn.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fft.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fft.cpp"
fft.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fft1.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fft1.cpp"
fft1.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"FFTWApi.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp"
FFTWApi.cpp
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(37): error C2440: '=': cannot convert from 'void *' to 'float *'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(37): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(43): error C2440: '=': cannot convert from 'void *' to 'fftwf_complex (*)'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(43): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(44): error C2664: 'void fftwf_execute_dft_r2c(const fftwf_plan,float *,fftwf_complex (*))': cannot convert argument 1 from 'void *' to 'const fftwf_plan'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(44): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(75): error C2440: '=': cannot convert from 'void *' to 'fftwf_complex (*)'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(75): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(81): error C2440: '=': cannot convert from 'void *' to 'fftwf_complex (*)'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(81): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(82): error C2664: 'void fftwf_execute_dft(const fftwf_plan,fftwf_complex (*),fftwf_complex (*))': cannot convert argument 1 from 'void *' to 'const fftwf_plan'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(82): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.
------------------------------------------------------------------------
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" AMD64
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo_data.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo_data.cpp"
Foo_data.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo_initialize.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo_initialize.cpp"
Foo_initialize.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo_terminate.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo_terminate.cpp"
Foo_terminate.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"Foo.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\Foo.cpp"
Foo.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"magic.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\magic.cpp"
magic.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"mod.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\mod.cpp"
mod.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"repmat.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\repmat.cpp"
repmat.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fix.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fix.cpp"
fix.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fftn.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fftn.cpp"
fftn.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fft.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fft.cpp"
fft.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"fft1.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\fft1.cpp"
fft1.cpp
cl /TP -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 -D_WINNT -D_WIN32_WINNT=0x0502 -DNTDDI_VERSION=0x05020000 -D_WIN32_IE=0x0600 -DWINVER=0x0502 -D_MT -MT -EHs -D_CRT_SECURE_NO_WARNINGS /Od /Oy- /openmp -DMODEL=Foo -DHAVESTDIO -DUSE_RTMODEL -Fo"FFTWApi.obj" "D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp"
FFTWApi.cpp
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(37): error C2440: '=': cannot convert from 'void *' to 'float *'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(37): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(43): error C2440: '=': cannot convert from 'void *' to 'fftwf_complex (*)'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(43): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(44): error C2664: 'void fftwf_execute_dft_r2c(const fftwf_plan,float *,fftwf_complex (*))': cannot convert argument 1 from 'void *' to 'const fftwf_plan'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(44): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(75): error C2440: '=': cannot convert from 'void *' to 'fftwf_complex (*)'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(75): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(81): error C2440: '=': cannot convert from 'void *' to 'fftwf_complex (*)'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(81): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(82): error C2664: 'void fftwf_execute_dft(const fftwf_plan,fftwf_complex (*),fftwf_complex (*))': cannot convert argument 1 from 'void *' to 'const fftwf_plan'
D:\git\PointsCloudClassification\DeepLearningMatlab\VoxelClassificationProcess\Classifier\ClassifierExample\codegen\dll\Foo\FFTWApi.cpp(82): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.
Error(s) encountered while building "Foo":
### Failed to generate all binary outputs.
0 个评论
采纳的回答
Ryan Livingston
2018-11-13
This is a bug in the generated code:
As shown in the bug report, it was fixed for R2017b_update5 and R2018a.
If you are unable to update, then generating C code will work around the issue.
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Programming and Mixed-Integer Linear Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!