| Article Index |
|---|
| GCC UPC Configuration |
| Installing from a binary release |
| All Pages |
Installing GCC UPC from the source
The gzip'ed source tar file contains the source code that can be configured and installed on any of the supported systems.
To configure and install from the source release use the following steps:
- Download and unpack the source gzip'ed tar file (assume that source, build, and release directory are located under /upc/)
mkdir /upc
mkdir /upc/src
mkdir /upc/wrk
mkdir /upc/rls
cd /upc/src
tar xpzf /upc/download/upc-4.3.2.5.src.tar.gz - Configure source release
cd /upc/wrk
/upc/src/upc-4.3.2.5/configure --prefix=/upc/rls [...]GCC UPC accepts various configuration options that affect code size and execution efficiency:
--with-upc-pts=packed
Packed shared pointer representation (default). More efficient, but by default limits the maximum layout specifier (block size) to 65536, number of threads to 4096. This can be adjusted with --with-upc-packed option.--with-upc-pts=struct
Structure shared pointer representation. Compatible with previous implementations of GCC UPC. Supports a large layout specifier and maximum number of threads.--with-upc-packed-bits=phase,thread,addr
Packed shared pointer layout. Allows the user to specify number of bits allocated for each filed of the shared pointer. Sum of the specified fields must be 64. Default values are: addr=36 thread=12 phase=16.--upc-pts-vaddr-order=[first,last]
Define if vaddr goes first or last in the shared pointer representation. Applys to both packed and struct. Default is first.--disable-boostrap
By default, GCC/UPC 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.
--disable-upc-affinity
When supported by the underlying OS, take advantage of cpu affinity support (default). Specifying --disable-upc-affinity will build the GCC/UPC runtime without cpu affinity support.
--disable-upc-numa
When supported by the underlying OS, the GCC/UPC runtime will take advantage of NUMA support. This is enabled by default. Specifying --disable-upc-numa will build the GCC/UPC runtime without NUMA support.
--disable-upc-link-script
When supported by the underlying OS, the GCC/UPC compiler will create linkage sections for shared variables that are tagged as "no load" sections. The --disable-upc-link-script configuration switch disables the use of the custom linker script that is used to implement the "no load" section. Link script is enabled for GNU linker only.
--enable-checking
Primarily intended as an aid to developers, the --enable-checking enables various internal checks within the GCC/UPC compiler. Compilations will be slower, but the checking can help catch bugs in the compiler's internal logic.
NOTE: GCC/UPC 4.3 and higher requires GMP and MPFR libraries to build and install. If those libraries are installed in non-standard areas (e.g. /usr/include, /usr/lib), their position must be specified on the configuration line with "--with-gmp" and "--with-mpfr" configuration switches.
NOTE: SGI and Mac ports do not use GNU linker for creating executable programs and an option "--without-gnu-ld" is used on the configuration command line. - Build binary release and install
make
make install - Place /usr/local/upc/bin in your shell's path variable, and the GCC/UPC compiler is ready to use. The 'upc' command invokes the compiler.
SAMPLE CONFIGURATIONS:
Linux hosts
/upc/src/configure --prefix=/usr/local/upcMac OS X (Leopard)
/upc/src/configure --prefix=/usr/local/upc --without-gnu-ld \Mac OS X (Snow Leopard) 64 bit compiler
--with-gmp=/opt/local --with-mpfr=/opt/local
/usr/src/configure --prefix=/usr/local/upc --without-gnu-ld \SGI Irix 6.5 with 64 bit ABI by default
--build=x86_64-apple-darwin10 \
--with-gmp=/opt/local --with-mpfr=/opt/local
/upc/src/configure --prefix=/usr/local/upc \Cray XT3/4/5
--with-gnu-as --with-as=/usr/local/bin/gas \
--without-gnu-ld --with-ld=/bin/ld \
--with-gmp=/usr/local --with-mpfr=/usr/local \
--with-abi=64
/upc/src/configure --prefix=/upcdir_release_path \Cray T3E (GCC UPC Version 3.4.4.1)
--build=x86_64-[catamount,cnl]-linux-gnu
/upc/src/configure --prefix=/usr/local/upc \Then build and install the compiler.
--with-as=/opt/ctl/bin/cam \
--with-ld=/opt/ctl/bin/cld \
--enable-languages="upc"
make LD="/opt/ctl/bin/cld" CFLAGS_FOR_TARGET=\
"-g -O2" CFLAGS="-g -h tolerant"
Review the log file for any changes and install the compiler if no errors were reported.
make LD=/opt/ctl/bin/cld CFLAGS_FOR_TARGET=\
"-g -O2" CFLAGS="-g -h tolerant" install
Installing from a binary release
The gzip'ed tar files contain an installable binary release of the UPC compiler, built for their respective target platforms.
All the binary releases are built with the following configuration options:
- Packed shared pointer representation
- UPC thread affinity supported (if available)
- UPC thread NUMA supported (if available)
The binary release is built to install under /usr/local/upc. However, the release can be installed in any convenient location - the 'upc' command finds the programs it requires, relative to its location.
The tar file contains paths which do not begin with "/". They are relative to the root directory. To install in /usr/local/upc, issue the following commands (the Linux Intel x86_64 release is illustrated below):
cd /
tar xpf upc-4.3.2.5-x86_64-linux-fc11.tar.gz
The commands above, must be issued from a sysadmin account that has write access to /usr/local. A /usr/local/upc directory will be created.
If you don't have administrative privileges to /usr/local directory, you may install and run the compiler from somewhere else. Here's an example, where binary installation file is downloaded in /upc/test and then compiler is installed in /upc/test/usr/local/upc:
cd /upc/test
rm -rf usr/local/upc
tar xf upc-4.3.2.5-x86_64-linux-fc11.tar.gz
cat > count.upc << EOF
#include
#include
#include
int
main ()
{
int i;
for (i = 0; i < THREADS; i++)
{
if (MYTHREAD == i)
{
printf ("%d ", i + 1);
}
}
}
EOF
/upc/test/usr/local/upc/bin/upc count.upc
a.out -fupc-threads-5
1 2 3 4 5





