Skip to content

Commit c00945a

Browse files
authored
Build ORT by default for Mac OS X versions 10.12+ (#3626)
1 parent 99415f0 commit c00945a

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

‎BUILD.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ Open Developer Command Prompt for Visual Studio version you are going to use. Th
2323
The default Windows CMake Generator is Visual Studio 2017, but you can also use the newer Visual Studio 2019 by passing `--cmake_generator "Visual Studio 16 2019"` to `.\build.bat`
2424

2525

26-
#### Linux
26+
#### Linux/Mac OS X
2727
```
2828
./build.sh --config RelWithDebInfo --build_shared_lib --parallel
2929
```
30+
By default, ORT is configured to be built for a minimum target Mac OS X version of 10.12.
31+
The shared library in the release Nuget(s) and the Python wheel may be installed on Mac OS X versions of 10.12+.
3032

3133
#### Notes
3234

@@ -61,15 +63,17 @@ The default Windows CMake Generator is Visual Studio 2017, but you can also use
6163
|Windows 10 | YES | YES | VS2019 through the latest VS2015 are supported |
6264
|Windows 10 <br/> Subsystem for Linux | YES | NO | |
6365
|Ubuntu 16.x | YES | YES | Also supported on ARM32v7 (experimental) |
66+
|Mac OS X | YES | NO | |
6467
6568
* GCC 4.x and below are not supported.
6669
6770
### OS/Compiler Matrix:
6871
69-
| OS/Compiler | Supports VC | Supports GCC |
70-
|-------------|:------------:|:----------------:|
71-
|Windows 10 | YES | Not tested |
72-
|Linux | NO | YES(gcc>=4.8) |
72+
| OS/Compiler | Supports VC | Supports GCC | Supports Clang |
73+
|-------------|:------------:|:----------------:|:----------------:|
74+
|Windows 10 | YES | Not tested | Not tested |
75+
|Linux | NO | YES(gcc>=4.8) | Not tested |
76+
|Mac OS X | NO | Not tested | YES (Minimum version required not ascertained)|
7377
7478
## System Requirements
7579
For other system requirements and other dependencies, please see [this section](./README.md#system-requirements-pre-requisite-dependencies).

‎cmake/CMakeLists.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15")
99
cmake_policy(SET CMP0092 NEW)
1010
endif()
1111

12+
# Support OS X versions 10.12+
13+
# This variable is ignored on non-Apple platforms and needs to be set prior to the first project(...) invocation
14+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version for ORT" FORCE)
15+
1216
# Project
1317
project(onnxruntime C CXX)
1418

‎tools/ci_build/build.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import hashlib
1616
import itertools
1717

18-
1918
logging.basicConfig(
2019
format="%(asctime)s %(name)s [%(levelname)s] - %(message)s",
2120
level=logging.DEBUG)
@@ -1357,6 +1356,16 @@ def build_python_wheel(
13571356
args = [sys.executable, os.path.join(source_dir, 'setup.py'),
13581357
'bdist_wheel']
13591358

1359+
# We explicitly override the platform tag in the name of the generated build wheel
1360+
# so that we can install the wheel on Mac OS X versions 10.12+.
1361+
# Without this explicit override, we will something like this while building on MacOS 10.14 -
1362+
# [WARNING] MACOSX_DEPLOYMENT_TARGET is set to a lower value (10.12)
1363+
# than the version on which the Python interpreter was compiled (10.14) and will be ignored.
1364+
# Since we need to support 10.12+, we explicitly override the platform tag.
1365+
# See PR #3626 for more details
1366+
if is_macOS():
1367+
args += ['-p', 'macosx_10_12_x86_64']
1368+
13601369
# Any combination of the following arguments can be applied
13611370
if nightly_build:
13621371
args.append('--nightly_build')
@@ -1731,4 +1740,4 @@ def main():
17311740
sys.exit(main())
17321741
except BaseError as e:
17331742
log.error(str(e))
1734-
sys.exit(1)
1743+
sys.exit(1)

0 commit comments

Comments
 (0)