Xilinx / ACCL

Alveo Collective Communication Library: MPI-like communication operations for Xilinx Alveo accelerators
https://accl.readthedocs.io/
Apache License 2.0
81 stars 26 forks source link

Missing include for features.h #149

Closed yxd97 closed 1 year ago

yxd97 commented 1 year ago

Hello! I'm trying to compile ACCL but encountered the following issue when doing make MODE=axis3x PLATFORM=xilinx_u280_gen3x16_xdma_1_202211_1 as mentioned in INSTALL.md:

/usr/include/x86_64-linux-gnu/sys/cdefs.h:23:11: fatal error: features.h: No such file or directory                                                                                                                                       
   23 | # include <features.h>                                                                                       
      |           ^~~~~~~~~~~~                                                                                       
compilation terminated.                                                                                              
make[4]: *** [Makefile:33: ../../../lib/xrxbuf_dequeue_sinit.o] Error 1                                                                                                                                                                   
make[3]: *** [Makefile:46: cclo_control_microblaze_0/libsrc/rxbuf_dequeue_v1_0/src/make.libs] Error 2                                                                                                                                     
make[2]: *** [Makefile:18: all] Error 2

I'm very sure that features.h is in my /usr/include so I don't know why the complier was not able to find it. I'm compiling ACCL with Vitis 2022.1 on Ubuntu 20.04. Thanks for any help!

quetric commented 1 year ago

Hi @yxd97

Thanks for reporting this error. First of all could you please confirm that features.h is actually in your include path, and if it is and the problem persists, please attach a full log of the build process for us to determine where exactly the failure occurs.

yxd97 commented 1 year ago

Thanks for your reply! I'm sure features.h is in /usr/include:

/usr/include$ ls features.h 
features.h

Here is the complete log of the make. Seems like it's related to Vitis compliation for microblaze cores:

~/ACCL/test/hardware$ make MODE=axis3x PLATFORM=xilinx_u280_gen3x16_xdma_1_202211_1
make -C ../../kernels/cclo PLATFORM=xilinx_u280_gen3x16_xdma_1_202211_1 STACK_TYPE=TCP MB_DEBUG_LEVEL=2
make[1]: Entering directory '/work/shared/users/phd/yd383/ACCL/kernels/cclo'
rm -rf vitis_ws && mkdir vitis_ws
xsct tcl/generate_sw.tcl ccl_offload ccl_offload_ex/ccl_offload.xsa ./fw "Optimize most (-O3)"
Display is :196
Starting vitis. This could take few seconds...Eclipse:
The Eclipse executable launcher no longer supports running with GTK + 2.x. Continuing using GTK+ 3.x.
done
INFO: [Hsi 55-2053] elapsed time for repository (/work/shared/common/CAD_tool/Xilinx/Vitis-2022/Vitis/2022.1/data/embeddedsw) loading 18 seconds
hsi::set_repo_path: Time (s): cpu = 00:00:00.18 ; elapsed = 00:00:17 . Memory (MB): peak = 2254.625 ; gain = 0.000 ; free physical = 190785 ; free virtual = 361200
Opening the hardware design, this may take few seconds.
/work/shared/common/CAD_tool/Xilinx/Vitis-2022/Vitis/2022.1/gnu/microblaze/lin
Building the BSP Library for domain  - mydomain on processor cclo_control_microblaze_0
make[2]: Entering directory '/work/shared/users/phd/yd383/ACCL/kernels/cclo/vitis_ws/ccl_offload/cclo_control_microblaze_0/mydo
main/bsp'

make --no-print-directory seq_libs

Running Make include in cclo_control_microblaze_0/libsrc/tcp_depacketizer_v1_0/src

make -C cclo_control_microblaze_0/libsrc/tcp_depacketizer_v1_0/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-
as" "ARCHIVER=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -
mxl-pattern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patte
rns"

Running Make include in cclo_control_microblaze_0/libsrc/standalone_v7_7/src

make -C cclo_control_microblaze_0/libsrc/standalone_v7_7/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "A
RCHIVER=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pa
ttern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns"

Running Make include in cclo_control_microblaze_0/libsrc/rxbuf_enqueue_v1_0/src

make -C cclo_control_microblaze_0/libsrc/rxbuf_enqueue_v1_0/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as"
 "ARCHIVER=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl
-pattern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns
"

Running Make include in cclo_control_microblaze_0/libsrc/rxbuf_dequeue_v1_0/src

make -C cclo_control_microblaze_0/libsrc/rxbuf_dequeue_v1_0/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as"
 "ARCHIVER=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl
-pattern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns
"

Running Make include in cclo_control_microblaze_0/libsrc/bram_v4_7/src

make -C cclo_control_microblaze_0/libsrc/bram_v4_7/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "ARCHIVE
R=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pattern-
compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns"

Running Make include in cclo_control_microblaze_0/libsrc/gpio_v4_9/src

make -C cclo_control_microblaze_0/libsrc/gpio_v4_9/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "ARCHIVE
R=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pattern-
compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns"

Running Make include in cclo_control_microblaze_0/libsrc/rxbuf_seek_v1_0/src

make -C cclo_control_microblaze_0/libsrc/rxbuf_seek_v1_0/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "A
RCHIVER=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pa
ttern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns"

Running Make include in cclo_control_microblaze_0/libsrc/cpu_v2_15/src

make -C cclo_control_microblaze_0/libsrc/cpu_v2_15/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "ARCHIVE
R=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pattern-
compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns"

Running Make include in cclo_control_microblaze_0/libsrc/tcp_packetizer_v1_0/src

make -C cclo_control_microblaze_0/libsrc/tcp_packetizer_v1_0/src -s include  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as
" "ARCHIVER=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mx
l-pattern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-pattern
s"

Running Make libs in cclo_control_microblaze_0/libsrc/rxbuf_dequeue_v1_0/src

make -C cclo_control_microblaze_0/libsrc/rxbuf_dequeue_v1_0/src -s libs  "SHELL=/bin/sh" "COMPILER=mb-gcc" "ASSEMBLER=mb-as" "A
RCHIVER=mb-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=v11.0 -mlittle-endian -mno-xl-soft-div -mno-xl-soft-mul -mxl-barrel-shift -mxl-pa
ttern-compare" "EXTRA_COMPILER_FLAGS=-g -ffunction-sections -fdata-sections -Wall -Wextra -fno-tree-loop-distribute-patterns"

cc1.real: warning: include location "/usr/include/x86_64-linux-gnu" is unsafe for cross-compilation [-Wpoison-system-directories]
In file included from /work/shared/common/CAD_tool/Xilinx/Vitis-2022/Vitis/2022.1/gnu/microblaze/lin/microblazeeb-xilinx-elf/usr/include/ctype.h:5,
                 from ../../../include/xil_printf.h:12,
                 from ../../../include/xil_io.h:49,
                 from xrxbuf_dequeue.h:18,
                 from xrxbuf_dequeue_sinit.c:10:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:23:11: fatal error: features.h: No such file or directory
   23 | # include <features.h>
      |           ^~~~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:33: ../../../lib/xrxbuf_dequeue_sinit.o] Error 1
make[3]: *** [Makefile:46: cclo_control_microblaze_0/libsrc/rxbuf_dequeue_v1_0/src/make.libs] Error 2
make[2]: *** [Makefile:18: all] Error 2
make[2]: Leaving directory '/work/shared/users/phd/yd383/ACCL/kernels/cclo/vitis_ws/ccl_offload/cclo_control_microblaze_0/mydom
ain/bsp'

Failed to build  the bsp sources for domain - mydomain
Failed to generate the platform.
Reason: Failed to build  the bsp sources for domain - mydomain
    while executing
"builtin_platform -generate full"
    (procedure "platform" line 571)
    invoked from within
"platform generate"
    (file "tcl/generate_sw.tcl" line 28)
make[1]: *** [Makefile:77: vitis_ws/ccl_offload_control/Debug/ccl_offload_control.elf] Error 1
make[1]: Leaving directory '/work/shared/users/phd/yd383/ACCL/kernels/cclo'
make: *** [Makefile:182: link_axis3x_eth_none_debug_none_xilinx_u280_gen3x16_xdma_1_202211_1/ccl_offload.xclbin] Error 2
quetric commented 1 year ago

We're unable to reproduce this error on our end. Furthermore, the error happens in microblaze code compilation with Vitis, which is a tool not under our control. Closing here as a result.