Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/branch.json.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def main():
build_windows = pipeline_steps.generate_step_template("Windows", "build", "", config.build_x86_64)
pipeline_steps.append(build_windows)
if config.build_macos:
build_macos = pipeline_steps.generate_step_template("MacOS", "build", config.build_aarch64, config.build_x86_64)
build_macos = pipeline_steps.generate_step_template("MacOS", "build", config.build_aarch64, "")
pipeline_steps.append(build_macos)
if config.build_linux:
build_linux = pipeline_steps.generate_step_template("Linux", "build", config.build_aarch64, config.build_x86_64)
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/job-build-test-all-debug.json.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main():
debug_windows = pipeline_steps.generate_step_template("Windows", "debug", "", config.build_x86_64)
pipeline_steps.append(debug_windows)
if config.build_macos:
debug_macos = pipeline_steps.generate_step_template("MacOS", "debug", config.build_aarch64, config.build_x86_64)
debug_macos = pipeline_steps.generate_step_template("MacOS", "debug", config.build_aarch64, "")
pipeline_steps.append(debug_macos)
if config.build_linux:
debug_linux = pipeline_steps.generate_step_template("Linux", "debug", config.build_aarch64, config.build_x86_64)
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline.json.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main():
build_windows = pipeline_steps.generate_step_template("Windows", config.action, "", config.build_x86_64)
pipeline_steps.append(build_windows)
if config.build_macos:
build_macos = pipeline_steps.generate_step_template("MacOS", config.action, config.build_aarch64, config.build_x86_64)
build_macos = pipeline_steps.generate_step_template("MacOS", config.action, config.build_aarch64, "")
pipeline_steps.append(build_macos)
if config.build_linux:
build_linux = pipeline_steps.generate_step_template("Linux", config.action, config.build_aarch64, config.build_x86_64)
Expand Down
22 changes: 1 addition & 21 deletions .buildkite/pipelines/build_macos.json.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
from itertools import product

archs = [
"aarch64",
"x86_64",
"aarch64"
]
build_types = [
"RelWithDebInfo",
Expand All @@ -32,10 +31,6 @@
"debug"
]
agents = {
"x86_64": {
"provider": "orka",
"image": "ml-macos-12-x86_64-001.img"
},
"aarch64": {
"provider": "orka",
"image": "ml-macos-12-arm-001.orkasi"
Expand All @@ -51,16 +46,6 @@
"CMAKE_FLAGS": "-DCMAKE_TOOLCHAIN_FILE=cmake/darwin-aarch64.cmake",
"RUN_TESTS": "true",
"BOOST_TEST_OUTPUT_FORMAT_FLAGS": "--logger=JUNIT,error,boost_test_results.junit",
},
"x86_64": {
"TMPDIR": "/tmp",
"HOMEBREW_PREFIX": "/opt/homebrew",
"PATH": "/opt/homebrew/bin:$PATH",
"ML_DEBUG": "0",
"CPP_CROSS_COMPILE": "",
"CMAKE_FLAGS": "-DCMAKE_TOOLCHAIN_FILE=cmake/darwin-x86_64.cmake",
"RUN_TESTS": "true",
"BOOST_TEST_OUTPUT_FORMAT_FLAGS": "--logger=JUNIT,error,boost_test_results.junit",
}
}

Expand Down Expand Up @@ -122,11 +107,6 @@ def main(args):
action='store_true',
default=False,
help="Build for aarch64?.")
parser.add_argument("--build-x86_64",
required=False,
action='store_true',
default=False,
help="Build for x86_64?")

args = parser.parse_args()

Expand Down
1 change: 0 additions & 1 deletion .buildkite/pipelines/create_dra.yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ steps:
depends_on:
- "build_test_linux-aarch64-RelWithDebInfo"
- "build_test_linux-x86_64-RelWithDebInfo"
- "build_test_macos-x86_64-RelWithDebInfo"
- "build_test_macos-aarch64-RelWithDebInfo"
- "build_test_Windows-x86_64-RelWithDebInfo"

Expand Down
22 changes: 2 additions & 20 deletions .buildkite/scripts/steps/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,11 @@ else # Darwin (macOS)
else
TASKS="clean buildZip buildZipSymbols check"
fi
# For macOS we usually only use a particular version as our build platform
# once Xcode has stopped receiving updates for it. However, with Big Sur
# on ARM we couldn't do this, as Big Sur was the first macOS version for
# ARM. Therefore, the compiler may get upgraded on a CI server, and we
# need to hardcode the version that was used to build Boost for that
# version of Elasticsearch.
if [ "$HARDWARE_ARCH" = aarch64 ] ; then
export BOOSTCLANGVER=13
fi

(cd ${REPO_ROOT} && ./gradlew --info -Dbuild.version_qualifier=${VERSION_QUALIFIER:-} -Dbuild.snapshot=$BUILD_SNAPSHOT -Dbuild.ml_debug=$ML_DEBUG $TASKS) || TEST_OUTCOME=$?
else # Darwin x86_64
# For macOS x86_64 we re-use existing Docker scripts and build directly on the machine
function nproc() {
sysctl -n hw.logicalcpu
}
export -f nproc
if [ "$RUN_TESTS" = "true" ]; then
${REPO_ROOT}/dev-tools/docker/docker_entrypoint.sh --test
grep passed build/test_status.txt || TEST_OUTCOME=$?
else
${REPO_ROOT}/dev-tools/docker/docker_entrypoint.sh
fi
echo "Unsupported architecture - macos x86_64"
exit 1
fi
fi

Expand Down
10 changes: 1 addition & 9 deletions .ci/orka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ If you haven't run these before, run the following once so packer downloads the
```
packer init orka-macos-12-arm.pkr.hcl
```
or
```
packer init orka-macos-12-x86_64.pkr.hcl
```

## Build

Expand All @@ -46,7 +42,6 @@ The source images used for the MacOS builds are slightly modified copies of the

The source images are named:
* `ml-macos-12-base-arm-fundamental.orkasi`
* `ml-macos-12-base-x86_64-fundamental.img`

The source image only has the following changes on it:
* Adding passwordless `sudo` for the default `admin` user
Expand All @@ -70,7 +65,4 @@ The packer script does the following:

## Caveats

* Prior to the dependency on PyTorch 2.3.1 we only needed Orka for ARM builds (CI and dependencies), x86_64 builds were
performed via cross-compilation. However, PyTorch 2.3.1 now requires a more modern version of `clang` that our cross
compilation framework provided. As a suitable Orka base image is available for x86_64, it is now simpler to compile
natively for that architecture.
* As of version 8.18 support for macos x86_64 builds has been dropped. It is necessary to checkout and work on previous branches in order to maintain x86_64 Orka VMs.
1 change: 1 addition & 0 deletions build-setup/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export PYTORCH_BUILD_NUMBER=1
Once built copy headers and libraries to system directories:

```
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/include/pytorch
sudo cp -r torch/include/* /usr/local/include/pytorch/
sudo cp torch/lib/libtorch_cpu.dylib /usr/local/lib/
Expand Down
93 changes: 0 additions & 93 deletions build-setup/macos_cross_compiled.md

This file was deleted.

35 changes: 5 additions & 30 deletions cmake/compiler/clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,11 @@
# limitation.
#

# which compilers to use for C and C++
if(DEFINED ENV{CPP_CROSS_COMPILE} AND NOT "$ENV{CPP_CROSS_COMPILE}" STREQUAL "")
message(STATUS "Cross compiling: CPP_CROSS_COMPILE = $ENV{CPP_CROSS_COMPILE}")

set(CROSS_FLAGS --sysroot=${SYSROOT} -B /usr/local/bin -target ${CROSS_TARGET_PLATFORM} -stdlib=libc++)
set(ML_SHARED_LINKER_FLAGS ${CROSS_FLAGS})
set(ML_EXE_LINKER_FLAGS ${CROSS_FLAGS})

# which compilers to use for C and C++
set(CMAKE_C_COMPILER "clang-8")
set(CMAKE_CXX_COMPILER "clang++-8")

set(CMAKE_AR "/usr/local/bin/${CROSS_TARGET_PLATFORM}-ar")
set(CMAKE_RANLIB "/usr/local/bin/${CROSS_TARGET_PLATFORM}-ranlib")
set(CMAKE_STRIP "/usr/local/bin/${CROSS_TARGET_PLATFORM}-strip")
set(CMAKE_LD "/usr/local/bin/${CROSS_TARGET_PLATFORM}-ld")

set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -ru <TARGET> <OBJECTS>")

# where is the target environment located
set(CMAKE_FIND_ROOT_PATH /usr/local/sysroot-${CROSS_TARGET_PLATFORM})
else()
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_AR "ar")
set(CMAKE_RANLIB "ranlib")
set(CMAKE_STRIP "strip")

#set(Boost_COMPILER "-clang-darwin13")
endif()
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_AR "ar")
set(CMAKE_RANLIB "ranlib")
set(CMAKE_STRIP "strip")


list(APPEND ML_C_FLAGS
Expand Down
21 changes: 0 additions & 21 deletions dev-tools/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,3 @@ This image is not intended to be built regularly. When changing the

### Build script: dev-tools/docker/build_check_style_image.sh



## REPOSITORY: ml-macosx-build

### VERSION: 18

### Comments
A Docker image that can be used to **cross compile** the machine learning
C++ code for Intel macOS

This image is not intended to be built regularly. When changing the tools
or 3rd party components required to build the machine learning C++ code:


1. increment the version
2. Change the Dockerfile and build a new image to be
used for subsequent builds on this branch.
3. Update the version to be used for builds in *dev-tools/docker/macosx_builder/Dockerfile*.

### Build script: dev-tools/docker/build_macosx_build_image.sh

40 changes: 0 additions & 40 deletions dev-tools/docker/build_macosx_build_image.sh

This file was deleted.

37 changes: 0 additions & 37 deletions dev-tools/docker/macosx_builder/Dockerfile

This file was deleted.

Loading