在Ubuntu ppc64le上安装gpuR时出现问题

在Ubuntu ppc64le上安装gpuR时出现问题,r,ubuntu,vector,R,Ubuntu,Vector,我试图在Ubuntu16.04 LTS ppc64le(IBMPOWER8)上安装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/co

我试图在Ubuntu16.04 LTS ppc64le(IBMPOWER8)上安装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

我通过修改gpuR_1.2.1.tar.gz中包含的cl_platform.h解决了这个特定的问题。我只是将下面的“typedef向量”改为“typedef__向量”

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_平台.h
#根据编译器的不同,include/*可以省略。AltiVec spec无法检测是否需要报头*/
typedef向量无符号字符16;
typedef向量有符号字符uu cl_uchar16;
typedef向量无符号短uu cl_uushort8;
typedef向量符号短uu cl_u短8;
typedef向量无符号int_uucl_uuint4;
typedef向量符号int_uucl_uint4;
typedef矢量浮点uu cl_u浮点4;

如果您尚未退房,您可能希望在那里提出此问题。谢谢。我也会在那里发布。我收到了gpuR所有者的回复。请参阅
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;