Installing Berkeley UPC on a Linux cluster

You have 3 options as mentioned in the Berkeley UPC download site.

  1. Download  Berkeley UPC runtime source distribution , build it. Then the  'upcc' compiler  will  use their HTTP-based public UPC-to-C translator during compilation. 
  2. OR download both the runtime and  UPC-to-C translator, build them, and then point the runtime at the translator. This allows to compile UPC code without the Internet hence faster compilation times.
  3. OR download both the runtime and the GCC UPC binary compiler, build them, and point the runtime at GCC UPC installation.
I go with the first option.

Please consider that you need C/C++ and MPI compilers in order to install Berkeley UPC.

1. Download the .tar from here and extract it.

2. Create a new directory to build the Berkeley UPC. I name my build directory as 'build'

mkdir build
 cd build

3. From the build directory, run the configure script in the extracted source directory. 

../berkeley_upc-2.xx.x/configure CC="" CXX="" MPI_CC=""
Replace the " " with the compilers you have installed in the machine. In my case it's gcc, g++ and mpicc. If you have more efficient compilers please use them. It would take sometime to configure.  
e.g. ../berkeley_upc-2.xx.x/configure CC=gcc CXX=g++ MPI_CC=mpicc

4. Using the Makefile in the build directory, build the Berkeley upc source.

5. The Berkeley UPC compiler operates by invoking a UPC-to-C translator and then using a backend C compiler to generate native objects. After building the source you can define the UPC-C translator location. You can either build a local translator(as I explain next) or use the default network translator hosted by Berkeley.

6. Building the local UPC-C translator
   6.1. Download the source from here and extract it.
   6.2. Go to the extracted directory and build the source using make.
 6.3 Now you have successfully built the translator.

7. After completion of successful build, it will show you the translator location path. Copy it to the clipboard. Path would be something like this.

8. Move back to the build directory of Berkeley UPC compiler and you can see 2 folders called 'dbg' and 'opt'. In each folder there is a configuration file called 'upcc.conf'. Open these files in a text editor and replace the translator="path to default location" with the copied path to the location of the local UPC-C translator in the clipboard.

9. Test the Berkeley UPC build using following:
env UPCC_FLAGS= ./upcc --norc --version

This would show the specifications and version details of the UPC compiler and translator.
10. You may use the examples in the berkeley_upc-2.xx.x/upc-examples directory to test the build before installation.
11. Finally install the UPC compiler and run time.
make install 

You have completed the installation successfully. To try the compiler use:
upcc --version and upcrun commands.

No comments:

Post a Comment