/[MITgcm]/MITgcm/tools/build_options/linux_amd64_sunf90
ViewVC logotype

Contents of /MITgcm/tools/build_options/linux_amd64_sunf90

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Mon Sep 12 15:13:07 2011 UTC (12 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64i, checkpoint64h, checkpoint64j, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63c, checkpoint64
Changes since 1.3: +49 -19 lines
merge linux_amd64_sunf90+mpi_generic, +mth and linux_amd64_sunf90+mth
 into this standard optfile

1 #!/bin/bash
2 #
3 # $Header: /u/gcmpack/MITgcm/tools/build_options/linux_amd64_sunf90+mpi_generic,v 1.2 2010/03/21 22:22:52 jmc Exp $
4 # $Name: $
5
6 # Build options for the Sun fortran compiler (with and without MPI)
7 # on Linux AMD64 platform
8 # MPI : need to set environment variable MPI_INC_DIR to the include
9 # directory of your MPI implementation
10
11 if test "x$MPI" = xtrue ; then
12 CC=${CC:=mpicc}
13 FC=${FC:=mpif77}
14 F90C=${F90C:=mpif90}
15 LINK=${F90C}
16 else
17 CC='cc'
18 FC='f77'
19 F90C='f90'
20 LINK=${F90C}
21 fi
22
23 FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _"
24 DEFINES='-DWORDLENGTH=4'
25 CPP='cpp -traditional -P'
26 EXTENDED_SRC_FLAG='-e'
27 OMPFLAG='-xopenmp'
28
29 NOOPTFLAGS='-O0 -g'
30 NOOPTFILES=''
31
32 FFLAGS="$FFLAGS -m64 -xfilebyteorder=big16:%all -u"
33 #FFLAGS="$FFLAGS -r8const"
34 # for big objects:
35 FFLAGS="$FFLAGS -Kpic"
36
37 if test "x$DEVEL" != x ; then
38 FFLAGS="$FFLAGS -g -xs -C -xcommonchk -xcheck=init_local -fpover"
39 OMPFLAG='-xopenmp=noopt'
40 fi
41
42 if test "x$IEEE" = x ; then #- with optimisation:
43 FOPTIM='-fast -xvector=simd -xpad=local'
44 LIBS="$LIBS -lmopt" #- but get overwritten during NETCDF libs setting below
45 else #- no optimisation + IEEE :
46 # FOPTIM='-O0'
47 FOPTIM='-fast -xpad=local -fsimple=1'
48 fi
49
50 F90FLAGS=$FFLAGS
51 F90OPTIM=$FOPTIM
52 CFLAGS='-O0 -m64 -Kpic'
53
54 INCLUDEDIRS=''
55 INCLUDES=''
56 #LIBS=''
57
58 if [ "x$NETCDF_ROOT" != x ] ; then
59 INCLUDEDIR="${NETCDF_ROOT}/include"
60 INCLUDES="-I${NETCDF_ROOT}/include"
61 LIBDIR="${NETCDF_ROOT}/lib"
62 LIBS="-L${NETCDF_ROOT}/lib"
63 elif [ "x$NETCDF_HOME" != x ]; then
64 INCLUDEDIR="${NETCDF_HOME}/include"
65 INCLUDES="-I${NETCDF_HOME}/include"
66 LIBDIR="${NETCDF_HOME}/lib"
67 LIBS="-L${NETCDF_HOME}/lib"
68 elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then
69 NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'`
70 NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'`
71 INCLUDEDIR="${NETCDF_INC}"
72 INCLUDES="-I${NETCDF_INC}"
73 LIBDIR="${NETCDF_LIB}"
74 LIBS="-L${NETCDF_LIB}"
75 elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then
76 INCLUDEDIR="${NETCDF_INCDIR}"
77 INCLUDES="-I${NETCDF_INCDIR}"
78 LIBDIR="${NETCDF_LIBDIR}"
79 LIBS="-L${NETCDF_LIBDIR}"
80 elif test -d /usr/include/netcdf-3 ; then
81 INCLUDES='-I/usr/include/netcdf-3'
82 LIBS='-L/usr/lib/netcdf-3 -L/usr/lib64/netcdf-3'
83 elif test -d /usr/include/netcdf ; then
84 INCLUDES='-I/usr/include/netcdf'
85 elif test -d /usr/local/netcdf ; then
86 INCLUDES='-I/usr/local/netcdf/include'
87 LIBS='-L/usr/local/netcdf/lib'
88 elif test -d /usr/local/include/netcdf.inc ; then
89 INCLUDES='-I/usr/local/include'
90 LIBS='-L/usr/local/lib64 -L/usr/local/lib'
91 fi
92
93 if [ -n "$MPI_INC_DIR" -a "x$MPI" = xtrue ] ; then
94 INCLUDES="$INCLUDES -I$MPI_INC_DIR"
95 INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR"
96 MPIINCLUDEDIR="$MPI_INC_DIR"
97 MPI_HEADER_FILES=${MPI_HEADER_FILES:='mpif.h mpiof.h'}
98 MPI_HEADER_FILES_INC=${MPI_HEADER_FILES_INC:='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'}
99 fi

  ViewVC Help
Powered by ViewVC 1.1.22