riscv-software-src / homebrew-riscv

homebrew (macOS) packages for RISC-V toolchain
https://riscv.org
310 stars 50 forks source link

$RISCV is not set by this process. Can this step be automated or included in README? #23

Closed BassMunkee closed 5 years ago

BassMunkee commented 6 years ago

The homebrew installer worked rather smoothly for me on Mac vs following the instructions on the risv-tools repo. For installing BOOM, the $RISCV environment variable needs to be set. I'm unsure what should that be after installing the tools using Homebrew. How do I find the path? Can this also be part of the README or automated?

BassMunkee commented 6 years ago

I'm following the instructions for setting up riscv-boom by using the boom-template from here:

I installed the riscv-tools using homebrew and set $RISCV to /usr/local and added RISCV/bin to $PATH and was able to proceed forward. This allowed me to compile the verisim using make.

But now if I try to run make run-regression-tests I get the error make: *** No rule to make target/usr/local/riscv64-unknown-elf/share/riscv-tests/isa/rv64ud-v-fcvt', needed by output/rv64ud-v-fcvt'. Stop.

When I try to run make run I get the error make: *** No rule to make target/usr/local/riscv64-unknown-elf/share/riscv-tests/isa/rv64um-v-mul', needed by output/rv64um-v-mul'. Stop.

I know this is specific to the boom-template project but I believe this is happening because $RISCV environment variable is not set correctly as Homebrew downloads and compiles it in a different path from what is probably followed when manually compiling it following the instructions in those other projects.

Any help/guidance is much appreciated.

sbeamer commented 5 years ago

The homebrew installation does not set the $RISCV variable because it is not clear what to set it to. When manually installing riscv-tools, everything is installed into $RISCV. By contrast, with homebrew, each package is given its own separate directory. Thus setting $RISCV would be setting it for only one package.

If you are in a usage scenario that expects $RISCV to be set, you might be best served by doing a manual installation. By doing so, you not only put all of the packages into the same directory, but you will also get the exact right versions of the tools (pointed to by the git submodules). This homebrew installation installs whatever version is in the most recent bottle, or head of master if you build from source.

For working with boom-template (or rocket-chip), I would recommend performing a manual installation. To build the simulators, they will look at $RISCV to find riscv-fesvr, but to run tests it will be looking for riscv-tests inside of $RISCV.

BassMunkee commented 5 years ago

Thanks for the clarification. Do you think something like this should go into the readme? When I tried to set up Rocket I found the number of moving parts and the layers that need to be setup quite daunting. I also ran into some issues with the manual setup and then realised the option to use homebrew.

What I'm trying to say is that there are lot of folks who don't have much experience in open source / *nix tools who want to try using riscv and onboarding process can be made easier


From: Scott Beamer notifications@github.com Sent: Thursday, December 6, 2018 12:59:01 AM To: riscv/homebrew-riscv Cc: Srikanth A V; Author Subject: Re: [riscv/homebrew-riscv] $RISCV is not set by this process. Can this step be automated or included in README? (#23)

The homebrew installation does not set the $RISCV variable because it is not clear what to set it to. When manually installing riscv-tools, everything is installed into $RISCV. By contrast, with homebrew, each package is given its own separate directory. Thus setting $RISCV would be setting it for only one package.

If you are in a usage scenario that expects $RISCV to be set, you might be best served by doing a manual installation. By doing so, you not only put all of the packages into the same directory, but you will also get the exact right versions of the tools (pointed to by the git submodules). This homebrew installation installs whatever version is in the most recent bottle, or head of master if you build from source.

For working with boom-template (or rocket-chip), I would recommend performing a manual installation. To build the simulators, they will look at $RISCV to find riscv-fesvr, but to run tests it will be looking for riscv-tests inside of $RISCV.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Friscv%2Fhomebrew-riscv%2Fissues%2F23%23issuecomment-444612826&data=02%7C01%7C%7Cbd3b80f1c03c4adb846108d65ae7e9b7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636796349438877322&sdata=Sn7t5LhnpXZ%2B2YVHKhNj193cRDra2RKM2eKz%2BQmnQtM%3D&reserved=0, or mute the threadhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPrRCx9aFviY0rZIldEAPweCProY5gm0ks5u2B59gaJpZM4XdxjS&data=02%7C01%7C%7Cbd3b80f1c03c4adb846108d65ae7e9b7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636796349439033578&sdata=WpxuHqlJCmL4ZgJ%2BiALNEKc6oKIiDx1LW32dn1vHKPk%3D&reserved=0.

sbeamer commented 5 years ago

Admittedly, the README for rocket-chip is at times out of date or confusing, but I don't believe it recommends using brew for riscv-tools. Are you recommending revising the README in this repo or rocket-chip? I'm open to modifying the README in this repo, so please open a PR to show what you think would help reduce confusion.

BassMunkee commented 5 years ago

Let me think this through and create a PR in the appropriate repo. Thanks again for your feedback


From: Scott Beamer notifications@github.com Sent: Friday, December 7, 2018 12:38:56 AM To: riscv/homebrew-riscv Cc: Srikanth A V; Author Subject: Re: [riscv/homebrew-riscv] $RISCV is not set by this process. Can this step be automated or included in README? (#23)

Admittedly, the README for rocket-chip is at times out of date or confusing, but I don't believe it recommends using brew for riscv-tools. Are you recommending revising the README in this repo or rocket-chip? I'm open to modifying the README in this repo, so please open a PR to show what you think would help reduce confusion.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Friscv%2Fhomebrew-riscv%2Fissues%2F23%23issuecomment-444991682&data=02%7C01%7C%7Cd4cd4c0200924ea8ac8a08d65bae4781%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636797201409946324&sdata=aKdoOZ4jff1VMdpdUBHgad5macFR%2FA4%2BrhEm1X3VCkk%3D&reserved=0, or mute the threadhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAPrRC5xHcx75jlJqb3u_EMZIZlqI8Mxbks5u2WtIgaJpZM4XdxjS&data=02%7C01%7C%7Cd4cd4c0200924ea8ac8a08d65bae4781%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636797201409946324&sdata=UWaVoE34D8KItWlqJAtbCt%2Bmp8R%2Bl3HrXSd3XA4FP3E%3D&reserved=0.

sbeamer commented 5 years ago

Please re-open this issue to comment on it further.