___________________________________________________________ | | | OpenUH Installation Instructions for i386 Platforms | |___________________________________________________________| This file contains instructions on how to install OpenUH and how to test the installation. OpenUH can be installed on i386 platforms using either pre-built binaries or building the compiler's source code. ================ Install Method 1: Installing OpenUH with pre-built binaries ================ I. On an i386 platform, OpenUH can be easily installed using pre-built binaries. The following are the steps to install OpenUH using pre-built binaries: 1. Download the OpenUH compiler binary for the i386 platform from: http://www.cs.uh.edu/~openuh/download After a simple registration, download a copy of openuh-alpha.i386.tar.gz, where alpha is the current version number of OpenUH. 2. Untar the downloaded file to your preferred directory Note: The rest of this section assumes the preferred directory is in the home directory (i.e. $HOME/). $tar xzvf openuh-alpha.i386.tar.gz A new directory named openuh should appear. 3. Set up environment variables 3.1 Add the following lines into the file where the environmental variables are set (e.g. .bash_profile or .bashrc): TOOLROOT=$HOME/openuh COMP_TARGET_ROOT=$TOOLROOT PATH=$PATH:$TOOLROOT/usr/ia64-orc-linux/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TOOLROOT/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.1 NLSPATH=$NLSPATH:$TOOLROOT/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.1/cf90.cat export TOOLROOT COMP_TARGET_ROOT PATH LD_LIBRARY_PATH NLSPATH 3.2 Update environment variables (here we assume you use .bash_profile). $source ~/.bash_profile or Log out and log back in (recommended) 4. Installation is now complete. Section III below covers basic usage of OpenUH. ================ Install Method 2: Installing OpenUH from source ================ II. OpenUH requires a Fortran 90 compiler to compile its FORTRAN 90 libraries. The OpenUH source package includes a gFortran GNU Binary to help compile OpenUH. It takes about two hours to finish the entire compilation phase depending on your machine. Download the source package openuh-alpha.src.tar.gz from http://www.cs.uh.edu/~openuh and untar it. $tar xzvf openuh-alpha.src.tar.gz A new directory named openuh should appear. For the next step, users can either use the provided shell script included in the source package or manually build the source code. Note: We highly recommend that the script install.i386.sh is used to simplify the installation process. ---------------------------------------------- Option 1: Installing OpenUH Using Provided Script ---------------------------------------------- Note: The first line of install.i386.sh should be changed to the preferred installation path. The default installation path is $(HOME)/opt. Note: For developers of OpenUH, to compile a debug version, modify the following line in install.i386.sh: gmake -f Make.cross and add BUILD_OPTIMIZE=DEBUG to the end. For example: gmake -f Make.cross BUILD_OPTIMIZE=DEBUG 1. Running the script $cd openuh $./install.i386.sh Note: This process usually takes about two hours. 2. Set up environment variables to use OpenUH 2.1 Add the following lines into the file where environmental variables are set (e.g. .bash_profile or .bash_rc): Note: In this section, we assume the preferred installation path is the default. For example, if using bash: TOOLROOT=$HOME/opt PATH=$PATH:$TOOLROOT/usr/ia64-orc-linux/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TOOLROOT/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.1 NLSPATH=$NLSPATH:$TOOLROOT/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.1/cf90.cat export TOOLROOT PATH LD_LIBRARY_PATH NLSPATH 2.2 Update environment variables (here we assume .bash_profile stores the variable settings) $source ~/.bash_profile or Log out and log back in (recommended) 3. Installation of OpenUH is now complete. Section III below covers basic usage of the compiler. ------------------------------------ Option 2: Installing OpenUH Manually ------------------------------------ 1. Install and test the pre-built gFortran compiler Note: If gFortran has previously been installed, skip this step and move onto step 2. $cd openuh/bin $tar xzvf gfortran-linux.tar.gz 1.1 Add the following lines into the file storing environment variables (e.g. .bash_profile or .bash_rc): Note: In this section, we assume the OpenUH source package was expanded in the home directory (i.e. $HOME). For example, if using bash: PATH=$PATH:$HOME/openuh/bin/irun/bin export PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:openuh/bin/irun/lib 1.2 Update environment variables (here we assume .bash_profile stores the variables): $source ~/.bash_profile or Log out and log back in (recommended) 1.3 Test the gFortran compiler using sequential code: $gfortran foo.f 2. Build the OpenUH compiler 2.1 Compilation $cd openuh/src $gmake -f Make.cross or To compile a debug version add BUILD_OPTIMIZE=DEBUG: (Applies to developers of OpenUH only) $gmake -f Make.cross BUILD_OPTMIZE=DEBUG 2.2 Optional: Uninstall the pre-built gFortran compiler $rm -rf openuh/bin/irun 3. Define the Installation Path 3.1. In the file storing environmental variables (e.g. .bash_profile) define the follolowing variable: TOOLROOT = is the preferred installation path for OpenUH For example, to install OpenUH in your local directory's opt directory: TOOLROOT = $HOME/opt 3.2 Update environment variables (here we assume .bash_profile stores the variables): $source ~/.bash_profile or Log out and log back in(recommended) 4. Install the OpenUH binaries and libraries. ./INSTALL.cross 5. Set the environment variables to use OpenUH For example, add the following lines to your .bash_profile or .bash_rc file: export PATH=$PATH:$TOOLROOT/usr/ia64-orc-linux/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TOOLROOT/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.1 export NLSPATH=$NLSPATH:$TOOLROOT/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.1/cf90.cat Update environment variables (here we assume you use .bash_profile): $source ~/.bash_profile 6. Cleaning up 7.1 Remove the installed binaries: $rm -rf $HOME/opt 7.2 Remove the built objects in the source tree: $gmake -f Make.native clobber $gmake -f Make.NUE.lib clobber III. Testing OpenUH Installation For i386 platforms, users must first use the source-to-source translator to compile programs. After compilation, files containing the translated source code are generated. The generated files must be re-compiled and linked using GCC to create an executable. 1. To compile sequential code using the source-to-source translator: C: $uhcc -clist foo.c Fortran: $uhf90 -flist foo.f This will create the files: foo.w2c.c and foo.w2c.h (or foo.w2f.f), which contain the optimized/translated source code. To compile this code: $gcc foo.w2c.c -I The directory should contain whirl2c.h. This file is available as part of OpenUH's distribution and is usually located in the following directory: $TOOLROOT/usr/ia64-orc-linux/bin/include e.g. $gcc foo.w2c.c -I $TOOLROOT/usr/ia64-orc-linux/bin/include 2. To compile an OpenMP C program: $uhcc -CLIST:emit_nested_pu foo_omp.c (no optimization) or $uhcc -CLIST:emit_nested_pu:before_cg -portable -O2 foo_omp.c (optimized and portable C code) OpenUH creates multi-threaded code in the generated files, foo_omp.w2c.c and foo_omp.w2c.h Re-compile with GCC: $gcc foo_omp.w2c.c -I -L -lomp -lpthread The directory is the path storing whirl2c.h and stores the OpenMP runtime library libomp.a. These files are normally located in the following locations: path1 = $TOOLROOT/usr/ia64-orc-linux/bin/include path2 = $TOOLROOT/usr/ia64-orc-linux/lib/libomp Note: The source-to-source translation feature for the current release of OpenUH is functional only for C programs. Also note that the current release of the source-to-source translator is an alpha test release. Limitations remain and are listed in the README file. Development of a more stable and complete source-to-source translator is currently underway and will be available in future releases of the OpenUH compiler. Note: If the Fortran program was compiled using the -dragon flag, the Dragon file will successfully generate and the Fortran program can still be analyzed using the Dragon performance analysis tool. For more information on Dragon, please visit www.cs.uh.edu/~dragon. Note: OpenUH has been tested and runs successfully on i386 platforms running the latest versions of Redhat Enterprise 3 and Mandrake. Users are encouraged to install on versions of Linux not listed here and report any problems encountered. In addition, GCC 3.3 or 3.4 must be installed in the system. You have completed installation and testing of OpenUH on your system. Please type uhcc or uhf90 for command line help or read the OpenUH user's guide for additional details on how to use OpenUH. Thank you for your interest in our compiler!