Reputation: 341
I had an error when I install gputools
in R, and I cannot find any solution by google.
I use command 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’
Can someone help me here? My gpu cards is given by
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GL [Quadro K620] (rev a2)
Upvotes: 4
Views: 1299
Reputation: 783
It seems that your makefile has a typo
-Wp,-D_FORTIFY_SOURCE=2
Specifically, the comma (',') should be a space (' ') only.
Please try that and report back letting us know what happened
Upvotes: -1
Reputation: 9934
Ok, I got this working with a couple hacks. This is for centos 7.
First issue was solved by looking at the mailing list. https://github.com/nullsatz/gputools/issues/12
Edit the Makefile, and Modify line '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=generic
Second problem was that the R shared lib was not being found. I tried setting the LD_LIBRARY_PATH in the driver configuration file, and on the command line, but that did not work.
I ended up with the following hack:
cd /usr/local/cuda/lib64 && ln -s /usr/lib64/R/lib/libR.so libR.so
I used the command following to build (note the tar.gz file now contains the modified Makefile)
R CMD INSTALL --configure-args="--with-nvcc=/usr/local/cuda/bin/nvcc --with-r-lib=/usr/lib64/" ./gputools_1.0.tar.gz
I know this is ugly, but it seems to work.
Upvotes: 4