1 |
#!/bin/bash |
2 |
# |
3 |
# $Header: $ |
4 |
# $Name: $ |
5 |
|
6 |
# Build options for the Sun fortran compiler with a generic MPI |
7 |
# DON'T FORGET to set environment variable MPI_INC_DIR to the include |
8 |
# directory of your MPI implementation |
9 |
|
10 |
FC=${FC:=mpif77} |
11 |
F90C=${F90C:=mpif90} |
12 |
CC=${CC:=mpicc} |
13 |
LINK=${F90C} |
14 |
FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X ## _" |
15 |
DEFINES='-DWORDLENGTH=4' |
16 |
CPP='/usr/ccs/lib/cpp -P' |
17 |
NOOPTFLAGS='-O0 -g -m64 -u -r8const' |
18 |
NOOPTFILES='' |
19 |
EXTENDED_SRC_FLAG='-e' |
20 |
OMPFLAG='-xopenmp' |
21 |
|
22 |
if test "x$DEVEL" != x ; then |
23 |
FFLAGS='-u -r8const -g -xs -C -xcommonchk -xcheck=init_local -fpover' |
24 |
else |
25 |
FFLAGS='-u -r8const' |
26 |
fi |
27 |
|
28 |
if test "x$IEEE" = x ; then |
29 |
# No need for IEEE-754 |
30 |
FOPTIM='-fast -m64 -xvector=lib -xpad=local' |
31 |
LIBS="$LIBS -lmopt -lsunmath" |
32 |
else |
33 |
# Try to follow IEEE-754 |
34 |
# FOPTIM='-O0 -m64' |
35 |
FOPTIM='-fast -m64 -xpad=local -fsimple=1' |
36 |
fi |
37 |
F90FLAGS=$FFLAGS |
38 |
F90OPTIM=$FOPTIM |
39 |
CFLAGS='-O3 -m64' |
40 |
|
41 |
if [ "x$NETCDF_ROOT" != x ] ; then |
42 |
INCLUDEDIR="${NETCDF_ROOT}/include" |
43 |
INCLUDES="-I${NETCDF_ROOT}/include" |
44 |
LIBDIR="${NETCDF_ROOT}/lib" |
45 |
LIBS="-L${NETCDF_ROOT}/lib" |
46 |
elif [ "x$NETCDF_HOME" != x ]; then |
47 |
INCLUDEDIR="${NETCDF_HOME}/include" |
48 |
INCLUDES="-I${NETCDF_HOME}/include" |
49 |
LIBDIR="${NETCDF_HOME}/lib" |
50 |
LIBS="-L${NETCDF_HOME}/lib" |
51 |
elif [ "x$NETCDF_INC" != x -a "x$NETCDF_LIB" != x ]; then |
52 |
NETCDF_INC=`echo $NETCDF_INC | sed 's/-I//g'` |
53 |
NETCDF_LIB=`echo $NETCDF_LIB | sed 's/-L//g'` |
54 |
INCLUDEDIR="${NETCDF_INC}" |
55 |
INCLUDES="-I${NETCDF_INC}" |
56 |
LIBDIR="${NETCDF_LIB}" |
57 |
LIBS="-L${NETCDF_LIB}" |
58 |
elif [ "x$NETCDF_INCDIR" != x -a "x$NETCDF_LIBDIR" != x ]; then |
59 |
INCLUDEDIR="${NETCDF_INCDIR}" |
60 |
INCLUDES="-I${NETCDF_INCDIR}" |
61 |
LIBDIR="${NETCDF_LIBDIR}" |
62 |
LIBS="-L${NETCDF_LIBDIR}" |
63 |
elif test -d /usr/include/netcdf ; then |
64 |
INCLUDES='-I/usr/include/netcdf' |
65 |
elif test -d /usr/local/netcdf ; then |
66 |
INCLUDES='-I/usr/local/netcdf/include' |
67 |
LIBS='-L/usr/local/netcdf/lib' |
68 |
elif test -d /usr/local/include/netcdf.inc ; then |
69 |
INCLUDES='-I/usr/local/include' |
70 |
LIBS='-L/usr/local/lib64 -L/usr/local/lib' |
71 |
fi |
72 |
|
73 |
INCLUDES="$INCLUDES -I$MPI_INC_DIR" |
74 |
INCLUDEDIRS="$INCLUDEDIRS $MPI_INC_DIR" |
75 |
MPIINCLUDEDIR="$MPI_INC_DIR" |
76 |
MPI_HEADER_FILES=${MPI_HEADER_FILES:='mpif.h mpiof.h'} |
77 |
MPI_HEADER_FILES_INC=${MPI_HEADER_FILES_INC:='./mpi_headers/mpif.h ./mpi_headers/mpiof.h'} |