I tried to compile the mlpack on the PYNQ-Z1 platform using v2.4 image. However, it ends up with the over 94% DRAM usage and then gets stuck.
After googling, I find a possible solution which uses a cross-compiler to cross-compile mlpack on separate laptop and then copy the compiled libraries over PYNQ-Z1.
Do you have any comment for the resolution ?
Also, I never use cross-compile and I don’t know where I can download the officially supplied cross-compiler. Would you please guide me on what I should download? The target platform is to use PYNQ Z1 v.2.4 image to run.
This is software only, so you need to cross compile for the Zynq processor - the ARM Cortex A9 rather than for “Zynq”. If you google for instructions for cross compiler to ARM, you should be able to find what you need.
E.g. compiling - How to cross compile for ARM? - Ask Ubuntu
I misunderstood I should download Xilinx SDK for cross-compile in the first place.
However, I have one more question. As I understand, PYNQ image v2.4 is built by Xilinx tool 2018.3. From the cross compile for the PNQ v2.4, does it mean I should use the same version of cross compile tool (arm-linux-gnueabihf-) in Xilinx tool 2018.3 ? Or the version of arm-linux-gnueabihf- doesn’t need to match the version used to build the PYNQ v.2.4 image.
If you ever tried our sdbuild flow, you will already have a qemu environment which helps you cross-compile your code. In general Xilinx tools are not required in the qemu, so for your question, the gcc version does not have to match exactly what Xilinx tools are using.
I really appreciate for your valuable comment. However, I don’t know what the sdbuild flow you mentioned. Would you please also provide me some pointer for the sdbuild flow ?
Assume I can use the sdbuild flow. What I should do is to copy the same mlpack source code with makefile over the sdbuild flow on the laptop, after running the flow, I can get the cross compiled library to use in the PYNQ-Z1 v2.4 platform. Is it correct ?
The sdbuild flow is the make process that can be run inside PYNQ_REPO/sdbuild folder. There are many documentations on that. Essentially it is creating an ARM environment on your X86 machine.
Yes you can compile source codes on your qemu environment. The experience is the same as you are running codes on your arm processor, but with larger RAM size. The compiled library is compatible with your Z1 platform so you can directly copy it over and use that on your board.