BGClang

From Parts
Jump to: navigation, search

This is a clone of https://wiki.alcf.anl.gov/bgq-earlyaccess/index.php/LLVM because that page is not world-readable.

Usage

A special port of LLVM and clang (the C/C++ frontend) are available on our BG/Q. To make clang easier to use, special wrapper scripts are available:

 * /home/projects/llvm/bin/bgclang (for C code)
 * /home/projects/llvm/bin/bgclang++ (for C++ code)

Please join the mailing list llvm-bgq-discuss. This list will receive notification when the compilers are updated, and can be used to discuss problems, questions, comments, etc. For bug reports, or to download copies of the LLVM and clang patches in use, visit the trac page.

See LLVM for more information.

Softenv

On the ALCF Vesta system, one can use softenv keys to automatically setup the LLVM compiler paths.

   +mpiwrapper-bgclang            bgclang wrappers and toolchain
   +mpiwrapper-bgclang.legacy     bgclang.legacy wrappers and toolchain

Using with MPI

To use bgclang with MPI, add the following directory to your path:

/home/projects/llvm/mpi/clang/bin

or, if you want the 'legacy' MPI library:

/home/projects/llvm/mpi/clang.legacy/bin

and then use mpicc and/or mpicxx.

C++11 MPI Wrappers

There are special C++11 wrapper scripts that give you libc++ as the C++ library for better C++11 support. These are called mpic++11.

Using QPX

bgclang supports using the same QPX intrinsics as bgxlc. This header implements the IBM-style QPX intrinsics in terms of bgclang-specific intrinsics. Note that this header is no longer required, but the documentation is preserved for posterity.

#include <qpxintrin.h>

Known BUGS

  • long double support has been fixed.
  • Inline assembly support has been fixed.

Tips

Some configure scripts what would normally define _GNU_SOURCE don't do this when using bgclang, and this sometimes causes linking errors. If _GNU_SOURCE is defined when building with gcc or xlc, it should probably also be defined when using bgclang. To fix this, add -D_GNU_SOURCE to your CPPFLAGS.