Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Strategy for multiple binary options per platform? #155

Open
IanButterworth opened this issue Mar 20, 2019 · 4 comments
Open

Strategy for multiple binary options per platform? #155

IanButterworth opened this issue Mar 20, 2019 · 4 comments

Comments

@IanButterworth
Copy link
Member

I have a library that has different build processes depending on whether CUDA, cuDNN, tensor cores, OpenMP etc. are available on the build system, AND whether you want to use them..

So, I'm building a BinaryProvider-based wrapper for this library and want to give the user the option of 2-4 binaries per platform. Something like:

  • CPU-only
  • CPU with OpenMP
  • GPU with CUDA & cuDNN
  • GPU with CUDA, cuDNN & tensor cores

The simplest thing would be to give the user the option and try to install and test, with some generic message telling the user to make sure those dependencies are present.
The safer thing is to give the option, test for presence of dependencies, then install and test.

Are there any good examples of how to do this with BinaryProvider?

@staticfloat ?

@staticfloat
Copy link
Member

Mmmm, yes, this gets tricky. Everything is going to have to go through Pkg eventually, so we're going to need to figure out what the best strategy for this is long-term. I'm going to ping @StefanKarpinski and @KristofferC to get their opinion on what they think the best way to get these kinds of "runtime adaptive dependencies" are.

Short-term, you can do whatever runtime inspection you need within deps/build.jl, figure out which one should be installed, then include() the appropriate build.jl for that package, but that method of doing things with BinaryProvider is going to become a whole lot more automatic as I continue to work on JuliaLang/Pkg.jl#841

@IanButterworth
Copy link
Member Author

IanButterworth commented Mar 21, 2019

@staticfloat I like the multiple build.jl approach.

One question, if I prompt the user for options during the build process, it would make CI builds hang until timeout. Is there a user input with timeout method available? i.e.

Select from:
[1] CPU only
[2] GPU etc.
Enter choice (1 or 2) [selecting default 1 in 3 seconds..]:

@staticfloat
Copy link
Member

Not that I am aware. You could override it with an environment variable.

That being said, I'm not sure you can interact with the user during build.jl time. The build system redirects your output to a file, so you can't print out to the user.

@IanButterworth
Copy link
Member Author

Ah of course.. So the selection would have to happen at ] add .. or ] build .. which I believe the only current way would be to have different registered packages per build optionset

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants