我正在尝试在Ubuntu 16.04 LTS ppc64le(IBM POWER8)上安装gpuR,但遇到了错误,该错误表示" vector'没有命名类型"。
你能帮助我吗?任何评论都会非常感激。
> install.packages("gpuR")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://ftp.iitm.ac.in/cran/src/contrib/gpuR_1.2.1.tar.gz'
Content type 'application/x-gzip' length 451127 bytes (440 KB)
==================================================
downloaded 440 KB
...
** package ‘gpuR’ successfully unpacked and MD5 sums checked
OPENCL_FLAGS not set, using default -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -
DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120
Linux OS
found OpenCL library
Checking OpenCL C++ API
OPENCL_INC not set, using default include directory /usr/include
No OpenCL C++ API found, will use the headers contained in the package
*********** Generated Makevars file ***********
CXX_STD=CXX11
PKG_CPPFLAGS=-I../inst/include -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -
DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_HPP_TARGET_OPENCL_VERSION=120 -
I'/usr/include/' -I. -pthread
PKG_CXXFLAGS=
PKG_LIBS=-lOpenCL
BUILD_LIB=
$(SHLIB): $(BUILD_LIB)
../inst/include/loader/libOpenCL.a:
cd ../inst/include/loader/ && $(MAKE) libOpenCL.a \
CC="$(CC)" CFLAGS="$(ALL_CFLAGS)" AR="$(AR)" RM="$(RM)" \
ICD_OS=icd_linux
***********************************************
** libs
g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I../inst/include -
DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -
DCL_HPP_TARGET_OPENCL_VERSION=120 -I'/usr/include/' -I. -pthread -
I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-
library/RcppEigen/include" -I"/usr/local/lib/R/site-
library/RViennaCL/include" -I"/usr/local/lib/R/site-library/BH/include" -
fPIC -g -O3 -fstack-protector-strong -Wformat -Werror=format-security -
Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I../inst/include -
DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -
DCL_HPP_TARGET_OPENCL_VERSION=120 -I'/usr/include/' -I. -pthread -
I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-
library/RcppEigen/include" -I"/usr/local/lib/R/site-
library/RViennaCL/include" -I"/usr/local/lib/R/site-library/BH/include" -
fPIC -g -O3 -fstack-protector-strong -Wformat -Werror=format-security -
Wdate-time -D_FORTIFY_SOURCE=2 -g -c chol.cpp -o chol.o
In file included from ../inst/include/CL/cl.h:35:0,
from /usr/local/lib/R/site-
library/RViennaCL/include/viennacl/ocl/context.hpp:28,
from /usr/local/lib/R/site-
library/RViennaCL/include/viennacl/ocl/backend.hpp:26,
from chol.cpp:5:
../inst/include/CL/cl_platform.h:390:12: error: ‘vector’ does not name a
type
typedef vector unsigned char __cl_uchar16;
^
../inst/include/CL/cl_platform.h:391:12: error: ‘vector’ does not name a
type
typedef vector signed char __cl_char16;
^
../inst/include/CL/cl_platform.h:392:12: error: ‘vector’ does not name a
type
typedef vector unsigned short __cl_ushort8;
^
../inst/include/CL/cl_platform.h:393:12: error: ‘vector’ does not name a
type
typedef vector signed short __cl_short8;
...
../inst/include/CL/cl_platform.h:1214:5: error: ‘__cl_float4’ does not name
a type
__cl_float4 v4[4];
^
/usr/lib/R/etc/Makeconf:143: recipe for target 'chol.o' failed
make: *** [chol.o] Error 1
ERROR: compilation failed for package ‘gpuR’
* removing ‘/usr/local/lib/R/site-library/gpuR’
The downloaded source packages are in
‘/tmp/RtmpGoy6Af/downloaded_packages’
Warning message:
In install.packages("gpuR") :
installation of package ‘gpuR’ had non-zero exit status
答案 0 :(得分:0)
我通过修改gpuR_1.2.1.tar.gz中包含的cl_platform.h解决了这个特定问题。我只是改变了#34; typedef vector"在下面的" typedef __vector"。
u0017649@sys-87458:~$ wget
https://cran.revolutionanalytics.com/src/contrib/gpuR_1.2.1.tar.gz
u0017649@sys-87458:~$ tar -zxvf gpuR_1.2.1.tar.gz
u0017649@sys-87458:~$ cd gpuR/inst/include/CL
u0017649@sys-87458:~/gpuR/inst/include/CL$ vi cl_platform.h
#include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
typedef vector unsigned char __cl_uchar16;
typedef vector signed char __cl_char16;
typedef vector unsigned short __cl_ushort8;
typedef vector signed short __cl_short8;
typedef vector unsigned int __cl_uint4;
typedef vector signed int __cl_int4;
typedef vector float __cl_float4;