Halide icon indicating copy to clipboard operation
Halide copied to clipboard

Spack Package

Open wraith1995 opened this issue 1 year ago • 14 comments

Hi.

I added a Spack package a while ago and I am maintaining it. I thought that I might let you all know and add something to the readme. If anyone wants to be added as a maintainer and receive notifications about it from Spack github, please let me know.

wraith1995 avatar Jul 23 '24 13:07 wraith1995

Hi @wraith1995, thanks very much for writing and maintaining this package! Is it simple to set up Spack on my laptop so I can test it? I just want to confirm the instructions myself before merging this.

If anyone wants to be added as a maintainer and receive notifications about it from Spack github, please let me know.

I'm generally the point-of-contact for third-party packages (e.g. vcpkg, Debian), but I don't directly maintain them. I'd be happy to receive notifications, though.

alexreinking avatar Jul 23 '24 15:07 alexreinking

@alexreinking Yes, it is pretty simple. The instructions are at https://spack.readthedocs.io/en/latest/getting_started.html#getting-started

You can install some apt deps, clone it, run their setup script, and then try the commands. I would suggest something a bit more specific for a test thought:

spack install halide@17+python+tests

Once the PR for version 18 goes through I'll make another one to add you on the list of people to get notifications (technically a maintainer but that is really all that is entailed)

EDIT: Then to use it, you should run

spack load halide
python3
import halide as hl

wraith1995 avatar Jul 23 '24 15:07 wraith1995

Oh also @alexreinking If you already have an llvm installed, you can maybe skip installing it again via

spack external find llvm

provided llvm-config is in your path.

wraith1995 avatar Jul 23 '24 15:07 wraith1995

@wraith1995 -- sorry for the delay on this, the Halide CMake build is undergoing some long-overdue upgrades at the moment and I've had my hands full. I promise I haven't forgotten!

alexreinking avatar Aug 09 '24 16:08 alexreinking

@alexreinking No problem - I've noticed and I am attempting to gauge how this will change the Spack package.

wraith1995 avatar Aug 09 '24 16:08 wraith1995

Ideally, it shouldn't, at least not in this release. You will see some deprecation notices telling you which cache variables to change.

alexreinking avatar Aug 09 '24 17:08 alexreinking

What sort of review does this need?

steven-johnson avatar Aug 23 '24 17:08 steven-johnson

What sort of review does this need?

We need to check that the apps build and run against the spack package as installed by the directions in the README (this patch)

alexreinking avatar Aug 23 '24 20:08 alexreinking

Running ./bin/spack install halide from Spack's git repo at 47e79c32fdd820b3ce825f62619c693e4a57d549 (develop branch) results in the following error:

==> Error: ProcessError: Command exited with status 1:
   'ninja' '-j16' '-v'

15 errors found in build log:
...

Followed by a bunch of errors regarding segmentation faults in llvm-as. Here is the log: spack-build-out.txt

alexreinking avatar Aug 26 '24 13:08 alexreinking

Attempting to use Homebrew's LLVM fails like so:

$ export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
$ ./bin/spack external find llvm
/Users/areinking/dev/spack/lib/spack/spack/detection/path.py:295: UserWarning: "[email protected]+clang~lld+lldb" has been detected on the system but will not be added to packages.yaml [reason=c compiler not found for [email protected]+clang~lld+lldb]
  warnings.warn(msg)

The process then hangs indefinitely. I observe the same error message with ./bin/spack compiler find.

alexreinking avatar Aug 26 '24 13:08 alexreinking

@alexreinking Hmmm. It is hard for me to tell from the build log what is going on. I've done this on linux/macOS for old Halide and LLVMs; let me see what happens when I run it on my mac with Halide18 and llvm18. I suspect it is probably an issue with external find or the specific way llvm is being requested or some combination thereof.

wraith1995 avatar Aug 26 '24 14:08 wraith1995

@wraith1995 -- have you gotten a chance to try to repro this? I would like to make the Spack package work and be able to list it in our README.

alexreinking avatar Sep 10 '24 03:09 alexreinking

@alexreinking Not yet - I have not had time as of late, but I will have time later this week (Thursday/Friday) to take a look.

wraith1995 avatar Sep 10 '24 11:09 wraith1995

@alexreinking Okay. I can reproduce the first but not the second - I suspect the second might be that spack can sometimes small due to permissions issues (e.g. something on your path it can't read). I am looking into the cause of the segfaults and I will let you know. It is probably something Mac OSX specific.

wraith1995 avatar Sep 13 '24 22:09 wraith1995