Halide-lang AOT とクロス コンパイルのチュートリアルを使用しようとしています。私がやりたいことは、Cortex A9 組み込み Linux ターゲット用の Halide プログラムをクロス AOT コンパイルすることです。
次の変更を加えて、lesson_11_cross_compilation.cpp を修正しました。
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);
これを、lesson_11_cross_compilation.cpp ファイルの先頭にリストされている g++ コマンドでコンパイルします。これにより、lession_11 実行可能ファイルが生成されます。実行可能ファイルを実行すると、lesson_11_arm_32_linux.h/o ファイルが生成されます。
次に、そのファイルに対してクロス コンパイラを実行し、次のコマンド ラインを使用してターゲット用のプログラムを生成しようとします。
/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: エラー: lesson_11_arm_32_linux.o は VFP レジスタ引数を使用し、テストはしない /opt/Xilinx/SDK/2014.2/gnu/arm/lin/bin/../lib/gcc/arm-xilinx -linux-gnueabi/4.8.1/../../../../arm-xilinx-linux-gnueabi/bin/ld: ファイル lesson_11_arm_32_linux.o collect2 のターゲット固有のデータをマージできませんでした: エラー: ld が返されました1 終了ステータス
Halide は VFP を使用するコードを生成しているようです。-mfpu オプションと -mfloat-abi=softfp、soft、および hard を変更してみました。何も機能しません。特定のタイプの FPU 命令を生成するように Halide を構成する方法はありますか?