G COMPILER

From VrlWiki
Jump to navigation Jump to search
G_COMPILER = <Compiler Version>

This variable designates a compiler and version. It can be set to:

   gcc         Gnu C/C++ with no suffix.
   gcc2        Gnu C/C++ with a version 2 suffix (default is -2.95).
   gcc3        Gnu C/C++ with a version 3 suffix (default is -3.4).
   gcc4        Gnu C/C++ with a version 3 suffix (default is -4.1).
   gccx        Gnu C/C++ with a suffix specified by the GCCX_SUFFIX variable.

   cl          Microsoft C/C++ with no suffix.
   cl6         Microsoft C/C++ version 6.
   cl7         Microsoft C/C++ version 7.
   cl8         Microsoft C/C++ version 8 (visual studio 2005).
   cl9         Microsoft C/C++ version 9 (visual studio 2008).


The default suffixes for Gnu C/C++ can be overridden by setting:

GCC2_SUFFIX     Defaults to:  -2.95
GCC3_SUFFIX     Defaults to:  -3.4
GCC4_SUFFIX     Defaults to:  -4.1
GCCX_SUFFIX     Has no default.


It might be more convenient to set these variables outside the Makefile. Users can set them in their environment or they can create the common/build/site/site.make file to establish site specific variable settings. For this reason it useful to set them in the Makefile using "?=" so they can be overridden with defaults that are dependent on the platform. For example:

    ifeq ($(GARCH),linux)
        G_COMPILER ?= gcc4
    endif
    ifeq ($(GARCH),WIN32)
        G_COMPILER ?= cl9
    endif