GNU UPC is developed and released under the GPL license. The source, as well as some pre-built binary packages, is released for each version of GNU UPC. Although, configuring and building GNU UPC is similar to configuring GCC itself, this page provides some guidance and help in building and installing GNU UPC, as well as describing options that are GNU UPC specific.
Please visit the GNU UPC prerequisite page for a list of required packages for you system. Also, the following InstallingGCC web page offers more information on building GCC prerequisits.
The bzip'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 bzip'ed tar file (assume that source, build, and release directory are located under $HOME/upc/)
cd $HOME
mkdir upc upc/downlaod upc/src upc/wrk upc/rls cd $HOME/upc/download wget 'http://www.gccupc.org/downloads/upc/rls/upc-4.7.0.2/upc-4.7.0.2.src.tar.bz2' cd $HOME/upc/src
tar xpzf $HOME/upc/download/upc-4.7.0.2.src.tar.bz2 - Install GCC prerequisites
- Use your OS package management system to install the support libraries in standard system locations.
- Alternatively, after extracting the GCC source archive, simply run the ./contrib/download_prerequisitesscript in the GCC source directory. That will download the support libraries and build them automatically as part of GCC and everything will work correctly.
cd upc-4.7.0.2 ./contrib/download_prerequisites
- Configure source release
cd $HOME/upc/wrk
$HOME/upc/src/upc-4.7.0.2/configure --prefix=$HOME/upc/rls --enable-languages=upc [...]In addition to GCC specific option (GNU GCC Configuration), the GNU UPC configuration script accepts various options that affect code size and execution efficiency of the UPC code:
--enable-languages=upc
Specify which front-ends to build. You must explicitly select "upc", as shown above, in order to build GNU UPC.--with-upc-pts=packed
Packed pointer-to-shared representation (default). More efficient, but by default limits the maximum layout specifier (block size) to 1048575, number of threads to 1024, unless --with-upc-packed option is specified.--with-upc-pts=struct
Structure pointer-to-shared representation. Compatible with previous implementations of GCC UPC and supports a large layout specifier and maximum number of threads: addr=64 thread=32 phase=32.--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=34 thread=10 phase=20.--upc-pts-vaddr-order=[first,last]
Define if vaddr goes first or last in the pointer-to-shared representation. Applies to both packed and struct. Default is first.--disable-bootstrap
By default, GNU 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 GNU UPC runtime without cpu affinity support.
--disable-upc-numa
When supported by the underlying OS, the GNU UPC runtime will take advantage of NUMA support. This is enabled by default. Specifying --disable-upc-numa will build the GNU UPC runtime without NUMA support.
--disable-upc-link-script
When supported by the underlying OS, the GNU 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 switch enables various internal checks within the GNU UPC compiler. Compilations will be slower, but the checking can help catch bugs in the compiler's internal logic.
SGI and Mac ports do not use the GNU linker. For these targets, the option "--without-gnu-ld" is used. - Build binary release and install
make -j4 >make.log 2>&1 make install >install.log 2>&1
- Place $HOME/upc/rls/bin in your shell's path variable, and the GNU UPC compiler is ready to use. The 'gupc' command invokes the compiler.
- Test your compiler. Here is an example of UPC code for testing:
cat > count.upc << EOF
#include <upc.h>
#include <stdio.h>
int
main ()
{
int i;
for (i = 0; i < THREADS; i++)
{
if (MYTHREAD == i)
{
printf ("%d ", i + 1);
}
}
}
EOF
/upc/rls/bin/upc count.upc
a.out -fupc-threads-5
1 2 3 4 5
SAMPLE CONFIGURATIONS:
Linux hosts
/upc/src/configure --prefix=/usr/local/upc --enable-languages=upc
For CentOS or Ubuntu versions of Linux please see the GNU UPC configuration section of FAQ.
Mac OS X (Snow Leopard and Lion)
/upc/src/configure --prefix=/usr/local/upc --enable-languages=upc --without-gnu-ld \
--with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local
SGI Irix 6.5 with 64 bit ABI by default (GNU UPC Version 4.3.2.5)
/upc/src/configure --prefix=/usr/local/upc \
--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
Cray T3E (GNU UPC Version 3.4.4.1)
/upc/src/configure --prefix=/usr/local/upc \
--with-as=/opt/ctl/bin/cam \
--with-ld=/opt/ctl/bin/cld \
--enable-languages="upc"
Then build and install the compiler.
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








