Skip to content

Commit eda2f90

Browse files
committed
create stub dist-info for onnxruntime in ONNX-Runtime v1.10.0 with CUDA
1 parent 65bc6c4 commit eda2f90

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.10.0-foss-2021a-CUDA-11.3.1.eb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and transforms."""
1515

1616
toolchain = {'name': 'foss', 'version': '2021a'}
1717

18+
# ONNX Runtime with support for GPUs is distributed under the name 'onnxruntime-gpu' in PyPI
1819
source_urls = ['http://pypi.python.org/packages/source/o/onnxruntime-gpu']
1920
local_whl_tmpl = 'onnxruntime_gpu-%%(version)s-cp39-cp39-manylinux_2_17_%s.manylinux2014_%s.whl'
2021
sources = [local_whl_tmpl % ('%(arch)s', '%(arch)s')]
@@ -35,8 +36,23 @@ dependencies = [
3536
use_pip = True
3637
download_dep_fail = True
3738

39+
# Due to its name 'onnxruntime-gpu', this package does not fullfil requirements on 'onnxruntime' although it provides
40+
# the 'onnxruntime' python module. Fix this dependency issue in pip by creating a stub 'onnxruntime' dist-info folder
41+
_py_sitepkgs = '%(installdir)s/lib/python%(pyshortver)s/site-packages'
42+
postinstallcmds = [
43+
"cp -r %s/onnxruntime{_gpu,}-%%(version)s.dist-info" % _py_sitepkgs,
44+
"sed -i 's/onnxruntime.gpu/onnxruntime/g' %s/onnxruntime-%%(version)s.dist-info/{METADATA,RECORD}" % _py_sitepkgs,
45+
]
46+
3847
sanity_pip_check = True
3948

49+
_py_sitepkgs_dirs = ['onnxruntime', 'onnxruntime-%(version)s.dist-info', 'onnxruntime_gpu-%(version)s.dist-info']
50+
51+
sanity_check_paths = {
52+
'files': [],
53+
'dirs': ['lib/python%%(pyshortver)s/site-packages/%s' % x for x in _py_sitepkgs_dirs],
54+
}
55+
4056
options = {'modulename': 'onnxruntime'}
4157

4258
moduleclass = 'devel'

0 commit comments

Comments
 (0)