1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
#! /bin/sh
# /*@@
# @file darwin
# @date Sat 27 March 2004
# @author John Shalf, Gabrielle Allen, Tom Goodale
# @desc
# Known architecture stuff for MacOS X (Darwin)
# @enddesc
# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/known-architectures/darwin,v 1.11 2004-03-30 00:07:46 goodale Exp $
# @@*/
if test "$CCTK_CONFIG_STAGE" = 'preferred-compilers' ; then
# Try to work out which FPP we need to use
if test -z "$FPP" -a -z "$FPPFLAGS"; then
FPP='/usr/bin/cpp'
FPP_VERSION="`$FPP --version | awk '{print $3; exit}'`"
FPP_VERSION_MAJOR="`echo $FPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\1:'`"
FPP_VERSION_MINOR="`echo $FPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\2:'`"
if test $FPP_VERSION_MAJOR -lt 3 ; then
FPP="$(PERL) $(CCTK_HOME)/lib/sbin/cpp.pl"
FPPFLAGS=
FPP_VERSION="`$FPP --version | awk '{print $3; exit}'`"
FPP_VERSION_MAJOR="`echo $FPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\1:'`"
FPP_VERSION_MINOR="`echo $FPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\2:'`"
else
FPPFLAGS='-traditional'
fi
echo Setting FPP to $FPP
echo Setting FPPFLAGS to $FPPFLAGS
fi
else
# Find out which CPP we are using and its version
if test "`$CPP --version | grep -i gcc`"; then
CPP_VENDOR=GNU
CPP_VERSION="`cpp --version | awk '{print $3; exit}'`"
CPP_VERSION_MAJOR="`echo $CPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\1:'`"
CPP_VERSION_MINOR="`echo $CPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\2:'`"
elif test "`$CPP --version | grep -i Cactus`"; then
CPP_VENDOR=Cactus
CPP_VERSION="`cpp --version | awk '{print $3; exit}'`"
CPP_VERSION_MAJOR="`echo $CPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\1:'`"
CPP_VERSION_MINOR="`echo $CPP_VERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\2:'`"
fi
# C_DEPEND='$(CC) -M $(CFLAGS) $(CPPFLAGS)'
if test -e '/usr/lib/gcc/darwin/3.3' ; then
C_DEPEND='gcc -M -no-cpp-precomp $(CPPFLAGS)'
CXX_DEPEND='g++ -E -M $(CPPFLAGS)'
else
C_DEPEND='$(PERL) $(CCTK_HOME)/lib/sbin/cpp.pl -M $(CPPFLAGS)'
CXX_DEPEND='$(PERL) $(CCTK_HOME)/lib/sbin/cpp.pl -M $(CPPFLAGS)'
fi
if test "`$CC -version 2>&1 | head -1 | grep -i gcc`" ; then
MAC_C_COMP=gcc
elif test "`$CC -version 2>&1 | grep xlc`" ; then
MAC_C_COMP=ibm
else
MAC_C_COMP=unknown
fi
if test "`$CXX -version 2>&1 | head -1 | grep -i gcc`" ; then
MAC_CXX_COMP=gcc
elif test "`$CXX -version 2>&1 | grep xlc`" ; then
MAC_CXX_COMP=ibm
else
MAC_CXX_COMP=unknown
fi
# Determine which Fortran 90 compiler is in use
MAC_F90_COMP=none
if test -n "$F90" && test "$F90" != 'none' ; then
if test "`$F90 -version 2>&1 | grep xlf`" ; then
MAC_F90_COMP=ibm
elif test "`$F90 -? 2>&1 | grep -i absoft`" ; then
MAC_F90_COMP=absoft
else
# Ok, those were the easy ones, now try more
# obscure things
echo " subroutine foo" > foo.f
echo " end subroutine foo" >> foo.f
if test "`/opt/absoft/bin/f95 -V foo.f 2>&1 | grep -i absoft`" ; then
MAC_F90_COMP=absoft
else
echo Unknown MacOS X f90 compiler.
echo Please add appropriate information to
echo $srcdir/known-architectures/darwin
echo and send the updated file to CactusMaint
echo We will try anyway ...
fi
rm foo.f
fi
elif test -n "$F77" ; then
if test "`$F77 -version 2>&1 | grep xlf`" ; then
MAC_F77_COMP=ibm77
elif test "`$F77 -? 2>&1 | grep -i absoft`" ; then
MAC_F77_COMP=absoft77
else
echo Unknown MacOS X f77 compiler.
echo Please add appropriate information to
echo $srcdir/known-architectures/darwin
echo and send the updated file to CactusMaint
echo We will try anyway ...
fi
fi
# Set the appropriate flags for C
case "$MAC_C_COMP" in
gcc)
: ${CFLAGS="-no-cpp-precomp"}
;;
*)
:
;;
esac
case "$MAC_CXX_COMP" in
gcc)
: ${CXXFLAGS="-no-cpp-precomp"}
;;
*)
:
;;
esac
#Set the appropriate flags for Fortran
case "$MAC_F90_COMP" in
absoft)
: ${LIBS='f90math fio f77math m'}
: ${F90FLAGS='-N11'}
: ${F77FLAGS='-N11'}
: ${F90_OPTIMISE_FLAGS='-s -O'}
: ${F77_OPTIMISE_FLAGS='-s -O'}
: ${F77_DEBUG_FLAGS='-g'}
: ${F90_DEBUG_FLAGS='-g'}
: ${F77_WARN_FLAGS='-m0'}
: ${F90_WARN_FLAGS='-m0'}
if test -z "$LIBDIRS" ; then
LIBDIRS="`which $F90 | sed 's,/bin/.*,/lib,'`"
fi
;;
absoft77)
: ${LIBS='fio f77math m'}
F90FLAGS='-f'
# Test if it is a version of the absoft compiler which has the library in a custom place.
if test -n "$ABSOFT" ; then
: ${LIBDIRS='$(ABSOFT)/lib'}
fi
: ${F77_DEBUG_FLAGS='-g'}
: ${F90_DEBUG_FLAGS='-g'}
: ${F77_WARN_FLAGS='-m0'}
: ${F90_WARN_FLAGS='-m0'}
;;
ibm)
# : ${LD='xlC'}
: ${LIBS='xlf90 xlfmath m'}
if test -z "$LIBDIRS" ; then
LIBDIRS="`which $F90 | sed 's,/bin/.*,/lib,'`"
fi
# : ${LIBDIRS='/opt/ibmcmp/lib'}
# : ${ARFLAGS='-rucs'}
: ${F90FLAGS=' -qspill=10000 -qmaxmem=-1 -qnullterm -qsuffix=f=f'}
: ${F77FLAGS='-qfixed -qmaxmem=-1 -qnullterm -qsuffix=f=f'}
: ${F90_OPTIMISE_FLAGS='-O5'}
: ${F77_OPTIMISE_FLAGS='-O5'}
: ${F90_SUFFIX='f'}
CCTK_WriteLine make.arch.defn 'F90FLAGS += $(DARWIN_$(subst .,,$(suffix $<))_FLAGS)'
CCTK_WriteLine make.arch.defn 'DARWIN_F90_FLAGS ='
CCTK_WriteLine make.arch.defn 'DARWIN_f90_FLAGS ='
CCTK_WriteLine make.arch.defn 'DARWIN_F_FLAGS = -qfixed'
CCTK_WriteLine make.arch.defn 'DARWIN_f_FLAGS = -qfixed'
;;
*)
: ${LIBS='m'}
;;
esac
# Darwin's ar command doesn't understand the '-s' flag
# so we have to use ranlib to add a table of contents to libraries
: ${ARFLAGS='ruc'}
: ${USE_RANLIB='yes'}
# MPI stuff
#
# Darwin has no native MPI, so we don't set any NATIVE_MPI_XXX variables.
# This is caught later on by lib/make/extras/MPI/NATIVE.
fi
|