Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64-xilinx-linux-g++ missing, using aarch64-linux-gnu-g++ instead #70

Closed
vmayoral opened this issue May 7, 2021 · 4 comments
Closed

Comments

@vmayoral
Copy link
Contributor

vmayoral commented May 7, 2021

Connected to #69.

The instructions at https://github.com/Xilinx/Vitis-Tutorials/blob/master/Getting_Started/Vitis/Part4.md read as:

...
$(CXX) -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I/usr/include/xrt -lOpenCL -lpthread -lrt -lstdc++
...

cross-compilation wont' work this way since CXX contains the following in my environment with Vitis 2020.2:

echo $CCX
aarch64-xilinx-linux-g++ -march=armv8-a+crc -mtune=cortex-a72.cortex-a53 --sysroot=/tools/Xilinx/Vitis/2020.2/data/emulation/qemu/unified_qemu_v5_0/sysroots/aarch64-xilinx-linux

aarch64-xilinx-linux-g++ is nowhere to be found in my file system. Instead, I used aarch64-linux-gnu-g++ to successfully cross-compile things.

Edit: I was wrong, I did find aarch64-xilinx-linux-g++ after doing a better search.

@randyh62
Copy link
Contributor

randyh62 commented May 7, 2021

I am not sure where this instruction or the $(CXX) variable came from. It seems to be a Makefile variable, but I could not find the environment-setup-aarch64-xilinx-linux script described in the line "source /environment-setup-aarch64-xilinx-linux" in the tutorial. The command, which you found, should be located as follows:

$XILINX_VITIS/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-g++

@rwarmstr
Copy link
Contributor

rwarmstr commented May 7, 2021

${CXX} is an environment variable that's set when you source the cross-compilation environment set up script. That's a necessary step when building on the command line.

It looks like you may not have done this before building and it's picking up the QEMU toolchain instead, which might accidentally work in some circumstances but can cause issues generally.

@vmayoral
Copy link
Contributor Author

vmayoral commented May 7, 2021

With the right changes indicated at #70 (comment) then we're set and the following flow works (I just confirmed it):

setup XRT
cd /home/erle/Desktop/Xilinx; git clone https://github.com/Xilinx/XRT
cd XRT; sudo src/runtime_src/tools/scripts/xrtdeps.sh  # install dependencies
source /tools/Xilinx/Vitis/2020.2/settings64.sh  # necessary for ERT
export PATH="/usr/bin":$PATH  # FIXME: adjust path for CMake 3.5+
cd build; ./build.sh
cd Release; sudo apt-get install ./xrt_*-amd64-xrt.deb
Fetch Vitis-Tutorials
cd ~; git clone https://github.com/Xilinx/Vitis-Tutorials
set environment

Requires to first fetch rootfs and sysroots from here, while putting it into a coherent folder-structure. Then:

cd ~/Vitis-Tutorials/Getting_Started/Vitis/example/zcu102/hw/
source /tools/Xilinx/Vitis/2020.2/settings64.sh
source /opt/xilinx/xrt/setup.sh
unset LD_LIBRARY_PATH
export PLATFORM_REPO_PATHS="/home/erle/Desktop/Xilinx/xilinx_zcu102_base_202020_1"
export ROOTFS=/home/erle/Desktop/Xilinx/rootfs 
source /home/erle/Desktop/Xilinx/rootfs/ir/environment-setup-aarch64-xilinx-linux
build the example
${CXX} -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I/usr/include/xrt -lOpenCL -lpthread -lrt -lstdc++
v++ -c -t hw --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo 
v++ -l -t hw --config ../../src/zcu102.cfg ./vadd.xo -o vadd.xclbin
v++ -p -t hw --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file xrt.ini --package.sd_file app.exe --package.sd_file vadd.xclbin --package.sd_file run_app.sh

I'm having issues getting the kernels "to work" but I'll debug that a bit more and open another ticket if necessary.

I believe we can close this ticket @rwarmstr and @randyh62 once we address the tiny bit of #69 (comment).

@dj-park
Copy link

dj-park commented Jun 23, 2023

For those of you still having similar issues... in my experience, when installing zynqmp command image,
if I install it with
./sdk.sh -y -d . -p
and then cp it to /opt/platforms (for example), I had this issue.

I had to cp the directory to /opt/platforms/ first and then run ./sdk.sh -y -d . -p.
I don't think setting XRT is necessary for embedded platform.

CRTejaswi pushed a commit to CRTejaswi/amd-vitis that referenced this issue Oct 3, 2023
f0e0005 Merge pull request Xilinx#83 from liyuanz/add_time
361913d add time
64ea0f9 Merge pull request Xilinx#82 from liyuanz/next
8386360 update
370bb26 Merge pull request Xilinx#81 from liyuanz/next
4716b14 add memory or time
2b41485 Merge pull request Xilinx#79 from yuxiangz/makefile
a5df524 update makefile for hw_emu
bc265f0 Merge pull request Xilinx#77 from tianminr/L3_dev
bd9b7c5 Merge pull request Xilinx#76 from yuxiangz/sizein
d2a2ab6 update scanline case
591cebc add golden out size
4898af0 push request for regress
4cee657 turn up
c13c69b update error kernel for kernel_ratio setting
1379c0d Merge remote-tracking branch 'xf_ultrasound/next' into L3_dev
43ecd58 update L2 graph & kernel ratio setup for scanline
5c9a2e5 update host
8a8bc80 Merge pull request Xilinx#71 from yuxiangz/graph_l3
bd69baf turn memory up 3
b7ee6a5 Merge pull request Xilinx#73 from siyangw/IO_Dev
f516f8e Merge pull request Xilinx#72 from tianminr/L3_dev
a467fa5 turn memory up
9d3c0cc revise description.json
bbaee77 Merge pull request Xilinx#70 from siyangw/IO_Dev
f0d9dd8 scanline graph update
22db53e scanline sw_emu pass
b0487bd update port name
4404027 sw_emu pass
2571dd9 plane wave pass sw_emu
19e4cc3 Merge remote-tracking branch 'ultrasound/next' into IO_Dev
081a881 plane wave pass x86sim and aiesim
5c27d04 build graph for L3

Co-authored-by: sdausr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants