安装 gputools
时出现错误在 R 中,我无法通过 google 找到任何解决方案。
我使用命令 install.packages("gputools")
/usr/local/cuda/bin/nvcc -c -Xcompiler "-fpic -I/usr/local/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic" -I. -I"/usr/local/cuda/include" -I"/usr/lib64/R/include" rinterface.cu -o rinterface.o
gcc: error: unrecognized command line option ‘-Wp’
make: *** [rinterface.o] Error 1
ERROR: compilation failed for package ‘gputools’
有人可以在这里帮助我吗?我的 GPU 卡是由
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GL [Quadro K620] (rev a2)
最佳答案
好的,我通过一些技巧来解决这个问题。这是针对centos 7的。
通过查看邮件列表解决了第一个问题。 https://github.com/nullsatz/gputools/issues/12
编辑 Makefile,并修改行 'CFLAGS : put '\' after 'Wp' & before ','
CFLAGS = -O2 -g -pipe -Wall -Werror=format-security -Wp\,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches - m64 -mtune=通用
第二个问题是没有找到 R 共享库。我尝试在驱动程序配置文件和命令行中设置 LD_LIBRARY_PATH,但这不起作用。
我最终得到了以下黑客:
cd/usr/local/cuda/lib64 && ln -s/usr/lib64/R/lib/libR.so libR.so
我使用以下命令进行构建(注意 tar.gz 文件现在包含修改后的 Makefile)
R CMD 安装 --configure-args="--with-nvcc=/usr/local/cuda/bin/nvcc --with-r-lib=/usr/lib64/"./gputools_1.0.tar.gz
我知道这很丑陋,但它似乎有效。
关于R gputools : gcc: error: unrecognized command line option ‘-Wp’ ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36832966/