antmicro / alkali-csd-fw

Apache License 2.0
2 stars 2 forks source link

make rpu-app and make all command not work #2

Closed chauhanjoy closed 2 years ago

chauhanjoy commented 2 years ago

Hi,

I am not able to build the alkali-csd-fw repository.

I am following the below steps:

  1. git clone git@github.com:antmicro/alkali-csd-build.git
  2. cd alkali-csd-fw
  3. git submodule init
  4. git submodule update
  5. make docker
  6. export DOCKER_RUN_EXTRA_ARGS="-v ${HOME}/.ssh:${HOME}/.ssh"
  7. make enter
  8. make rpu-app
  9. make all

make the rpu-app command not work:

-- west build: building application
[1/140] Preparing syscall dependency handling

[8/140] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
FAILED: zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
ccache /zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__ZEPHYR__=1 -I/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/kernel/include -I/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/arch/arm/include -I/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/include -I/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/include/drivers -Izephyr/include/generated -I/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/soc/arm/xilinx_zynqmp -I/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/lib/libc/newlib/include -I/zephyr-sdk-0.10.3/arm-zephyr-eabi/arm-zephyr-eabi/include -Imodules/libmetal/libmetal/lib/include -I/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/modules/lib/open-amp/open-amp/lib/include -Os -imacros/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mthumb -mcpu=cortex-r5 -imacros/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/rpu-app=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/hardik/hardik/alkali_csd_02/alkali-csd-fw=WEST_TOPDIR -ffunction-sections -fdata-sections -mabi=aapcs -std=c99 -MD -MT zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -MF zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj.d -o zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj   -c /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/zephyr/arch/arm/core/offsets/offsets.c
ccache: error: Failed to create directory /home/hardik/.ccache/tmp: Permission denied
[9/140] Generating NVMe headers
Got stderr: Sep 02, 2022 9:55:29 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider loadDiskCache
WARNING: New fonts found, font cache will be re-built
Sep 02, 2022 9:55:29 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider <init>
WARNING: Building on-disk font cache, this may take a while
Sep 02, 2022 9:55:29 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider <init>
WARNING: Finished building on-disk font cache, found 22 fonts
Sep 02, 2022 9:55:29 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'ArialMT'
Sep 02, 2022 9:55:29 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'Arial-BoldMT'
Sep 02, 2022 9:55:30 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'Arial-ItalicMT'
Sep 02, 2022 9:55:30 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
Sep 02, 2022 9:55:30 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'Arial-BoldItalicMT'

Got stderr: Sep 02, 2022 9:55:32 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'ArialMT'
Sep 02, 2022 9:55:32 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'Arial-BoldMT'

Got stderr: Sep 02, 2022 9:55:34 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'ArialMT'
Sep 02, 2022 9:55:34 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'Arial-BoldMT'
Sep 02, 2022 9:55:34 AM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSans' for 'Arial-ItalicMT'

ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app
make: *** [Makefile:256: /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app/zephyr/zephyr.elf] Error 1

make all command gives an error

[100%] Building CXX object CMakeFiles/apu-app.dir/src/main.cpp.o
[100%] Building CXX object CMakeFiles/tflite-delegate-test.dir/src/tflite-test.cpp.o
[100%] Linking CXX executable apu-app
make[3]: Leaving directory '/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/apu-app'
[100%] Built target apu-app
[100%] Linking CXX executable tflite-delegate-test
make[3]: Leaving directory '/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/apu-app'
[100%] Built target tflite-delegate-test
make[2]: Leaving directory '/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/apu-app'
make[1]: Leaving directory '/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/apu-app'
cp -r /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/br2-external/board/basalt/overlay /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/buildroot/board/basalt
mkdir -p /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/buildroot/board/basalt/overlay/lib/firmware
cp /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/apu-app/*.so /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/buildroot/board/basalt/overlay/lib/.
cp /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app/zephyr/zephyr.elf /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/buildroot/board/basalt/overlay/lib/firmware/zephyr.elf
cp: cannot stat '/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app/zephyr/zephyr.elf': No such file or directory
make: *** [Makefile:72: buildroot] Error 1
kgugala commented 2 years ago

ccache: error: Failed to create directory /home/hardik/.ccache/tmp: Permission denied <-- this is the problem. Please check the rights on your machine

chauhanjoy commented 2 years ago

Hi,

I am following the below steps for building the alkali-csd-fw repository:

1) git clone git@github.com/antmicro/alkali-csd-fw.git 2) git submodule init 3) git submodule update 3) make docker 4) export DOCKER_RUN_EXTRA_ARGS="-v ${HOME}/.ccache:${HOME}/.ccache" 5) export DOCKER_RUN_EXTRA_ARGS="-v ${HOME}/.ssh:${HOME}/.ssh" 6) make enter 7) make all

When I run make all command it gives below an error.

cp /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/apu-app/*.so /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/buildroot/board/basalt/overlay/lib/.
cp /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app/zephyr/zephyr.elf /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/buildroot/board/basalt/overlay/lib/firmware/zephyr.elf
cp: cannot stat '/home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app/zephyr/zephyr.elf': No such file or directory
make: *** [Makefile:72: buildroot] Error 1

After that, I run the make rpu-app command but it gives an error.

ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app
make: *** [Makefile:256: /home/hardik/hardik/alkali_csd_02/alkali-csd-fw/build/rpu-app/zephyr/zephyr.elf] Error 1

but, when I exit the docker container and follow the below steps its works:

1) export DOCKER_RUN_EXTRA_ARGS="-v ${HOME}/.ccache:${HOME}/.ccache" 2) make enter 3) make rpu-app 4) make all

rw1nkler commented 2 years ago

Hi @chauhanjoy,

The first problem was caused by the fact that the container invoked as a user (as we do in this repository) tries to use the ~/.ccache when compiling the RPU application. This problem was fixed by setting the CCACHE_DISABLE environment variable when opening the container.

The second problem was caused by inconsistency in managing zephyr dependencies by west in the Makefile. It was fixed by moving the code responsible for downloading the zephyr sources to a proper makefile target.

Please download the latest version of the repository and use:

make clean
make enter
make all

to rebuild the project again.