Detecting version of NVCC in bazel - 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

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.

How to build os image including gcc g++ tool chain for ARM platform?

I am trying to build an OS image for TI OMAP4 Pandaboard. The downloaded BSP can be built but very limited without gcc g++ compiler. I think it much difficult to add the tool chain in QNX Momentics IDE, because there are so many files to be added. Can I manually modify the buildfile to do it? If possible, please give me an example. Thanks in advance.
No, it is not possible to run g++ on your TI OMAP4 Pandaboard (unless you build g++ from sources for the ARM platform using the existing QNX toolchain running on an X86 platform).
Why not possible: QNX releases their build tools only for X86-based hosts. The currently supported host OS-es include some variants of Windows, Linux and QNX but the precondition is that the host hardware is X86-based.
Likely you do not actually want to build your library on the target hardware; it should not matter where you actually do the build (except in very special cases where you build some source code based on user input, etc.)
What you need to do is build your library on your development host using the ARM toolchain (QCC if you want to use the high-level tools; ntoarmv7-g++ if you want to use the familiar g++ interface). Once you have your binary you can include it in the .ifs file. You just need to include a line in the .build file, similar to the following example:
/path/on/targetfs/yourbinary=/path/on/buildmachine/yourbinary
If your build environment is configured so that mkifs finds your binary then you can omit the "path/on/buildmachine" part.
If you are fine with having the binary on your target under /proc/boot then you can omit the "/path/on/targetfs/ part as well.
For ease of development it would usually be more convenient for you to store your binary on the SD card with a FAT filesystem. Then you can just copy your binary to the SD without having to rebuild the .ifs file.
Finally, once you get experienced you will want to export a part of your host-machine's filesystem via CIFS or NFS and mount it directly from your target. This will save all the trouble of having to copy files (and, possibly, reboot the target) in each build cycle. But this is far off from your original question.
I think you are trying to get the QNX C/C++ compiler to run on your target board. Correct?
If so, rather than installing the Runtime Kit, you install the QNX Software Development Platform and you should be good to go.
You can also use the System Builder to customize your QNX OS, but this is going to be harder than just using the QNX SDP.
One other note: QNX uses qcc for C and QCC for C++ instead of gcc. They both use gcc under the hood, but to compile on QNX, use qcc instead of gcc.

Can GCov be used in windows?

Can I install gcov tool in windows?
Or can I take plug-in of this tool in eclipse in windows?
I am very new to this tool. I don't have any idea about this tool. Please help me to get the information of this tool.
please tell me the requirements to run this tool on my machine.
Where can I get more information about gcov and also please provide a link from where I can download this tool.
Does gcov tool accepts only c/c++ files or it also takes header files(*.h) as input?
Can I install gcov tool in windows?
Yes. We use gcc to build QNX projects in Windows.
Where can I get more information about gcov and also pls provide a link from where I can download this tool.
gcov is a part gcc,
Does gcov tool accepts only c/c++ files or it also takes header files(*.h) as input?
gcov accepts cpp, and h too
gcov is part of the gcc tools. If you are building and linking with gcc on Windows (which is fairly unusual), you could use it. Since it is part of the compiler, you cannot add it as a plugin to your IDE, though there are probably plugins that allow you to interact with the data that it produces.
It sounds to me like you need to figure out what you are trying to do. gperftools or valgrind might be better suited to your needs.
You can use eclipse CDT. It has built in gcov plugin.

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