目前我正在尝试为 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
标志(有关其他可能适用的 vfp 变体,请参阅 gcc 手册页)。
如果您的平台不支持硬浮点 ABI,或者您的处理器没有浮点单元,则不能使用这两个库。
关于c++ - libOpenCL.so 使用 VFP 寄存器参数,输出不,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22989766/