# cfx5mkext.ccl
#
# This file contains the commands used by the cfx5mkext command to
# build CFX loadable extensions on the different operating systems
# that CFX supports.
#
# Local changes to this file may be made by copying it into the
# directory in which you are working, and editing it there: cfx5mkext
# will then pick it up in preference to the central version.  For more
# permanent changes, make a copy in 
#   <CFX5ROOT>/config/<CFX5VERSION>/cfx5mkext.ccl
# for system-wide changes, or for per-user modifications,
#   <HOME>/.cfx/<CFX5VERSION>/cfx5mkext.ccl
# or
#   C:\WINNT\PROFILES\<USER>\Application Data\CFX-5\<CFX5VERSION>\cfx5mkext.ccl
# for Windows systems.
#
# $Id$
#
OS: linux amd64
  COMPILER: intel
    ATTRS: ifort
      cc = icc
      fc = ifort
      # ld = ld
      # ext link use ld = true
      ext build cflags = -fpic 
      ext build fflags = -fpic -assume 2underscore
      ext link ldflags = -shared
    END
    ATTRS: single
      ext build fflags = -real-size 32
    END
    ATTRS: double
      cppflags = -DDOUBLE_PRECISION
      ext build fflags = -real-size 64
    END
    ATTRS: int32
      ext build fflags = -integer-size 32
    END
    ATTRS: int64
      ext build fflags = -integer-size 64
    END
  END

  COMPILER: pgi
    ATTRS: pgfort
      cc = gcc
      fc = pgf95
      # ld = ld
      # ext link use ld = true
      ext build fflags = -fpic -Msecond_underscore -Mlarge_arrays -g77libs
      ext link ldflags = -shared -fpic -g77libs
    END  
    ATTRS: single
      ext build fflags = -r4
    END
    ATTRS: double
      cppflags = -DDOUBLE_PRECISION
      ext build fflags = -r8
    END
    ATTRS: int32
      ext build fflags = -i4
    END
    ATTRS: int64
      ext build fflags = -i8
    END
  END

  COMPILER: gnu
    ATTRS: gnufort
      cc = gcc
      fc = gfortran
      # ld = ld
      # ext link use ld = true
      ext build fflags = -fpic -fsecond-underscore
      ext link ldflags = -shared
    END  
    ATTRS: double
      cppflags = -DDOUBLE_PRECISION
      ext build fflags = -fdefault-real-8 -fdefault-double-8
    END
    ATTRS: int64
      ext build fflags = -fdefault-integer-8
    END
  END
END

OS: winnt amd64
   COMPILER: intel
     ATTRS: archfort
       cc = cl
       fc = ifort
       # ld = link
       # ext link use ld = true
       cxx = cl
       ext build cflags = -MD
       ext build fflags = -Qvec- -iface:cvf -MD
       ext link ldflags = -threads  -dll
       ext link lib5files = solver-mpi.lib
       cppincflag f = -include:
       cppflags f = -fpp
       fc outopt obj = -object:
       fc outopt exec = -exe:
       cc outopt obj = -Fo
       ext lib suffix = dll
       ext lib pattern = %s.dll
     END
     ATTRS: single
       ext build fflags = -real_size:32
     END
     ATTRS: double
       cppflags = -DDOUBLE_PRECISION
       ext build fflags = -real_size:64
     END
     ATTRS: int32
       ext build fflags = -integer_size:32
     END
     ATTRS: int64
       ext build fflags = -integer_size:64
     END
   END
END

OS: aix
  COMPILER: ibm
    ATTRS: archfort
      cc = xlc
      fc = xlf
      # ld = ld
      # ext link use ld = true
      ext build cflags = -q64
      #exec link ldflags = -E +s
      ext link ldflags = -Wl,-G -Wl,-bnoentry -Wl,-bexpall -Wl,-bM:SRE -q64
    END
    ATTRS: double
      cppflags c = -DDOUBLE_PRECISION
      cppflags f = -WF,-DDOUBLE_PRECISION
      ext build fflags = -qintsize=4 -qautodbl=dbl4
    END
  END
END
