spack/var
Glenn Johnson 71243f3f7b Get py-torch to build caffe2 (#14619)
* Get py-torch to build caffe2

This PR gets the py-torch package to build with caffe2, and closes
issue #14576. If building on a machine with CUDA but no GPU the build
will try to build with all compute capabilities. Older compute
capabilities are not supported so the build will fail. The list of
capabilities can be passed to the build using values set in the
cuda_arch variant. Likewise, conflicts are also set to catch if the
unsupported capabilities are listed in cuda_arch.

This PR also sets version constraints on using an external mkldnn for
newer versions. Currenly, only versions up to 0.4 use an external mkldnn
library. Also, the cuda variant is set to True, which restores
previous behavior.

* Update var/spack/repos/builtin/packages/py-torch/package.py

Fix typo.

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Adjust conflicts

This commit adjusts the conflicts. There is an issue with the
cuda_arch=20 conflicts directive as there is a conflicting dependency
with any version >=1.1 and a cuda_arch=20 dependency specified in
CudaPackage that gets trapped first.

* Use a common message for conflicts

This commit adds a variable to contain the bulk of the message stringi
for the cuda_arch conflicts. This is used along with a version string
in the conflicts directives messages.

* Fix the strings

- Use a multiline string for the cuda_arch_conflict variable.
- No need for format() in the msg value.

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-01-24 22:57:16 -06:00
..
spack Get py-torch to build caffe2 (#14619) 2020-01-24 22:57:16 -06:00