@@ -10,9 +10,10 @@ set debug = 0
10
10
set repro = 0
11
11
set use_netcdf4 = 0
12
12
set environ = 1
13
+ set cosima_version = unset
13
14
14
15
15
- set argv = (` getopt -u -o h -l type: -l platform: -l help -l unit_testing -l debug -l repro -l use_netcdf4 -l no_environ -- $* ` )
16
+ set argv = (` getopt -u -o h -l type: -l platform: -l help -l unit_testing -l debug -l repro -l use_netcdf4 -l no_environ -l no_version - - $* ` )
16
17
if ($status ! = 0) then
17
18
# Die if there are incorrect options
18
19
set help = 1
@@ -34,6 +35,8 @@ while ("$argv[1]" != "--")
34
35
set use_netcdf4 = 1; breaksw
35
36
case --no_environ:
36
37
set environ = 0; breaksw
38
+ case --no_version:
39
+ set cosima_version = 0; breaksw
37
40
case --help:
38
41
set help = 1; breaksw
39
42
case -h:
@@ -63,7 +66,9 @@ if ( $help ) then
63
66
echo
64
67
echo " --use_netcdf4 use NetCDF4, the default is NetCDF4. Warning: many of the standard experiments don't work with NetCDF4."
65
68
echo
66
- echo " --no_environ do not source platform specific environment. Allows customising/overriding default environment"
69
+ echo " --no_environ do not source platform specific environment. Allows customising/overriding default environment"
70
+ echo
71
+ echo " --no_version disable COSIMA specific versioning for ACCESS-OM* builds"
67
72
echo
68
73
exit 1
69
74
endif
@@ -87,6 +92,15 @@ if($static) then
87
92
set cppDefs = " $cppDefs -DMOM_STATIC_ARRAYS -DNI_=360 -DNJ_=200 -DNK_=50 -DNI_LOCAL_=60 -DNJ_LOCAL_=50"
88
93
endif
89
94
95
+ if( $cosima_version == " unset" ) then
96
+ if( $type =~ ACCESS-OM* ) then
97
+ # default to cosima versioning for ACCESS-OM if not set explicitly as no_version argument
98
+ set cosima_version = 1
99
+ else
100
+ set cosima_version = 0
101
+ endif
102
+ endif
103
+
90
104
if ( $type == EBM ) then
91
105
set cppDefs = ( " -Duse_netCDF -Duse_netCDF3 -Duse_libMPI -DLAND_BND_TRACERS -DOVERLOAD_C8 -DOVERLOAD_C4 -DOVERLOAD_R4" )
92
106
else if( $type == ACCESS-OM ) then
@@ -133,13 +147,21 @@ endif
133
147
set mkmf_lib = " $mkmf -f -m Makefile -a $code_dir -t $mkmfTemplate "
134
148
set lib_include_dirs = " $root /include $code_dir /shared/include $code_dir /shared/mpp/include"
135
149
136
- # Build version
137
- source ./version_compile.csh
150
+ if ( $cosima_version ) then
151
+ echo " Including COSIMA version in build"
152
+ # Build version. This prevents builds outside a git repo, so only enabled for COSIMA builds
153
+ source ./version_compile.csh
154
+ set cppDefs = " $cppDefs -DCOSIMA_VERSION"
155
+ endif
138
156
139
157
# Build FMS.
140
158
source ./FMS_compile.csh
141
159
142
- set includes = " -I$code_dir /shared/include -I$executable :h:h/lib_FMS -I$executable :h:h/lib_ocean -I$executable :h:h/lib_version/"
160
+ set includes = " -I$code_dir /shared/include -I$executable :h:h/lib_FMS -I$executable :h:h/lib_ocean"
161
+
162
+ if ( $cosima_version ) then
163
+ set includes = " $includes -I$executable :h:h/lib_version/"
164
+ endif
143
165
144
166
# Build the core ocean.
145
167
cd $root /exp
@@ -232,8 +254,12 @@ else
232
254
exit 1
233
255
endif
234
256
235
- # Always include FMS and version
236
- set libs = " $libs $executable :h:h/lib_version/lib_version.a $executable :h:h/lib_FMS/lib_FMS.a"
257
+ # Always include FMS
258
+ set libs = " $libs $executable :h:h/lib_FMS/lib_FMS.a"
259
+
260
+ if ( $cosima_version ) then
261
+ set libs = " $libs $executable :h:h/lib_version/lib_version.a"
262
+ endif
237
263
238
264
$mkmf_exec -o " $includes " -c " $cppDefs " -l " $libs " $srcList
239
265
make
0 commit comments