Bazel equivalent of include what you use? - bazel

Is there a Bazel equivalent of include what you use? I'm looking for a tool that will eliminate false dependencies in a Bazel build by removing dependencies from BUILD files and checking if the project still builds.
Is there any reason this approach wouldn't work?

Related

Have rules_cc use latest version of GCC

I am using Bazel to build my project. One of the dependencies is Abseil, which in turn depends on rules_cc.
I notice that when I have multiple versions of GCC installed, rules_cc may be directing Bazel to use an older version of GCC even though I want the newest version of GCC to be used. To get around this, I have been manually editing bazel-project/external/local_config_cc/BUILD to reference the newest version of GCC.
Is there a better or "right" way to do this?
Add that flag to .buildrc (or to your bazel build invocation):
build --action_env=CC=/path/to/your/gcc
you can also set a CXX variable, but at this moment only a CC is used by Bazel
That approach use toolchain automatically generated by Bazel. You can also create your own toolchain, but it is a complicated process.

Is it required to build LLVM in order to build hipSYCL?

I'm running Centos 7 and am trying to build hipSYCL (see here)
The issue is that hipSYCL needs to have cmake info from the LLVM build (via the LLVM_DIR cmake variable).
This is problematic for me because building LLVM requires a massive 35Gb for the libraries and exes. I don't have that much memory to spare.
I did find a build of llvm-toolset-8.0 online for Centos 7 and installed it, but to my surprise, that didn't seem to work with LLVM_DIR because there's no cmake files (since I didn't build it locally).
So, my question would be, is there a way to build hipSYCL using pre-built LLVM-clang?
If I'm missing or misunderstanding something, I'd appreciate any help.
LLVM publishes the necessary cmake files, and the binary OS packages I've seen include it, generally in a directory called /usr/lib/llvm*/lib/cmake and in a package called something like llvm-*-dev.

Detecting version of NVCC in bazel

I want to detect in bazel what version of nvcc is installed in the system and set specifically flags based on the version. What is the best way to achieve that? I am pretty new to bazel build system.
We have recently rolled-out Skylark remote repository and that's how we do auto-configuration for C++ so I guess that the best way to achieve that. See http://bazel.io/blog/2016/03/31/autoconfiguration.html

Building DEB package for fsharp compiler

I would like to install the fsharp compiler from Github on my Debian system, and the usual way would be to create a deb package first and then install it (so it is possible to uninstall it later, etc.). What is the easiest way to achieve this? All the examples of how to use dh_make assume you have a source tar.gz appropriately named, whereas I don't. Also I need to use some prefix for the autogen script:
./autogen.sh --prefix=/usr
I am not sure it this makes the task any more difficult.
This should actually be fairly simple to achieve with a binary package - which will also be cross-platform because the F# compiler itself is written in F#. The compiler itself is fairly standalone and depends only on a few BCL libraries. There are versions that run on Mono.
More important than installing the compiler is the integration with your platform's build system(s). Microsoft ships a Microsoft.FSharp.targets file for MSBuild, I don't know whether that will work with Mono's xBuild.
I have put together a blog post that explains where to find the various bits that make up the F# compiler and how to package them to compile on a platform that has only .NET and MSBuild (AppHarbor in my case), which you may find helpful.

Blackberry Build Tool

Could anyone suggest the best Build Tools for use in the build process when building a blackberry application.
Is it just the creation of an ANT project, does that cope with signing etc?
Is there a better tool out there? I'd prefer a lightweight Windows solution.
I normally use Automated Build Studio -- it can build ANT and it can also compile Java.
I don't know of any serious alternative to bb-ant-tools.

Resources