Skip to content

Commit

Permalink
Try clang build for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
panickal-xmos committed Nov 7, 2023
1 parent d693e58 commit 2d45cad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ jobs:
shell: pwsh
run: |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-llvm mingw-w64-x86_64-lld
- name: Build setup
shell: cmd
run: |
Expand All @@ -209,14 +215,13 @@ jobs:
cd build
cmake ..
cmake --build . -t install --parallel 2 --config Release
- name: Build xformer
shell: cmd
run: |
cd %GITHUB_WORKSPACE%/xformer
IF DEFINED GOOGLE_APPLICATION_CREDENTIALS set "BAZEL_EXTRA_ARGS=--remote_cache=${{ env.BAZEL_CACHE_URL }}/${{ runner.os }}-${{ runner.arch }}-python${{ matrix.python-version }} --google_default_credentials --remote_upload_local_results=true --experimental_remote_cache_compression"
set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC
bazelisk build //:xcore-opt --verbose_failures --local_ram_resources=5120 --action_env PYTHON_BIN_PATH="C:/hostedtoolcache/windows/Python/3.9.13/x64/python.exe" %BAZEL_EXTRA_ARGS% --//:disable_version_check
set BAZEL_LLVM=C:\msys64\mingw64
bazelisk build --config win_clang //:xcore-opt --verbose_failures --local_ram_resources=5120 --action_env PYTHON_BIN_PATH="C:/hostedtoolcache/windows/Python/3.9.13/x64/python.exe" %BAZEL_EXTRA_ARGS% --//:disable_version_check
- name: Build windows wheels
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.PRETEND_VERSION }}
Expand Down
9 changes: 9 additions & 0 deletions xformer/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ build:windows --features=archive_param_file

build:windows --enable_runfiles

# Use Clang-cl compiler on Windows
build:win_clang --copt=/clang:-Weverything
build:win_clang --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
build:win_clang --extra_execution_platforms=@org_tensorflow//tensorflow/tools/toolchains/win:x64_windows-clang-cl
build:win_clang --host_platform=@org_tensorflow//tensorflow/tools/toolchains/win:x64_windows-clang-cl
build:win_clang --compiler=clang-cl
build:win_clang --linkopt=/FORCE:MULTIPLE
build:win_clang --host_linkopt=/FORCE:MULTIPLE

# Link with these libs only on macos
build:macos --linkopt=-framework
build:macos --linkopt=Foundation
Expand Down

0 comments on commit 2d45cad

Please sign in to comment.