mlir-aie icon indicating copy to clipboard operation
mlir-aie copied to clipboard

Too specific clang compilation options in aiecc.py when targeting petalinux 2021.2 sysroots (--aie-generate-xaiev2)

Open jackl-xilinx opened this issue 2 years ago • 0 comments

Clang compilation options were added to aiecc.py (main.py) when targeting petalinux 2021.2 sysroots (like the vck190_bare_prod_2021.2 platform) in order to find the correct library dependencies. See https://github.com/Xilinx/mlir-aie/blob/main/tools/aiecc/aiecc/main.py#L157-L162. This should ideally be automatically found with just the --sysroot argument but that doesn't seem to be enough. If I run the aiecc.py on any of the main unit tests with the following command:

aiecc.py -v --sysroot=/group/xrlabs2/platforms/vck190_prod_bare_2021.2_sysroot/ --aie-generate-xaiev2 --xbridge ./aie.mlir -I../../../runtime_lib ../../../runtime_lib/test_library.cpp ./test.cpp -o test.elf

It is successful because of the added options. But if I were to call clang on the test.cpp without them, such as:

clang --target=aarch64-linux-gnu -std=c++11 --sysroot=/group/xrlabs2/platforms/vck190_prod_bare_2021.2_sysroot/ -DLIBXAIENGINEV2 -I/group/xrlabs2/platforms/vck190_prod_bare_2021.2_sysroot//opt/xaiengine/include -L/group/xrlabs2/platforms/vck190_prod_bare_2021.2_sysroot//opt/xaiengine/lib -Iacdc_project -fuse-ld=lld -lm -rdynamic -lxaiengine -ldl -I../../../runtime_lib ../../../runtime_lib/test_library.cpp ./test.cpp -o test.elf

the error received is:

In file included from ../../../runtime_lib/test_library.cpp:13: ../../../runtime_lib/test_library.h:12:10: fatal error: 'cmath' file not found #include ^~~~~~~ 1 error generated. ./test.cpp:11:10: fatal error: 'cassert' file not found #include ^~~~~~~~~ 1 error generated.

jackl-xilinx avatar Aug 04 '22 15:08 jackl-xilinx