halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.92k stars 1.07k forks source link

how to compile libHalide.so for android armv8a #3296

Open chenjp1998 opened 6 years ago

chenjp1998 commented 6 years ago

by default, libHalide.so is for x86_64,but we want to compile it for android armv8a, how to do it?

abadams commented 6 years ago

First note that you only need to compile libHalide for armv8 if you want to use JIT-compilation on an arm device, which is not a common use case. More likely you want to use AOT compilation, which means that you only compile libHalide.so on x86, and then cross-compile by setting the Halide target appropriately (see the tutorial on generators).

If you do want to JIT on arm, then the usual build procedure should work equally well on arm and x86. We have arm buildbots that run linux, and I compile Halide on it the same way as I do on my linux x86 machine. This is the procedure in the README.

chenjp1998 commented 6 years ago

thanks for your reply, i am porting hdr-plus to android arm64-v8a,and get libHalide.so from halide-arm64-linux-64-trunk-aa5d5514f179bf0ffe1a2dead0c0eb7300b4069a.tgz,but when run it,error occurs as following: HydrogenONE:/ # hdrplus hdrplus WARNING: linker: "/system/lib64/libHalide.so" unused DT entry: type 0x6ffffef6 arg 0x4eed00 WARNING: linker: "/system/lib64/libHalide.so" unused DT entry: type 0x6ffffef7 arg 0x2d69fd8 CANNOT LINK EXECUTABLE "hdrplus": "/system/lib64/libHalide.so" has text relocations Aborted So i want to compile a libHalide.so for android arm64-v8a,but i don't know how to compile it on ubuntu x86-64 computer.With JIT-comilation?can you give me a sample CMakeLists.txt?

chenjp1998 commented 6 years ago

thanks for your reply, i am porting hdr-plus to android arm64-v8a,and get libHalide.so from halide-arm64-linux-64-trunk-aa5d5514f179bf0ffe1a2dead0c0eb7300b4069a.tgz,but when run it,error occurs as following: HydrogenONE:/ # hdrplus hdrplus WARNING: linker: "/system/lib64/libHalide.so" unused DT entry: type 0x6ffffef6 arg 0x4eed00 WARNING: linker: "/system/lib64/libHalide.so" unused DT entry: type 0x6ffffef7 arg 0x2d69fd8 CANNOT LINK EXECUTABLE "hdrplus": "/system/lib64/libHalide.so" has text relocations Aborted So i want to compile a libHalide.so for android arm64-v8a,but i don't know how to compile it on ubuntu x86-64 computer.With JIT-comilation?can you give me a sample CMakeLists.txt?

------------------ Original ------------------ From: "Andrew Adams"notifications@github.com; Date: Mon, Oct 1, 2018 03:33 AM To: "halide/Halide"Halide@noreply.github.com; Cc: "chenjp1998"tony.chen@cloudminds.com; "Author"author@noreply.github.com; Subject: Re: [halide/Halide] how to compile libHalide.so for android armv8a(#3296)

First note that you only need to compile libHalide for armv8 if you want to use JIT-compilation on an arm device, which is not a common use case. More likely you want to use AOT compilation, which means that you only compile libHalide.so on x86, and then cross-compile by setting the Halide target appropriately (see the tutorial on generators).

If you do want to JIT on arm, then the usual build procedure should work equally well on arm and x86. We have arm buildbots that run linux, and I compile Halide on it the same way as I do on my linux x86 machine. This is the procedure in the README.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

hg-wang2015 commented 5 years ago

by default, libHalide.so is for x86_64,but we want to compile it for android armv8a, how to do it?

I also want to compile libHalide.so for android, so did you fix this problem? Could you show me one example CMakeLists.txt if you successed.