MEX Build Failed "Build error: C++ compiler produced errors."

I'm currenty trying to follow the tutorial supplied by MathWorks to use GPU Coder and I keep receiving "MEX Build Failed" Errors. Below is the build log:
[1/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count_data.cu -o build\win64\mandelbrot_count_data.obj
FAILED: build/win64/mandelbrot_count_data.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count_data.cu -o build\win64\mandelbrot_count_data.obj
CreateProcess failed: The system cannot find the file specified.
[2/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" rt_nonfinite.cu -o build\win64\rt_nonfinite.obj
FAILED: build/win64/rt_nonfinite.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" rt_nonfinite.cu -o build\win64\rt_nonfinite.obj
CreateProcess failed: The system cannot find the file specified.
[3/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count_terminate.cu -o build\win64\mandelbrot_count_terminate.obj
FAILED: build/win64/mandelbrot_count_terminate.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count_terminate.cu -o build\win64\mandelbrot_count_terminate.obj
CreateProcess failed: The system cannot find the file specified.
[4/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count.cu -o build\win64\mandelbrot_count.obj
FAILED: build/win64/mandelbrot_count.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count.cu -o build\win64\mandelbrot_count.obj
CreateProcess failed: The system cannot find the file specified.
[5/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count_initialize.cu -o build\win64\mandelbrot_count_initialize.obj
FAILED: build/win64/mandelbrot_count_initialize.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" mandelbrot_count_initialize.cu -o build\win64\mandelbrot_count_initialize.obj
CreateProcess failed: The system cannot find the file specified.
[6/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" interface\_coder_mandelbrot_count_mex.cu -o build\win64\_coder_mandelbrot_count_mex.obj
FAILED: build/win64/_coder_mandelbrot_count_mex.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" interface\_coder_mandelbrot_count_mex.cu -o build\win64\_coder_mandelbrot_count_mex.obj
CreateProcess failed: The system cannot find the file specified.
[7/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" cpp_mexapi_version.cpp -o build\win64\cpp_mexapi_version.obj
FAILED: build/win64/cpp_mexapi_version.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" cpp_mexapi_version.cpp -o build\win64\cpp_mexapi_version.obj
CreateProcess failed: The system cannot find the file specified.
[8/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" interface\_coder_mandelbrot_count_api.cu -o build\win64\_coder_mandelbrot_count_api.obj
FAILED: build/win64/_coder_mandelbrot_count_api.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" interface\_coder_mandelbrot_count_api.cu -o build\win64\_coder_mandelbrot_count_api.obj
CreateProcess failed: The system cannot find the file specified.
[9/10] nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" interface\_coder_mandelbrot_count_info.cu -o build\win64\_coder_mandelbrot_count_info.obj
FAILED: build/win64/_coder_mandelbrot_count_info.obj
nvcc -c -rdc=true -Xcompiler "/wd 4819" -Xcompiler "/MD" -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -I "." -I "C:\Users\matth\OneDrive\Desktop\Test" -I ".\interface" -I "C:\Program Files\MATLAB\R2020b\extern\include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=mandelbrot_count_mex -DMW_NEEDS_VERSION_H -arch sm_35 -I "C:\Program Files\MATLAB\R2020b/simulink/include" -I "C:\Program Files\MATLAB\R2020b/toolbox/shared/simtargets" interface\_coder_mandelbrot_count_info.cu -o build\win64\_coder_mandelbrot_count_info.obj
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.
??? Build error: C++ compiler produced errors. See the Build Log
for further details.
Code generation failed: View Error Report
Thank you for all the help!

5 commentaires

Are you in a directory where you do not have permission to create subdirectory build and build\win64 ?
Matthew Currie
Matthew Currie le 25 Jan 2021
Modifié(e) : Matthew Currie le 25 Jan 2021
@Walter RobersonI'll try changing the folders directory and see if that yields any different results. But the data was inside a folder in the desktop. Is there a directory that you would recommend moving it to.
Walter Roberson
Walter Roberson le 26 Jan 2021
Modifié(e) : Walter Roberson le 26 Jan 2021
Desktop should generally be okay.
It might plausibly help to create build\ and build\win64\ folders ahead of time in the directory.
If changing to other writeable folders results in the same issue, please reach out to MathWorks Technical Support.
Marin Genov
Marin Genov le 30 Août 2021
Modifié(e) : Marin Genov le 30 Août 2021
I just found out about this post. It appears that I am having the same issue with R2021a. Was the problem ever resolved? And if yes, what was the solution?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Get Started with GPU Coder dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by