intrepid.com



SGI Irix 6.5 GCC UPC compiler

Posted on Thu, 2006-09-07 17:46
SGI LogoBefore attempting to build the GCC UPC compiler, we recommend that you first build and install the versions of the GNU tools listed below:

The tool version numbers shown are the versions of the tools that were used to initially develop the compiler and runtime. You should be able to safely use later versions of the GNU tools.

We recommend that you use a recent version of patch because versions earlier than 2.5.4 do not support the set time/date option, which is required to properly establish source file dependencies.

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-mips-sgi-irix6.5.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-mips-sgi-irix6.5.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 256 on 32-bit address configurations, and 1024 on 64-bit address (-mabi=64) configurations.

The maximum layout specifier (block size) value is limited to 16777215 on 32-bit address configurations, and 1099511627776 on 64-bit address configuations.

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.
login to post comments