pocl icon indicating copy to clipboard operation
pocl copied to clipboard

cross compile build examples

Open georgebola opened this issue 6 years ago • 5 comments

Is there any possible way I can build the examples while cross compiling for arm? -DOCS_AVAILABLE=1 doesnt work.

georgebola avatar Apr 19 '18 13:04 georgebola

I think nobody has tried cross-compiling for ages, it's probably broken. Native build on ARM(64) should just work these days. But you'll have to specify LLVM CPU: cmake -DLLC_HOST_CPU=cortex-a53 replace with whatever CPU you have.

-DOCS_AVAILABLE=1 doesnt work.

what's the error?

franz avatar Apr 19 '18 15:04 franz

I have specified LLVM CPU and all the other parameters and it cross compiles correctly if -DOCS_AVAILABLE=0 , meaning examples and etc. are not being built. But if -DOCS_AVALILABLE=1 does not compiles. The error seems to be with LLVM link.

georgebola avatar Apr 20 '18 08:04 georgebola

The error seems to be with LLVM link.

That usually means you're using a LLVM which wasn't compiled for your system. Are you using LLVM downloaded from llvm.org ?

franz avatar Apr 20 '18 14:04 franz

I'm curious how far you got here, and what exactly you're wanting to do. Were you able to cross compile the pocl libraries for ARM, but just not the examples? I've not been able to cross compile even the libraries with -DOCS_AVAILABLE=1, though it has been a couple of months since I last tried. When you configured pocl with -DOCS_AVAILABLE=1, were you somehow able to give it a cross-compile aware 'llvm-config' (runs on the build machine, but is configured to 'link the target libraries')? My tinkering with the cross LLVM build wasn't able to create this tool, which I think is going to be step 1 to get the pocl cross build working. But maybe you got further than me!

petecoup avatar Apr 20 '18 16:04 petecoup

@petecoup cross compiling is likely entirely broken. @georgebola is slightly mistaken WRT cross-compiling, because -DOCS_AVAILABLE=0 has nothing to do with cross-compilation; it simply compiles pocl without LLVM (natively, not cross), and you'll only be able to use the resulting pocl with clCreateProgramWithBinary().

Cross-compiling would require some work on pocl's CMake scripts, which i'm not too interested in doing since pocl now compiles natively even on low-end machines like Raspberry Pi.

franz avatar Apr 23 '18 12:04 franz