Configuring and building GNU UPC is similar to configuring GCC itself, but the following page provides some guidance and help in building and installing GNU UPC, as well as describing options that are GNU UPC specific.

We use srcdir to refer to the top-level source directory for GUPC; we use objdir to refer to the top-level build/object directory.

It is a requirement that GUPC be built into a separate directory from the sources, which does not reside within the source tree. This is how generally GNU GCC is also built.

When configuring GUPC, either cc or gcc must be in your path or you must set CC in your environment before running configure. Otherwise the configuration scripts may fail.

If you have previously built GUPC in the same directory, do ‘make distclean’ to delete all files that might be invalid. One of the files this deletes is Makefile; if ‘make distclean’ complains that Makefile does not exist or issues a message like “don’t know how to make distclean” it probably means that the directory is already suitably clean.

To simplest command to configure GUPC looks like this:

% mkdir objdir
% cd objdir
% srcdir/configure [options] --prefix=/usr/local \
        --enable-languages=c,c++

By default, the SMP based runtime is configured and built.

 


Configuration Options

The following GCC and GUPC options are provided to better tailor GUPC for your system. The full list of additional GCC configuration options can be found on the GCC web page http://gcc.gnu.org/install/configure.html


General Configuration Options

--prefix=dirname
Specify the top-level installation directory. This is the recommended method to install the tools into a directory other than the default. The top-level installation directory defaults to /usr/local. For GUPC we recommend /usr/local/gupc. [default: /usr/local]
--[enable|disable]-bootstrap
By default, GUPC will be built in three stages, where in the last stage the built compiler compiles itself. Bootstrapping is a useful method of verifying that the compiler is operational, but it takes three times as long to build the compiler. Specifying --disable-bootstrap reduces build time to 1/3 of the default build time. [default: enabled]
--[enable|disable]-checking
Primarily intended as an aid to developers, the checking switch enables various internal checks within the GUPC compiler. Compilations will be slower, but the checking can help catch bugs in the compiler’s internal logic. [default: disabled]
--[enable|disable]-multilib
Build alternate library versions (e.g. 32-bit libraries on the 64-bit system). [default: enabled]

UPC Compiler Configuration Options

--[enable|disable]-upc-link-script
Enable UPC’s use of a custom linker script; this will define the UPC shared section as a no load section on targets where this feature is supported (requires GNU LD). [default: enabled]
--with-upc-pts={struct,packed}
Choose the representation of a UPC pointer-to-shared. [default: packed]
--with-upc-pts-vaddr-order={last,first}
Choose position of the address field used in the UPC pointer-to-shared representation. [default: first]
--with-upc-pts-packed-bits=phase,thread,vaddr
Choose bit distribution in the packed UPC pointer-to-shared representation. [default: 20,10,34]
--enable-upc-link-script
Enable UPC’s use of a custom linker script; this will define the UPC shared section as a no load section on targets where this feature is supported (requires GNU LD). [default=yes]

UPC Runtime Configuration Options

--with-upc-runtime-max-locks=MAX_LOCKS
Specify the maximum number of locks that can be held by a single UPC thread (at the same time). [default: 1024]
--with-upc-runtime-tree-fanout=WIDTH
Specify the maximum number of children in each sub-tree used to implement UPC collective operations (e. g., upc_barrier). [default: 4]
--with-upc-runtime=MODEL
Specify the runtime implementation model for UPC, where MODEL may be: SMP (Symmetric Multiprocessing) or Portals4 (Infiniband with Portals 4.0 Reference Library). [default=SMP]

UPC SMP Runtime Configuration Options

--[enable|disable]-upc-backtrace
Enable stack frame backtrace report when UPC runtime fatal errors occur or by user request (via signal) [default: enabled]
--[enable|disable]-upc-backtrace-gdb
Enable the use of GDB for UPC stack backtrace [default: enabled]
--[enable|disable]-upc-backtrace-signal
Enable signal support for UPC stack backtrace [default: enabled]
--with-upc-backtrace-gdb=GDB
Specify which GDB to use for UPC backtrace support [default: gdb]
--with-upc-backtrace-signal=SIGNAL
Specify the signal to be used for UPC stack backtrace [default: SIGUSR1]

UPC Portals4 Runtime Configuration Options

--enable-upc-runtime-stats
Enable internal UPC runtime statistics collection support; these statistics count the number of various significant internal operations, and dump those counts into a per-process statistics file. [default=no]
--enable-upc-runtime-trace
Enable internal UPC runtime trace collection support; a runtime trace is a time stamped log that records various significant internal events; this trace is written to a per-process log file. [default=no]
--enable-upc-runtime-debug
Enable UPC runtime debugging mode, where more expensive internal checks are implemented, and conservative algorithms are used that reduce the degree of parallelism, and that exercise less complex/sophisticated operations provided by the operating system and/or the network communication packages called by the UPC runtime. In addition, conservative compilation options will be used to build the runtime, and debugging symbols will be generated. [default=no]
--enable-upc-triggered-runtime-ops
Enable UPC runtime support for Portals4 triggered operations. [default=yes]
--enable-upc-node-local-mem
Enable UPC runtime support optimization for accessing shared memory of the node local threads. [default=yes]
--with-portals4=PATH
Specify prefix directory for installed Portals4 library package. Equivalent to --with-portals4-include=PATH/include plus --with-portals4-lib=PATH/lib.
--with-portals4-include=PATH
Specify directory for installed Portals4 include files.
--with-portals4-lib=PATH
Specify directory for the installed Portals4 library.
--with-upc-runtime-pte-base=BASE
Specify the base index of the first Portals4 PTE used by the UPC runtime. [default=16]
--with-upc-runtime-bounce-buffer-size=SIZE
Specify the size (in bytes) of the bounce buffer that is used by the UPC runtime to buffer network data. [default=256K]
--with-upc-runtime-tree-fanout=WIDTH
Specify the maximum number of children in each sub-tree used to implement UPC collective operations (e. g., upc_barrier and upc_global_alloc). [default=2]
--with-upc-node-local-mem=SHMEM
Specify type of shared memory used for node local memory accesses. Possible options are "posix" for POSIX Shared Memory or "mmap" for file based mmap-ed memory. [default=posix]

Build and Install

To build GUPC after the configuration step:

% make
% make install

An optional "-j" argument on the make command line can be used to improve the build time. On systems that have multiple cores, the "-j" can noticeably improve build times. As a general rule, set the value of "N" in "-jN" to about 1.5 times the number of available cores.

To configure and build GUPC with Portals4 runtime support:

% mkdir objdir
% cd objdir
% srcdir/configure [options] --with-upc-runtime=portals4 \
  --enable-languages=c,c++
% make
% make install


Ubuntu 12.4

Ubuntu distribution (version 11.10 and up) integrates support for installing packages from multiple architectures on a single system (https://wiki.ubuntu.com/MultiarchSpec). The current version of GUPC (and GNU GCC) is not compatible with this approach and the following steps must be taken in order build GUPC on the Ubuntu platform:

export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu

More information on the subject can be found in the following e-mail list thread:

http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01649.html