I'm trying to use the Halide-lang AOT and cross compilation tutorials. What I would like to do is cross AOT compile a Halide program for a Cortex A9 embedded Linux target.
I've modified the lesson_11_cross_compilation.cpp with the following changes:
Target target;
target.os = Target::Linux; // The operating system
target.arch = Target::ARM; // The CPU architecture
target.bits = 32; // The bit-width of the architecture
std::vector<Target::Feature> arm_features; // A list of features to set
arm_features.push_back(Target::ARMv7s);
target.set_features(arm_features);
brighter.compile_to_file("lesson_11_arm_32_linux", args, target); // Pass the target as the last argument.
brighter.compile_to_c("lession_11.c", args, "foo", target);
I compile this with the g++ command listed at the top of the lesson_11_cross_compilation.cpp file. This produces the lession_11 executable. I run the executable and I get a lesson_11_arm_32_linux.h/o files.
I then run my cross compiler on that file to try and generate a program for my target using the following command line:
/opt/Xilinx/SDK/2014.2/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-g++ -o test -std=c++11 -lpthread lesson_10_aot_compilation_run.cpp lesson_11_arm_32_linux.o -mfpu=neon-vfpv4 /opt/Xilinx/SDK/2014.2/gnu/arm/lin/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.8.1/../../../../arm-xilinx-linux-gnueabi/bin/ld: error: lesson_11_arm_32_linux.o uses VFP register arguments, test does not /opt/Xilinx/SDK/2014.2/gnu/arm/lin/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.8.1/../../../../arm-xilinx-linux-gnueabi/bin/ld: failed to merge target specific data of file lesson_11_arm_32_linux.o collect2: error: ld returned 1 exit status
It seems Halide generates code that uses the VFP. I've tried changing the -mfpu option and -mfloat-abi=softfp, soft, and hard. Nothing works. Is there a way to configure Halide to generate a certain type of FPU instructions?