libOpenCL.so使用VFP寄存器参数,而输出不使用

libOpenCL.so uses VFP register arguments, output does not

本文关键字:输出 参数 so 使用 VFP 寄存器 libOpenCL      更新时间:2023-10-16

目前我正在尝试为ARM架构构建Buddhabrot但当我出现以下错误时,我陷入了困境。我希望有人能帮忙。

libOpenCL.so uses VFP register arguments, output does not
libGAL.so uses VFP register arguments, output does not

这是我的makefile

LIBS = -lm -lOpenCL -lGAL -lGL -lGLEW -lglut -lpthread
CFLAGS = -Wall -g
OBJECTS = main.o environment.o input.o animate.o buddhabrot.o buddhacl.o cmodules/timer.o
all: prog
prog: $(OBJECTS)
    c++ $(CFLAGS) -o prog $(OBJECTS) $(LIBS)
%.o: %.cpp $(LIBS)
clean:
    rm -f *.o prog cmodules/*.o

c++-v输出

Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.6.1/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-    bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --    prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-float=softfp --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabi --host=arm-    linux-gnueabi --target=arm-linux-gnueabi
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) 

这告诉您libOpenCL.so和libGAL.so使用的是硬浮点和VFP单元,但您的程序被编译为使用软浮点的程序。

使用-mfloat-abi=hard标志,也可能使用-mfpu=vfp标志(请参阅gcc手册页,了解可能适用的其他vfp变体)。

如果您的平台不支持硬浮点ABI,或者您的处理器没有浮点单元,则不能使用这两个库。

您的交叉编译器不支持硬浮点,请尝试arm-linux-gnueabihf,它对我有效。