If you choose to build the compiler suite from the source tar ball, follow the steps outlined below.
Prerequisites
In order to compile Open64 successfully, your system should meet the following requirements:
1. Linux OS on IA64/ix86/x86_64
Open64 as well as its variants have been successfully built on many UNIX variants and UNIX-like systems. This release has only been tested extensively on IA64/ix86/x86_64 running Linux operating systems. If you are going to build it on any platform other than Linux on IA64/ix86/x86_64, you may need to make some minor changes to the source code.
2. Miscellaneous Tools
To build the open64 compiler from source, these tools are needed:
awk, csh, bash, gmake, flex and bison
On some Ubuntu distributions, you need to set the environment variable 'SHELL' to '/bin/bash' or change the symbol link '/bin/sh' to '/bin/bash' to make the shell scripts work.
3. GNU Compiler Collection
Currently, GCC 3.3.x through 4.1.x are supported. GCC 4.1.x is preferred. gfortran is needed to build the FORTRAN Frong End.
Build Steps
Follow these steps to build the compiler:
1. Expand the source tarball
After that, the whole source hierarchy will be in directory rooted at open64-4.2.3-0/. Change working directory to open64-4.2.3-0/.
2. Build the compiler components by simply invoking command:
make or make V=1 (V=1 will show all building information)
If you want to build a debuggable compiler, use this command instead:
make BUILD_OPTIMIZE=DEBUG
Note that, if you type "make", it will only build the compiler's source code by default it won't build the necessary libraries. If you want to build them by yourself, type
make library
The default FORTRAN compiler in source code is openf90. If the openf90 is not in the PATH, the FORTRAN front end will not be built. During the installation, the pre-built version will be picked up. Then, we can use it to build the FORTRAN front end again. Developers may find this command handy in building individual component, say wopt.so:
make BUILD_OPTIMIZE=DEBUG wopt.so
3. Set environment variable TOOLROOT to anywhere you have write permission. If you do not want to use $TOOLROOT, just skip this step.
4. Call 'make install' to install all compiler components and archives.
If $TOOLROOT is set, the compiler will be installed to that folder. Otherwise, a path will be prompted. The C, C++, FORTRAN compilers are now available in folder $TOOLROOT/bin. They are opencc, openCC, and openf90 respectively.
Build the archives
The archives required by Open64 are provided in both binary and source packages. Normally, you need *NOT* to build it by yourself. These libraries can be built by Open64. Add $TOOLROOT/bin into your $PATH and type:
make BUILD_COMPILER=OSP library
Then, you can follow the step 3 and step 4 in 'Build Steps' to install these archives.
Some Notes on Build
1. The compiler is built with flag '-Werror' which treats warnings as error.
If the build process terminates due to warnings, you can get around this with:
make ... ERROR_ON_WARNINGS="" ...
i.e. simply repeat the make process with ERROR_ON_WARNINGS="".
2. On x86_64, the compiler is built into 64-bit by default. To build 32-bit compiler on x86_64, you can pass the parameter 'MACHINE_TYPE=i386' to build the compiler, archives and to install:
make MACHINE_TYPE=i386
make MACHINE_TYPE=i386 library
make MACHINE_TYPE=i386 install
3. People interested in building the compiler for other ports than IA-32/x86_64/IA-64 should contact the vendors listed below directly:
CUDA | NVIDIA Inc. |
LOONGSON | Institute of Computing Technology at the Chinese Academy of Sciences |
MIPS | Institute of Computing Technology at the Chinese Academy of Sciences |
PowerPC | Tsinghua University |
SL | SimpLight Nanoelectronics Inc. |