Bazel Toolchain setup: beginner questions

158 views
Skip to first unread message

Alejandro Armas

unread,
Nov 22, 2022, 4:01:34 PM11/22/22
to bazel-discuss
Hey there Bazel folks,

This is my first message in the bazel-discuss group and I had a few questions about setting up the Bazel build system to utilize a custom compiler. I am trying to use (https://github.com/OpenCilk/opencilk-project), so thanks in advance for answering my basic questions. So far, I am able to install this compiler locally, and on a runner using GitHub Actions (https://github.com/alejandroarmas/OpenCilkInstallAction). My next question is, how do I configure the toolchain with Bazel to use OpenCilk? I am not sure what I can do to inspect which compiler is being used, but I'm certain its not OpenCilk, as I am migrating a project over, and am getting the following error:

```

ERROR: /Users/alejandro/Programming/NeuralNetworkPlusPlus/src/matrix/BUILD:20:11: Compiling src/matrix/m_algorithms.cpp failed: (Aborted): sandbox-exec failed: error executing command 

  (cd /private/var/tmp/_bazel_alejandro/309c5faff7b11cd17e90766e247d5e05/sandbox/darwin-sandbox/19/execroot/__main__ && \

  exec env - \

    APPLE_SDK_PLATFORM=MacOSX \

    APPLE_SDK_VERSION_OVERRIDE=12.3 \

    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \

    PATH=/Users/alejandro/.gem/ruby/3.0.0/bin:/opt/homebrew/opt/ruby@3.0/bin:/opt/homebrew/opt/postgresql@13/bin:/opt/homebrew/opt/postgresql@13/bin:/opt/homebrew/opt/postgresql@13/bin:/Users/alejandro/miniforge3/bin:/Users/alejandro/miniforge3/condabin:/Users/alejandro/Downloads/opencilk-project/llvm/build/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/alejandro/.cargo/bin \

    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk \

    TMPDIR=/var/folders/bh/79ms89214n70lb56qjzk005c0000gn/T/ \

    XCODE_VERSION_OVERRIDE=13.4.1.13F100 \

    ZERO_AR_DATE=1 \

  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_alejandro/309c5faff7b11cd17e90766e247d5e05/sandbox/darwin-sandbox/19/sandbox.sb /var/tmp/_bazel_alejandro/install/0a609247a9eb0c65a5f1ae48ca487674/process-wrapper '--timeout=0' '--kill_delay=15' external/local_config_cc/wrapped_clang_pp '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG '-std=c++11' 'DEBUG_PREFIX_MAP_PWD=.' -iquote . -iquote bazel-out/darwin_arm64-fastbuild/bin -Ibazel-out/darwin_arm64-fastbuild/bin/src/matrix/_virtual_includes/m_algorithms -Ibazel-out/darwin_arm64-fastbuild/bin/src/matrix/_virtual_includes/matrix -Ibazel-out/darwin_arm64-fastbuild/bin/src/utilities/_virtual_includes/strong_types -Ibazel-out/darwin_arm64-fastbuild/bin/src/graph/_virtual_includes/functions -Ibazel-out/darwin_arm64-fastbuild/bin/src/utilities/_virtual_includes/config -Ibazel-out/darwin_arm64-fastbuild/bin/src/matrix/_virtual_includes/m_algorithms_concepts -Ibazel-out/darwin_arm64-fastbuild/bin/src/utilities/_virtual_includes/matrix_printer -Ibazel-out/darwin_arm64-fastbuild/bin/src/utilities/_virtual_includes/m_algorithms_code -Ibazel-out/darwin_arm64-fastbuild/bin/src/utilities/_virtual_includes/m_algorithms_utilities -Ibazel-out/darwin_arm64-fastbuild/bin/src/utilities/_virtual_includes/tensor_statistics -MD -MF bazel-out/darwin_arm64-fastbuild/bin/src/matrix/_objs/m_algorithms/m_algorithms.d '-frandom-seed=bazel-out/darwin_arm64-fastbuild/bin/src/matrix/_objs/m_algorithms/m_algorithms.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-canonical-prefixes -pthread '-std=c++20' -fopencilk -pthread -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -target arm64-apple-macosx12.3 -c src/matrix/m_algorithms.cpp -o bazel-out/darwin_arm64-fastbuild/bin/src/matrix/_objs/m_algorithms/m_algorithms.o)

clang++: error: unknown argument: '-fopencilk'

```

Let me know how I should proceed, or if there are any suggestions on how to configure the toolchain setup. Thanks in advance!

Best,

Alejandro

Reply all
Reply to author
Forward
0 new messages