Это видео недоступно.
Сожалеем об этом.

Bazel Tutorial for C++ in 30 Minutes

Поделиться
HTML-код
  • Опубликовано: 12 авг 2024
  • In this video, I will show you how to use Bazel to build your C++ programs.
    I cover workspaces, repos, packages, targets, query commands, and many others. I discuss how Bazel BUILD files work and how to build and run your C++ source files.
    - Link to the repo used in this video:
    github.com/ourarash/bazel_tut...
    - A starter template for building CPP files using Bazel:
    github.com/ourarash/cpp-template
    -----------------------------------------------------
    Chapters:
    - Introduction 00:00
    - Why Bazel? 00:52
    - Bazel vs Other Build Tools? 3:56
    - How to use Bazel? 6:25
    - C++ Build Process 7:25
    - Creating a Bazel Repo 9:50
    - Bazel Example 1, Single CPP file: 10:17
    - The Bazel workspace file structure: 12:21
    - Bazel query commands: 14:40
    - Bazel generated files and symlinks 15:46
    - Example 2, single library file: 16:50
    - Example 30, multiple library files: 20:18
    - Visibility of targets in Bazel 21:23
    - Summary 26:29
    - A Github template repo for Bazel C++ projects 28:34
    -----------------------------------------------------
    Let me know if you have any questions in the comments!
    -----------------------------------------------------
    See my other videos on:
    - How to use Google Benchmark for C++ Programs: • How to use Google Benc...
    - Bazel and unit tests with GTest: • Bazel & Google Test in...
    - Debugging in Visual Studio Code for C++: • Debugging C++ in Visua...
    - Visual Studio Code, Top Features: • Visual Studio Code Top...
    -----------------------------------------------------
    Keep in touch with me:
    / ourarash
    / ourarash
    I'm the founder of BitcoinCrazyness app, the Most Advanced Cryptocurrency mobile APP for alerts, Check it out:
    www.bitcoincrazyness.com/

Комментарии • 17

  • @kunleolutomilayo4018
    @kunleolutomilayo4018 Год назад +2

    Concise and straight to the point. Good job with the reviews in between examples and following all examples.

  • @halilibrahimakgun7569
    @halilibrahimakgun7569 3 месяца назад

    I think, you explained a complicated topic in a simple way. Thanks.

  • @user-nd1jf1rc2g
    @user-nd1jf1rc2g 4 месяца назад +1

    thanks a lot for this incredibly helpful tutorial!

  • @vivekmaurya571
    @vivekmaurya571 Год назад

    This is so informative 😊 thanks!!

  • @87yassmin
    @87yassmin Год назад

    Very informative video 👏 Thanks

  • @palasghosh182
    @palasghosh182 Год назад

    Thanks for this informative tutorial. This tutorial can be extended on the topic how to set compiler options and integration of Google test.

  • @HuyNguyen-ms3zi
    @HuyNguyen-ms3zi Год назад +1

    I would be grateful if you could teach us also advanced features of Bazel. Good tutorial resources for them are very scarce on the internet.

  • @gfaerny
    @gfaerny Год назад

    Thanks ari

  • @RamsesAldama
    @RamsesAldama Год назад

    Nice tutorial. How do you choose the compiler and the standard to compile?

  • @manikandanraju3673
    @manikandanraju3673 Год назад

    Does it compile with gcc compiler? is`nt clang default compiler for bazel C++?

  • @Tabbu84
    @Tabbu84 4 месяца назад

    I am working in one of the bazel python project need your support.
    Plz let me know How to contact you

  • @user-lc6gm9kn8q
    @user-lc6gm9kn8q 8 месяцев назад +1

    Why is this not the official "get-started" ?

  • @romhoor
    @romhoor Год назад

    Why do you rush so much?

    • @arisaif
      @arisaif  Год назад +1

      I'm working on pacing myself!

    • @ashwinberyl4552
      @ashwinberyl4552 5 месяцев назад

      @romhoor Watch on x0.75 speed

  • @vijayannamalaisamy3319
    @vijayannamalaisamy3319 2 месяца назад

    Thank you for the video. I have got the below error and struggling to solve. Could you please help me?
    bazel run examples/example1:example1
    INFO: Analyzed target //examples/example1:example1 (0 packages loaded, 0 targets configured).
    ERROR: /home/vijay/RDK/AI-ML/bazel/yt_tutorial/bazel_tutorial/examples/example1/BUILD:3:10: Compiling examples/example1/main.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //examples/example1:example1) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF ... (remaining 24 arguments skipped)
    Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
    src/main/tools/linux-sandbox-pid1.cc:296: "mount(/home/vijay/RDK/AI-ML/bazel/yt_tutorial/bazel_tutorial, /root/.cache/bazel/_bazel_root/6bcc92eabc1444bec0337c0a5b07189d/sandbox/linux-sandbox/12/_hermetic_tmp/bazel-source-roots/0, nullptr, MS_BIND | MS_REC, nullptr)": Permission denied
    Target //examples/example1:example1 failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    INFO: Elapsed time: 0.061s, Critical Path: 0.00s
    INFO: 2 processes: 2 internal.
    ERROR: Build did NOT complete successfully
    ERROR: Build failed. Not running target

    • @arisaif
      @arisaif  2 месяца назад

      The error message indicates that the bazel build process is failing due to a permission denied issue when trying to execute a CppCompile command. Here are a few steps to troubleshoot and resolve this issue:
      Check Permissions:
      Ensure that you have the necessary permissions to access the directory and files involved in the build process. You can try running chmod -R 755 /home/vijay/RDK/AI-ML/bazel/yt_tutorial/bazel_tutorial/ to grant read, write, and execute permissions to the user.
      Run as Root:
      If the permission issue persists, try running the build command as root using sudo. For example, sudo bazel run examples/example1:example1.
      Sandbox Debugging:
      Use the --sandbox_debug flag to get more detailed information about what is happening in the sandbox environment. This can provide more insights into why the permission is being denied.