summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorBrian Van Essen <vanessen1@llnl.gov>2021-09-26 06:48:45 -0700
committerGitHub <noreply@github.com>2021-09-26 15:48:45 +0200
commit123c1057714823c2a8dcaa1589b142dcc818b180 (patch)
tree38fda6356261667be7f5972a367382aa91062f19 /var
parentb909560ed5c1f33dd8dfd2dbb1eae1027ada8579 (diff)
downloadspack-123c1057714823c2a8dcaa1589b142dcc818b180.tar.gz
spack-123c1057714823c2a8dcaa1589b142dcc818b180.tar.bz2
spack-123c1057714823c2a8dcaa1589b142dcc818b180.tar.xz
spack-123c1057714823c2a8dcaa1589b142dcc818b180.zip
onnx: fix python version in environments (#26131)
When using the ONNX package inside of an environment that specifies a python3 executable, it will attempt to use a system installed version. This can lead to a failure where the system python and the environment python don't agree and the system python ends up with an invalid environment. Forces ONNX to use the same version of python as the rest of the spec. Co-authored-by: Greg Becker <becker33@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/onnx/package.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/onnx/package.py b/var/spack/repos/builtin/packages/onnx/package.py
index aac83a9477..51185e99b3 100644
--- a/var/spack/repos/builtin/packages/onnx/package.py
+++ b/var/spack/repos/builtin/packages/onnx/package.py
@@ -18,6 +18,8 @@ class Onnx(CMakePackage):
git = "https://github.com/onnx/onnx.git"
version('master', branch='master')
+ version('1.10.1', sha256='cb2fe3e0c9bba128a5790a565d81be30f4b5571eaca5418fb19df8d2d0f11ce2')
+ version('1.10.0', sha256='705a27ee076713b8c755911913c9ffa8f96b95fc3a8568ed0b8e1dd954d67147')
version('1.9.0', sha256='61d459a5f30604cabec352574119a6685dfd43bfa757cfbff52be9471d5b8ea0')
version('1.8.0_2020-11-03', commit='54c38e6eaf557b844e70cebc00f39ced3321e9ad') # py-torch@1.8:1.9
version('1.7.0_2020-05-31', commit='a82c6a7010e2e332d8f74ad5b0c726fd47c85376') # py-torch@1.6:1.7
@@ -36,3 +38,8 @@ class Onnx(CMakePackage):
depends_on('protobuf')
generator = 'Ninja'
+
+ def cmake_args(self):
+ # Try to get ONNX to use the same version of python as the spec is using
+ args = ['-DPY_VERSION={0}'.format(self.spec['python'].version.up_to(2))]
+ return args