mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Chang how numpy version is handled. (#8130)
Numpy has binary compatibility, which means "binaries compiled against a given version of NumPy will still run correctly with newer NumPy versions, but not with older versions." So, if an onnx runtime package was built with numpy version A, then at run time it requires numpy version >=A. In this change, we read numpy version from the installed packages at build time, to avoid manually keeping the build time/runtime consistency.
This commit is contained in:
parent
db88f3059c
commit
1fa6986656
4 changed files with 11 additions and 11 deletions
|
|
@ -1372,6 +1372,14 @@ if (onnxruntime_USE_VITISAI)
|
|||
endif()
|
||||
|
||||
configure_file(onnxruntime_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime_config.h)
|
||||
if(WIN32)
|
||||
configure_file(../requirements.txt.in ${CMAKE_CURRENT_BINARY_DIR}/Debug/requirements.txt)
|
||||
configure_file(../requirements.txt.in ${CMAKE_CURRENT_BINARY_DIR}/Release/requirements.txt)
|
||||
configure_file(../requirements.txt.in ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/requirements.txt)
|
||||
configure_file(../requirements.txt.in ${CMAKE_CURRENT_BINARY_DIR}/MinSizeRel/requirements.txt)
|
||||
else()
|
||||
configure_file(../requirements.txt.in ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt)
|
||||
endif()
|
||||
|
||||
if (onnxruntime_USE_CUDA)
|
||||
#The following 6 lines are copied from https://gitlab.kitware.com/cmake/cmake/issues/17559
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
numpy >= 1.16.6
|
||||
protobuf
|
||||
flatbuffers
|
||||
3
requirements.txt.in
Normal file
3
requirements.txt.in
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
numpy >= @Python_NumPy_VERSION@
|
||||
protobuf
|
||||
flatbuffers
|
||||
8
setup.py
8
setup.py
|
|
@ -396,14 +396,6 @@ with open(requirements_path) as f:
|
|||
install_requires = f.read().splitlines()
|
||||
|
||||
|
||||
if is_manylinux:
|
||||
AUDITWHEEL_PLAT = environ.get('AUDITWHEEL_PLAT', None)
|
||||
if AUDITWHEEL_PLAT == 'manylinux2014_aarch64':
|
||||
for i in range(len(install_requires)):
|
||||
req = install_requires[i]
|
||||
if req.startswith("numpy"):
|
||||
install_requires[i] = "numpy >= 1.19.5"
|
||||
|
||||
if enable_training:
|
||||
def save_build_and_package_info(package_name, version_number, cuda_version):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue