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.
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
- 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]
- 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]
- 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]
- Build alternate library versions (e.g. 32-bit libraries on the 64-bit system). [default: enabled]
UPC Compiler Configuration Options
- 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]
- Choose the representation of a UPC pointer-to-shared. [default: packed]
- Choose position of the address field used in the UPC pointer-to-shared representation. [default: first]
- Choose bit distribution in the packed UPC pointer-to-shared representation. [default: 20,10,34]
- 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
- Specify the maximum number of locks that can be held by a single UPC thread (at the same time). [default: 1024]
- Specify the maximum number of children in each sub-tree used to implement UPC collective operations (e. g., upc_barrier). [default: 4]
- 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 stack frame backtrace report when UPC runtime fatal errors occur or by user request (via signal) [default: enabled]
- Enable the use of GDB for UPC stack backtrace [default: enabled]
- Enable signal support for UPC stack backtrace [default: enabled]
- Specify which GDB to use for UPC backtrace support [default: gdb]
- Specify the signal to be used for UPC stack backtrace [default: SIGUSR1]
UPC Portals4 Runtime Configuration Options
- 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 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 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 runtime support for Portals4 triggered operations. [default=yes]
- Enable UPC runtime support optimization for accessing shared memory of the node local threads. [default=yes]
- Specify prefix directory for installed Portals4 library package. Equivalent to --with-portals4-include=PATH/include plus --with-portals4-lib=PATH/lib.
- Specify directory for installed Portals4 include files.
- Specify directory for the installed Portals4 library.
- Specify the base index of the first Portals4 PTE used by the UPC runtime. [default=16]
- Specify the size (in bytes) of the bounce buffer that is used by the UPC runtime to buffer network data. [default=256K]
- 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]
- 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 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:
- Set the following environment variables
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
- Configure GUPC with "--disable-multilib" option
More information on the subject can be found in the following e-mail list thread:
- Published: 10 November 2013