From: open...@googlegroups.com [mailto:open...@googlegroups.com]
On Behalf Of ruka
Sent: Tuesday, February 06, 2018 7:17 AM
To: open-amp <open...@googlegroups.com>
Subject: [open-amp] Cross compile Libmetal for ARM64 Linux
Hi Guys,
now I am building Linux with Openamp and libmetal in it for arm64 using Buildroot,which will run on A53. So I want to cross compile the libmetal first on my PC Ubuntu, then pack them into rootfs. My toolchain file is as follows:
set (CMAKE_SYSTEM_PROCESSOR "aarch64" CACHE STRING "")
set (MACHINE "zynqmp_a53" CACHE STRING "")
set (CROSS_PREFIX "aarch64-linux-gnu-" CACHE STRING "")
set (CMAKE_C_FLAGS "" CACHE STRING "")
include (cross-linux-gcc)
# vim: expandtab:ts=2:sw=2:smartindent
But whenever I take this "cmake /home/rk/libmetal -DCMAKE_TOOLCHAIN_FILE=/home/rk/libmetal/cmake/platforms/zynqmp-a53-linux.cmake" in the terminal, the result always shows like below:
rk@ubuntu:~/libmetal/build$ cmake /home/rk/libmetal -DCMAKE_TOOLCHAIN_FILE=/home/rk/libmetal/cmake/platforms/zynqmp-a53-linux.cmake
-- Build type: Debug
-- Host: Linux/x86_64
-- Target: Linux/aarch64
-- Machine: zynqmp_a53
-- Could NOT find LIBSYSFS (missing: LIBSYSFS_LIBRARY)
[Wendy] libmetal uses libsysfs functions to access sysfs, you will need to build libsysfs
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find LibRt (missing: LIBRT_LIBRARIES)
[Wendy] libmetal uses librt for shm_open(), you will need to build librt too
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindLibRt.cmake:36 (find_package_handle_standard_args)
cmake/depends.cmake:22 (find_package)
CMakeLists.txt:15 (include)
-- Configuring incomplete, errors occurred!
See also "/home/rk/libmetal/build/CMakeFiles/CMakeOutput.log".
See also "/home/rk/libmetal/build/CMakeFiles/CMakeError.log".
Does anybody know why? I have installed libsysfs lib in my PC Ubuntu.
[Wendy] As you are building the libmetal for A53, you will need to build libsysfs and librt for A53
Best Regards,
Wendy
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups "open-amp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
open-amp+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Wendy,thanks a lot for your reply. Besides the sysfs and rt, what about the hugetlbfs? Should I also build it for A53. I downloaded it from the git https://github.com/libhugetlbfs/libhugetlbfs. Whenever I run the make command, the results show as below. Should that be some problems with the Makefile? Thanks!
[Wendy] From the log, I didn’t see your buildroot sysroot has been added to the include path, you can try cmake -DCMAKE_INCLUDE_PATH=”=/home/ruka/openamp/install/libmetal/usr/local/include;<path_to_where_sysfs/libsysfs.h_is>”
Best Regards,
Wendy
Hi Wendy,
All -I am using a Xilinx ZU27 RFSoC in my design and need to cross compile the metal library for the 64-bit A53 ARM processor running Petalinux. This is needed so that I can use the Xilinx RFdc driver, which is built atop metal. Would you be so kind as to distill the instructions to accomplish this into a post in this thread? I am having difficulty understanding the process from the myriad posts in this thread, some of which have been deleted.
From: open...@googlegroups.com [mailto:open...@googlegroups.com]
On Behalf Of James Henderson
Sent: Sunday, March 10, 2019 8:55 AM
To: open...@googlegroups.com
Subject: Re: [open-amp] Cross compile Libmetal for ARM64 Linux
Wendy -
Thank you for responding.
Since my previous post, I have generated SDK files using petalinux-build --sdk. This creates a new subtree in <petalinux-proj>/build/tmp/sysroots-components/aarch64 that contains numerous target headers and libraries (including libmetal and libsysfs). Judicious inclusion of these in addition to the RFdc source allows my target ZU27 example code to successfully build and link. So, it appears that cross-development of code employing the RFdc library code is possible.
Unfortunately, I was forced to employ a work-around. The RFdc library uses function metal_linux_get_device_property() which is not present in the --sdk build of the Petalinux libmetal library (libmetal.a). I was forced to copy the source code for this function into my copy of the RFdc source code which called that function in order to generate the .elf executable.
[Wendy] function “metal_linux_get_device_property()” is from libmetal library. Not sure if it is due to the library is not got successfully linked to your application.
You can login Xilinx support portal https://www.xilinx.com/support.html#serviceportal to raise the issue
Is this overall approach the most efficient to utilize the RFdc driver under Linux? If not, please direct me to a link or documentation which details the preferred approach to cross-development of Linux applications code using the RFdc library.
[Wendy] I don’t think you need to copy the source code to compile your driver. I am not clear on how the “petalinux-build –sdk” work. I think it will generate a sysroot includes all the devel packages. And I think it should be sufficient to use to compile the RFdc driver. Please raise this issue with Xilinx support portal.
Thanks,
Wendy
Jim
Wendy -


