intrepid.com



Linux (SuSE) Intel ia64-based GCCUPC compiler

Posted on Thu, 2006-09-07 16:22

ITANIUM-LOGO

Build the GCC UPC Compiler

Please download the latest full UPC source release from our downloads page. Use the following simple steps to create your own UPC compiler:

  • Create working directory and change to it

    mkdir upcdir; cd upcdir

  • Unpack the distribution (assuming that file was downloaded in upcdir and release version is 4.0.3.4)

    tar xzf upc-4.0.3.4.tar.gz

  • Decide where to install executables (upcdir_release_path). By default /usr/local/upc directory is used.
  • Make the builld directory and change to it

    mkdir build; cd build

  • Configure the distribution using the configure script, supplying switches as required. Make sure default gcc is used to rebuild GCC UPC source code

    CC=/usr/bin/gcc ../configure --prefix=/upcdir_release_path

  • Build and install the compiler

    make; make install

If you prefer of patching the GCC source code, you can download the full corresponding GCC source release from gnu.org and a UPC patch file located on our downloads page.

Installing the Redhat Linux Binary Release

A pre-built binary release can be downloaded from our downloads page for Fedora Core 5. This binary release is built to install under /usr/local/upc. The tar file itself has path's which do not begin with "/". They are relative to the root directory. To install in /usr/local/upc, issue the following commands:

cd /
gunzip -c < /upc/bin_release/upc-4.0.3.4-ia64-sgi-sues9.tar.gz | tar xpf -

The commands above, need to be issued from a sysadmin account that has write access to /usr/local. A /usr/local/upc directory will be created.

If you want to install and run the compiler somewhere else, then you'll need to set the UPC_EXEC_PREFIX environment variable (note: the directory name must end with a "/"). Here's an example, where the compiler was installed in /upc/test/usr/local/upc:

cd /upc/test
rm -rf usr/local/upc
gunzip -c < /upc/upc_bin_rls/upc-4.0.3.4-ia64-sgi-sues9.tar.gz | tar xpf -
setenv UPC_EXEC_PREFIX /upc/test/usr/local/upc/bin/
/upc/test/usr/local/upc/bin/upc count.upc
a.out -fupc-threads-5
1 2 3 4 5

Compile and Run a simple UPC test program

Once the compiler has been built and installed, try running the following simple test program:

mkdir ~/upctest
cd ~/upctest
cat > hello.upc << EOF
#include <upc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
int i;
for (i = 0; i < THREADS; ++i)
{
upc_barrier;
if (i == MYTHREAD)
printf ("Hello world from thread: %d\n", MYTHREAD);
}
return 0;
}
EOF
$ upc -fupc-threads-4 hello.upc -o hello
$ ./hello

The output should appear as follows:

Hello world from thread: 0
Hello world from thread: 1
Hello world from thread: 2
Hello world from thread: 3


Known Problems and Issues

To report bugs or get the latest news concerning bug fixes, subscribe or send email to the GCC UPC mailing list.


Limitations

The maximum number of threads is limited to 65536.

The maximum layout specifier (block size) value is limited to 2^48-1.

An operating system process is created for each UPC thread. Therefore, the maximum number of supported threads is further constrained by system capacity limitations, such as available swap space and process load. Typically, a UPC program will fail with the diagnostic "UPC initialization failed. Reason: Resource temporarily unavailable, if there are insufficient system resources to create the requested number of threads.

On Linux platforms, the user's main program is renamed to upc_main to work around a restriction in the linker. The actual main program entry is in the UPC runtime library.

login to post comments