The PNCE-Unix/Glue environment is heterogeneous in the sense that it supports a number of different hardware platforms and operating systems. This can create issues when you have your own code that you wish to compile and run, namely how to compile your code for the correct platform, and then how to ensure the correct binary executable for the platform you are on gets called.
By using the magical @sys string in AFS in the PCS recommended bin directory structure or similar, the second issue can be made quite transparent.
This document tries to discuss your options for code compilation.
Each supported OS on Glue/PNCE-Unix ships with a vendor supplied compiler for C. Glue staff also provides the GNU Compiler Collection, a large collection of compilers and libraries maintained by the members of the Free Software Foundation.
The vendor supplied C compiler is typically available as
/usr/bin/cc
. In some cases, notably the Linux OSes, this is
simply a version of the GNU gcc compiler. This may not be kept very up to date.
The GNU compiler collection can be found beneath /usr/local/bin
and contains compilers for:
gcc
)
g++
)
gfortran
)
g77
)
gcj
)
The GNU compiler collection can be used on many different platforms and OSes, which makes it quite popular for open source and heterogeneous projects. It unfortunately tends not to optimize as well as some other compilers.
Because of differences in the versions of the language specifications supported (and differences in levels of support for the various specifications), as well as some additional features, some code will compile most easily on GNU compilers, and some most easily on the OS vendors compilers.
If you have source code to compile that you did not write, you will have to see which works best for you. Generally, the GNU compilers work best with open source packages.
If you are writing your own code, it is generally recommended that you write it in such a way that it compiles easily on either. But where that is not possible, you may be better off choosing the GNU compiler collection as that tends to be more compliant with the language specifications.
Most of the information related to using the GNU compiler collection can
be found by read the man pages on the system for the specific compiler
(e.g. issue the command man g77
for information on the fortran
77 compiler). Many of the options are language independent. You can also get
some general information on the collection via the info pages (e.g. issue
the command info gcc
).
Some common issues:
-rpath /usr/local/lib
-Wl,-rpath,/usr/local/lib
(NOTE: there are no spaces in the above)
-R /usr/local/lib
-R/usr/local/lib
(NOTE: there are no spaces in the above)
For both systems, you can add that argument to the CFLAGS
or LDFLAGS
variable in a Makefile.