firesim / FireMarshal

Software workload management tool for RISC-V based SoC research. This is the default workload management tool for Chipyard and FireSim.
https://docs.fires.im/en/latest/Advanced-Usage/Workloads/index.html
Other
76 stars 51 forks source link

XRT default setup.sh can cause buildroot failure for CWD in LD_LIBRARY_PATH #240

Open timsnyder-siv opened 2 years ago

timsnyder-siv commented 2 years ago

When one uses XRT for Alveo support, the default setup.sh will put a trailing colon in LD_LIBRARY_PATH and then buildroot/support/dependencies/dependencies.sh will think that CWD is in LD_LIBRARY_PATH.

2022-05-25 19:32:39,136 [run         ] [DEBUG]  #
2022-05-25 19:32:39,136 [run         ] [DEBUG]  # configuration written to /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/.config
2022-05-25 19:32:39,136 [run         ] [DEBUG]  #
2022-05-25 19:32:39,420 [run         ] [DEBUG]  Running: "make clean" in /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/firechip/distros/br/buildroot
2022-05-25 19:32:47,868 [run         ] [DEBUG]  rm -rf /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/target /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/images /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/host  \
2022-05-25 19:32:47,869 [run         ] [DEBUG]  /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/staging \
2022-05-25 19:32:47,869 [run         ] [DEBUG]  /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/legal-info /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/graphs
2022-05-25 19:32:47,940 [run         ] [DEBUG]  Running: "make" in /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/firechip/distros/br/buildroot
2022-05-25 19:32:55,973 [run         ] [DEBUG]  /opt/conda/envs/firesim/bin/make -j1 O=/home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output HOSTCC="/opt/conda/envs/firesim/bin/gcc" HOSTCXX="/opt/conda/envs/firesim/bin/g++" syncconfig
2022-05-25 19:32:56,256 [run         ] [DEBUG]  mkdir -p /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/lxdialog
2022-05-25 19:32:56,258 [run         ] [DEBUG]  PKG_CONFIG_PATH="" /opt/conda/envs/firesim/bin/make CC="/opt/conda/envs/firesim/bin/gcc" HOSTCC="/opt/conda/envs/firesim/bin/gcc" \
2022-05-25 19:32:56,258 [run         ] [DEBUG]  obj=/home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config -C support/kconfig -f Makefile.br conf
2022-05-25 19:32:56,361 [run         ] [DEBUG]  /opt/conda/envs/firesim/bin/gcc -D_GNU_SOURCE -I/opt/conda/envs/firesim/include/ncursesw -I/opt/conda/envs/firesim/include -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config -DCONFIG_=\"\"  -MM *.c > /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/.depend 2>/dev/null || :
2022-05-25 19:32:56,733 [run         ] [DEBUG]  /opt/conda/envs/firesim/bin/gcc -D_GNU_SOURCE -I/opt/conda/envs/firesim/include/ncursesw -I/opt/conda/envs/firesim/include -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config -DCONFIG_=\"\"   -c conf.c -o /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/conf.o
2022-05-25 19:32:56,923 [run         ] [DEBUG]  /opt/conda/envs/firesim/bin/gcc -D_GNU_SOURCE -I/opt/conda/envs/firesim/include/ncursesw -I/opt/conda/envs/firesim/include -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config -DCONFIG_=\"\"  -I. -c /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/zconf.tab.c -o /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/zconf.tab.o
2022-05-25 19:32:57,626 [run         ] [DEBUG]  /opt/conda/envs/firesim/bin/gcc -D_GNU_SOURCE -I/opt/conda/envs/firesim/include/ncursesw -I/opt/conda/envs/firesim/include -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config -DCONFIG_=\"\"   /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/conf.o /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/zconf.tab.o  -o /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/conf
2022-05-25 19:32:57,672 [run         ] [DEBUG]  rm /home/azureuser/firesim/target-design/chipyard/software/firemarshal/boards/default/distros/br/buildroot/output/build/buildroot-config/zconf.tab.c
2022-05-25 19:32:58,013 [run         ] [DEBUG]  
2022-05-25 19:32:58,014 [run         ] [DEBUG]  You seem to have the current working directory in your
2022-05-25 19:32:58,014 [run         ] [DEBUG]  LD_LIBRARY_PATH environment variable. This doesn't work.
2022-05-25 19:32:58,014 [run         ] [DEBUG]  make[1]: *** [support/dependencies/dependencies.mk:27: dependencies] Error 1
2022-05-25 19:32:58,034 [run         ] [DEBUG]  make: *** [Makefile:84: _all] Error 2
2022-05-25 19:32:58,036 [main        ] [ERROR]  Failed to build workload br-base.json

To work around this, I removed the trailing colon. I'm going to report this against xilinx/XRT as well because their setup.csh script checks for the existence of LD_LIBRARY_PATH so that the trailing colon isn't added if it isn't yet defined.

marshal might want to check for leading or trailing colon on LD_LIBRARY_PATH and provide a better error message or fix it on the fly.

timsnyder-siv commented 2 years ago

Filed https://github.com/Xilinx/XRT/issues/6738 and they quickly responded with a PR.