microwatt icon indicating copy to clipboard operation
microwatt copied to clipboard

GHDL build on native powerpc64le requires explicit LLVM backend selection

Open jaesharp opened this issue 5 years ago • 13 comments

Debian doesn't build ghdl for powerpc64/le targets yet as package build results in incorrect mcode backend selection on powerpc64/le architectures. Manual specification of ./configure --with-llvm-config=$(which llvm-config) results in working native GHDL build which can be used to simulate microwatt according to README instructions natively on powerpc64/le. Suggest modifying README to include instructions and workaround lack of GHDL package availability in powerpc64/le debian and debian derived distros.

jaesharp avatar Sep 01 '19 20:09 jaesharp

Thanks @justinlynn, yes we should add something in the README.

antonblanchard avatar Sep 03 '19 10:09 antonblanchard

@justinlynn would you be able to summarise the steps needed on Debian? Can we use the distro llvm here?

antonblanchard avatar Sep 04 '19 02:09 antonblanchard

@antonblanchard More than happy to make a PR with the needed changes for Debian, etc. to save you the trouble of translating. As to system LLVM - Yes, I've had success in building GHDL master with Ubuntu Disco's LLVM development packages. If you'd like I can work on streamlining the build/simulation experience with some of the tooling I've put together and submit as small separated PRs - thoughts?

I'll also have to submit a patch to Debian's GHDL packaging so that it builds for ppc64/le.

jaesharp avatar Sep 04 '19 03:09 jaesharp

For anyone reading this in the future the steps required (on Ubuntu Disco ppc64le, at least) are:

  1. Clone https://github.com/ghdl/ghdl.git into a local dir.
  2. Use apt to install llvm-8-dev and gnat, assuming you already have a basic toolchain and such installed (build-essentials)
  3. Move into the GHDL checkout.
  4. Run ./configure --with-llvm-config=/usr/bin/llvm-config-8, using --prefix to some location you want to install GHDL, if desired (for example $HOME/.local).
  5. Fix any issues raised by configure, repeat from 4 until clear.
  6. Run make && make install
  7. Assuming that where you installed GHDL is on your $PATH, microwatt's makefile should now work.

jaesharp avatar Sep 04 '19 04:09 jaesharp

@justinlynn sounds great! We've had a couple of people trip over the issues with Debian and Ubuntu, so something in the README would be very useful. Also interested to see your tooling.

I think @sharkcz was looking at ppc64le distro issues too.

antonblanchard avatar Sep 05 '19 00:09 antonblanchard

Yes, things work out of the box on Fedora with packaged ghdl.

sharkcz avatar Sep 05 '19 06:09 sharkcz

Cool. I'll have to try that now.

classilla avatar Sep 05 '19 15:09 classilla

for the record there is a new ghdl in Rawhide, I don't plan to push this build into the stable releases (like F-30), but will make it available in https://copr.fedorainfracloud.org/coprs/sharkcz/danny/

sharkcz avatar Sep 05 '19 15:09 sharkcz

@justinlynn did you want to contribute those instructions to README.md and create a PR?

mikey avatar Jun 11 '20 04:06 mikey

Yes, I can do that shortly. Apologies for needing to be tagged on that - thanks for the explicit notice!

jaesharp avatar Jun 12 '20 01:06 jaesharp

No worries, I was just cleaning up the issues and wanted to close this out. Thanks @justinlynn

mikey avatar Jun 12 '20 02:06 mikey

I am so sorry I let this go for so long :/ At the very least for Ubuntu 20.10 or higher with more recent ghdl builds this now works out of the box. Closing this issue.

jaesharp avatar Jun 23 '21 16:06 jaesharp

Actually, no, that's not the case. My mistake. I'll take care of this ASAP.

jaesharp avatar Jun 23 '21 16:06 jaesharp