1

我在 MAC OS X 10.9 下下载并安装了以下软件包:

ArrayFire-maci-1.9-20121120.zip

cuda-mac-5.5.28_10.9_64.pkg

成功构建 helloworld 示例后,我得到以下输出:

c++  -m64 -Wall -Werror -I../../include -I/usr/local/cuda/include -O3 -DNDEBUG -L../../lib -laf -lafGFX -L/usr/local/cuda/lib -lcuda -lcudart -lcurand -lcusparse -lpthread -lstdc++ -lm -Wl,-rpath,../../lib,-rpath,/opt/arrayfire/lib,-rpath,/usr/local/cuda/lib

helloworld.cpp -o helloworld

但是,当尝试运行 helloworld 可执行文件时,出现以下错误:

./helloworld 
dyld: Library not loaded: @rpath/libcufft.5.5.dylib
  Referenced from: /opt/arrayfire/lib/libaf.dylib
  Reason: Incompatible library version: libaf.dylib requires version 5.5.0 or later, but libcufft.5.5.dylib provides version 0.0.0
Trace/BPT trap: 5

但是根据 otool 输出,dylib 库的版本是正确的:

otool -L /usr/local/cuda/lib/libcufft.dylib
libcufft.dylib:       @rpath/libcufft.5.5.dylib (compatibility version 0.0.0, current version 5.5.28)     /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)  

/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation(兼容版本 150.0.0,当前版本 635.21.0) /usr/lib/libstdc++.6.dylib
(兼容版本 7.0.0,当前版本 52.0. 0)

有人知道如何克服这个问题吗?

4

1 回答 1

0

您还需要在 .bash_profile 中设置 DYLD_LIBRARY_PATH

export DYLD_LIBRARY_PATH=$AF_PATH/lib:$DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$CUDA_PATH/lib:$DYLD_LIBRARY_PATH
于 2015-04-16T22:41:32.827 回答