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

[build] Add script for Deeploy environment variables and Makefile info #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ echo-bash:
@echo "TL/DR: add these lines to run ~/.bashrc"
@echo "export PULP_SDK_HOME=${PULP_SDK_INSTALL_DIR}"
@echo "export LLVM_INSTALL_DIR=${LLVM_INSTALL_DIR}"
@echo "export PULP_RISCV_GCC_TOOLCHAIN=/PULP_SDK_IS_A_MESS"
@echo "export PULP_RISCV_GCC_TOOLCHAIN="
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not completely remove this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pulp-sdk needs the environment variable set afaik but @Scheremo could confirm.
I would prefer if the contents of the variable stay untouched 😏

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but it gets set when you source the platform specific setup script in the PULP SDK. I am certain that PULP_SDK_IS_A_MESS won't fix any problems 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a diff of my environment with/without the PULP_RISCV_GCC_TOOLCHAIN environment variable:

46d45
< PULP_RISCV_GCC_TOOLCHAIN=/PULP_SDK_IS_A_MESS
59c58
< GAP_RISCV_GCC_TOOLCHAIN=/PULP_SDK_IS_A_MESS
---
> GAP_RISCV_GCC_TOOLCHAIN=
83c82
< PATH=/home/lmacan/Deeploy/install/pulp-sdk/tools/gapy:/home/lmacan/Deeploy/install/pulp-sdk/install/workstation/bin:/PULP_SDK_IS_A_MESS/bin:/home/lmacan/Deeploy/install/pulp-sdk/tools/bin:/home/lmacan/.local/bin:/home/lmacan/micromamba/condabin:/home/lmacan/.local/bin:/home/lmacan/.cargo/bin:/home/lmacan/.local/bin:/home/lmacan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
---
> PATH=/home/lmacan/Deeploy/install/pulp-sdk/tools/gapy:/home/lmacan/Deeploy/install/pulp-sdk/install/workstation/bin:/bin:/home/lmacan/Deeploy/install/pulp-sdk/tools/bin:/home/lmacan/.local/bin:/home/lmacan/micromamba/condabin:/home/lmacan/.local/bin:/home/lmacan/.cargo/bin:/home/lmacan/.local/bin:/home/lmacan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

The issue is that the pulp-sdk adds stuff into your PATH variable (that seems like fun 😃), specifically this part (the diff doesn't show it quite nicely so I cut just the scary piece):

+ /PULP_SDK_IS_A_MESS/bin
- /bin

Pulp-sdk basically adds /bin into your path in front of your other search paths which might mess up your environment. I think this was the reason to put the "/PULP_SDK_IS_A_MESS" because it's a non-existant path and doesn't screw up your environment. Bonus points for a funny name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some deep PULP lore material here 😁

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTF, I guess I was wrong 😂 Fight fire with fire...
I thought this was just a rant, but it is actually a fix 😂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xeratec you underestimated pulp and Moritz, tsk tsk tsk

@echo "export MEMPOOL_HOME=${MEMPOOL_INSTALL_DIR}"
@echo "export CMAKE=$$(which cmake)"
@echo "export PATH=${QEMU_INSTALL_DIR}/bin:${BANSHEE_INSTALL_DIR}:\$$PATH"
@echo "export PATH=~/.cargo/bin:$PATH"
@echo "source ${PULP_SDK_INSTALL_DIR}/configs/siracusa.sh"
@echo ""
@echo "Or export the DEEPLOY_INSTALL_DIR variable and source the following script:"
@echo "source deeploy.sh"


toolchain: llvm llvm-compiler-rt-riscv llvm-compiler-rt-arm picolibc-arm picolibc-riscv
Expand Down
8 changes: 8 additions & 0 deletions deeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export PULP_SDK_HOME=${DEEPLOY_INSTALL_DIR}/pulp-sdk
export LLVM_INSTALL_DIR=${DEEPLOY_INSTALL_DIR}/llvm
export PULP_RISCV_GCC_TOOLCHAIN=
export MEMPOOL_HOME=${DEEPLOY_INSTALL_DIR}/mempool
Comment on lines +1 to +4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't just set all these paths relative to DEEPLOY_INSTALL_DIR. The Makefile is set up such that previous installations may be reused, and each tool gets its own DIR variable.

export CMAKE=/usr/bin/cmake
export PATH=${DEEPLOY_INSTALL_DIR}/qemu/bin:${DEEPLOY_INSTALL_DIR}/banshee:$PATH
export PATH=~/.cargo/bin:$PATH
source ${PULP_SDK_HOME}/configs/siracusa.sh