mex: link of ' "mexGPUExample.mexa64"' failed
7 ビュー (過去 30 日間)
古いコメントを表示
>> setenv('MW_NVCC_PATH','/usr/local/cuda-5.5/bin/nvcc') >> mex mexGPUExample.cu /usr/lib/x86_64-linux-gnu/libc_nonshared.a(atexit.oS): In function `atexit': (.text+0x12): undefined reference to `__cxa_atexit' collect2: error: ld returned 1 exit status
mex: link of ' "mexGPUExample.mexa64"' failed.
Unable to complete successfully.
>> >>
how to solve it?
0 件のコメント
回答 (3 件)
Joao
2014 年 6 月 26 日
I also have this problem in a linux mint 17 Matlab R2014a cuda5.5 setup. Changing the gcc/g++ version from 4.8 to 4.7.3 did not fix the mex error.
my Matlab output is
///
>> mex -largeArrayDims mexGPUExample.cu
Building with 'nvcc'.
Error using mex
/usr/lib/x86_64-linux-gnu/libc_nonshared.a(atexit.oS): In function `atexit':
(.text+0x12): undefined reference to `__cxa_atexit'
collect2: error: ld returned 1 exit status
///
In matlab, mexing .c and .cpp files works, and in the command line nvcc .cu files works as well.
Any ideas?
0 件のコメント
Jan Barowski
2015 年 2 月 25 日
I got the same error using Matlab 2015 Prerelease on Ubuntu 14.04 with CUDA 6.5 and g++4.8. Thanks to Matlab support we figured out, that manually linking does the trick. Here is my compile script for the matlab mex/gpu example:
myArch = computer('arch'); pathToOpts = fullfile(matlabroot, ... 'toolbox', 'distcomp', 'gpu', ... 'extern', 'src', 'mex', myArch,'gcc',... ['mex_CUDA_' myArch '.xml']); copyfile(pathToOpts,'.','f')
mex -v -largeArrayDims mexGPUExample.cu -lstdc++ -lc
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with GPU Coder についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!