Skip navigation
NASA Logo, National Aeronautics and Space Administration
Modeling Guru Banner
Currently Being Moderated

Porting GEOS-5 to new platforms

VERSION 9  Click to view document history
Created on: Mar 31, 2008 10:10 AM by Carlos Cruz - Last Modified:  Nov 28, 2012 10:00 AM by Carlos Cruz

This section is still under development

-


Porting GEOS-5 to a new (unsupported 1 )platform requires, as a minimum, that the new system satisfy some requirements as well as the successful installation of Baselibs. The following examples describe edits and tweaks required to port GEOS-5 to three unsupported platform. We assume that Baselibs have been installed.

 

Example: porting to Darwin

The step in porting is to edit the ESMA_arch.mk file (under src/Config). For Darwin we add a section

 

ifeq ($(ARCH),Darwin)
...
...
endif

 

 

where $ARCH is determined by the GNUmake build mechanism. One can determine $ARCH by executing "uname -s". If using the Intel compiler ifort, the Darwin section looks like this:

 

 

 

 

 

ifeq ($(ARCH),Darwin)
# Darwin default compilers
# -----------------------
  ifndef ESMA_FC  
     FC = ifort
  endif
  CC  = mpicc
  CXX = mpicxx
  CPP = cpp
 
  LIB_HDF = -lmfhdf -ldf -ljpeg -lz -lsz
 
  EXTENDED_SOURCE := -extend_source
  FREE_SOURCE = -free
  FIXED_SOURCE = -fixed
 
  ESMF_ARCH=Darwin
  ESMF_COMPILER=intelgcc
  ESMF_PREC=32
  ESMF_COMM=mpich2
 
  MYBASE = <PATH OF BASELIBS INSTALLATION>
  # e.g. (note that $ARCH is part of path)
  MYBASE = /Users/rsyed/newbase/Baselibs/i686-apple-darwin9.1.0/ifort/Darwin
 
 
  INC_ESMF   = $(MYBASE)/include/esmf
  MOD_ESMF   = $(MYBASE)/include/esmf
  LIB_ESMF   = $(MYBASE)/lib/libesmf.a
  INC_NETCDF = $(MYBASE)/include/netcdf
  LIB_NETCDF = $(MYBASE)/lib/libnetcdf.a
  INC_SDF    = $(INC_NETCDF)
  LIB_SDF    = $(LIB_NETCDF)
 
  INC_MPI = <MPI INSTALLATION>/include
  LIB_MPI = <MPI INSTALLATION>/ -lmpi -lmpi++
  # or
  LIB_MPI = <MPI INSTALLATION>/ -lmpich -lmpichcxx 
 
  LIB_HDFEOS =
 
  # this can be omitted if libg2c.a is not installed
  LIB_SCI := #`g77 --print-file-name=libg2c.a` 
 
  FREAL4 =
  FREAL8 = -r8
  FOPT2 +=
  ifeq ("$(BOPT)","g")
     FOPT   = $(FOPTG) -CB -traceback -check uninit
  else
     FOPT   = $(FOPT3)
  endif
 
  MPFLAG  = -mp
  OMPFLAG  = -openmp
  BIG_ENDIAN = -convert big_endian
  BYTERECLEN = -assume byterecl
  FPE = -fpe0
  ALIGNCOM = -align dcommons
 
  LIB_SYS = -L/usr/lib/gcc/i686-apple-darwin9/4.0.1 -lstdc++
 
  CFLAGS += -Df2cFortran
  fFLAGS += $(EXTENDED_SOURCE) $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
  FFLAGS += $(EXTENDED_SOURCE) $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
  f90FLAGS += $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
  F90FLAGS += $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
 
endif

 

 

The settings above have been tested on SENSORWEB (sensorweb.sci.gsfc.nasa.gov). The user must edit the paths where appropriate and/or needed. If using a gfortran compiler

 

ifeq ($(ARCH),Darwin)
# Darwin default compilers
# -----------------------
  ifndef ESMA_FC  
     FC = ifort
  endif
  CC  = mpicc
  CXX = mpicxx
  CPP = cpp
 
  LIB_HDF = -lmfhdf -ldf -ljpeg -lz -lsz
 
  EXTENDED_SOURCE := -ffree-form
  FREE_SOURCE = -ffree-form
  FIXED_SOURCE = -ffixed-form
    
  ESMF_ARCH=Darwin
  ESMF_COMPILER=intelgcc
  ESMF_PREC=32
  ESMF_COMM=mpich2
 
  MYBASE = <PATH OF BASELIBS INSTALLATION>
  # e.g. (note that $ARCH is part of path and "compiler" name has changed)
  MYBASE = /Users/rsyed/newbase/Baselibs/i686-apple-darwin9.1.0/gfortran/Darwin
 
  INC_ESMF   = $(MYBASE)/include/esmf
  MOD_ESMF   = $(MYBASE)/include/esmf
  LIB_ESMF   = $(MYBASE)/lib/libesmf.a
  INC_NETCDF = $(MYBASE)/include/netcdf
  LIB_NETCDF = $(MYBASE)/lib/libnetcdf.a
  INC_SDF    = $(INC_NETCDF)
  LIB_SDF    = $(LIB_NETCDF)
 
  INC_MPI = <MPI INSTALLATION>/include
  LIB_MPI = <MPI INSTALLATION>/ -lmpi -lmpi++
  # or
  LIB_MPI = <MPI INSTALLATION>/ -lmpich -lmpichcxx 
 
  LIB_HDFEOS =
 
  # this can be omitted if libg2c.a is not installed
  LIB_SCI := #`g77 --print-file-name=libg2c.a` 
 
  FREAL4 = 
  FREAL8 = -fdefault-real-8
  FOPT2 +=
  ifeq ("$(BOPT)","g")
     FOPT   += -g3
  else
     FOPT   += -O3
  endif
 
  MPFLAG  = -mp
  OMPFLAG  = -fopenmp
  BIG_ENDIAN = -fconvert=big-endian
  BYTERECLEN = -frecord-marker=4
  FPE = -ffpe-trap=zero,overflow,underflow -fbacktrace
  ALIGNCOM =  -fsecond-underscore -fbounds-check
 
  LIB_SYS = -L/usr/lib/gcc/darwin/3.3 -lstdc++
 
  CFLAGS += -Df2cFortran
  fFLAGS += $(EXTENDED_SOURCE) $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
  FFLAGS += $(EXTENDED_SOURCE) $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
  f90FLAGS += $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
  F90FLAGS += $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
 
endif

 

 

The above settings were used on a MacBook Pro (Intel DualCore) with gcc (4.01), gfortran (4.4.0), g77 (3.4.0),  and mpich2 installed.

 

 

Example: porting to AIX

There is already a section in ESMA_arch.mk that deals with AIX. These setting can be tailored to any IBM by setting the correct path for the Baselibs (BASEDIR) and setting the correct compiler names and options.

 

ifeq ($(ARCH),AIX)
 
  SITE := $(patsubst bs%,ncar,$(SITE))
 
  ifeq ($(SITE),ncar)
    ifndef BASEDIR
          BASEDIR = /home/bluesky/cacruz/ESMA/baselibs
    endif
  endif
 
#  CC  = mpcc_r
  CC  = gcc
  CXX = mpcc_r
  CPP = /lib/cpp
  FC  = mpxlf95_r
  AR += -X64
 
  D = -WF,-D
  DC = -D
 
  EXTENDED_SOURCE = -qfixed=132
  FIXED_SOURCE = -qfixed=72
  FREE_SOURCE = -qfree
 
  FREAL4 = -qrealsize=4
  FREAL8 = -qrealsize=8
 
#  CFLAGS   += -q64 -DAIX
  fFLAGS   += -q64 $(EXTENDED_SOURCE) -qstrict -qarch=auto
  f90FLAGS += -q64 -qsuffix=f=f90 -qstrict -qarch=auto
  FFLAGS   += -q64 $(EXTENDED_SOURCE) -qsuffix=cpp=F -qinit=f90ptr -qarch=auto
  F90FLAGS += -q64 -qsuffix=cpp=F90 -qinit=f90ptr -qarch=auto
 
  INC_MPI = $(BASEDIR)/$(ARCH)/include/mpi
 
  LDFLAGS  += -q64 -qsmp=omp,noauto
  LIB_MPI   = -lmpi_r -lvtd_r -lmpci_r
  LIB_SCI   = -L/usr/local/lib64/r4i4 -llapack -lessl
  LIB_SYS   = -lxlf90_r -lC_r -brtl
 
endif

 

 

 

 

Example: Building the GEOS-5 on a non-NCCS system 2 .

System details: Linux x86_64 (dual quad-core cpu Xeon X5355 2.66 GHz) with 32 Gb RAM.

 

The following snippet goes under the

 ifeq ($(ARCH), Linux) 
 ...
 endif

 

section:

 

  ifeq ($(FC), ifort) 
 
    EXTENDED_SOURCE := -extend_source
    FREE_SOURCE = -free
    FIXED_SOURCE = -fixed
 
    ESMF_ARCH=Linux
    ESMF_COMPILER=intel
    ESMF_PREC=32
    ESMF_COMM=mpich
 
    LIB_ESMF = $(BASELIB)/libesmf.a
 
    INC_MPI = /usr/local/mpich/include
    LIB_MPI = -L/usr/local/mpich/lib -lmpich -lpmpich++ -lfmpich -lmpichfsup
 
    FREAL4 =
    FREAL8 = -r8
    FOPT2 += 
    ifeq ("$(BOPT)","g")
       FOPT   = $(FOPTG)
    else
       FOPT   = $(FOPT3)
    endif
 
    MPFLAG  = -mp
    OMPFLAG  = -openmp
    BIG_ENDIAN = -convert big_endian
    BYTERECLEN = -assume byterecl
    FPE = -fpe0
    ALIGNCOM = -align dcommons
 
    CC  = icc
    CXX = icpc
 
    LIB_SYS = -ldl -lc -lpthread -lrt -lcprts 
    ifeq ($(MACH), x86_64) 
       LIB_SYS += -lunwind # D.Posselt Try doing without the Math Kernel Libraries for now... -lmkl_lapack -lmkl
       OVERRIDE_LIMITS =
       OMPFLAG =
       LOOP_VECT = 
    endif
 
    ifeq ($(MACH), ia64)
      LIB_SYS += -lscs
      OVERRIDE_LIMITS = -override_limits 
    endif
 
    LIB_SYS += -lstdc++ 
    
    fFLAGS += $(EXTENDED_SOURCE) $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
    FFLAGS += $(EXTENDED_SOURCE) $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
    f90FLAGS += $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
    F90FLAGS += $(FPE) $(OVERRIDE_LIMITS) $(ALIGNCOM)
 
  endif

 

 

-


1 Here unsupported refers to platforms where GEOS5 is not known to run successfully.

2 The attached document, Build_GEOS5.doc, contains step by step information on this particular port.

 

-


Up to: Building and Installing the GEOS-5 AGCM

Return to: GEOS-5 AGCM User's Guide

Attachments:
Comments (0)
USAGov logo NASA Logo - nasa.gov