-
Notifications
You must be signed in to change notification settings - Fork 13
/
parallel_build.csh
executable file
·65 lines (56 loc) · 1.85 KB
/
parallel_build.csh
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
#!/bin/tcsh -f
#------------------------------------------------------------------------
# name: parallel_build.csh
# purpose: A small stub routine that calls @env/build.csh
#------------------------------------------------------------------------
set name = $0
set scriptname = $name
set BUILD_LOG_DIR = BUILD_LOG_DIR
# change to src directory, if not already there
#----------------------------------------------
if ($name != $name:t) then
set scriptname = $name:t
cd $name:h
endif
set srcdir = `pwd`
setenv ESMADIR $srcdir
# Save the original argv because I'm not a good
# tcsh script maker
set origargv = "$argv"
setenv DEVELOP FALSE
while ($#argv)
if ("$1" == "-develop") then
setenv DEVELOP TRUE
endif
shift
end
if (-d ${ESMADIR}/@env || -d ${ESMADIR}/env@ || -d ${ESMADIR}/env) then
if ( "$DEVELOP" == "TRUE" ) then
echo "Checking out development branches of GEOSgcm_GridComp, GEOSgcm_App, GMAO_Shared, and GEOS_Util"
mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared GEOS_Util
endif
else
if ($?PBS_JOBID || $?SLURM_JOBID) then
echo " mepo clone must be run!"
echo " This requires internet access but you are on a compute node"
echo " Please run from a head node"
exit 1
else
echo "Running mepo initialization"
mepo init
mepo clone
if ( "$DEVELOP" == "TRUE" ) then
echo "Checking out development branches of GEOSgcm_GridComp, GEOSgcm_App, GMAO_Shared, and GEOS_Util"
mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared GEOS_Util
endif
endif
endif
# Now reset argv
set argv = "$origargv"
if ( -d ${ESMADIR}/@env ) then
${ESMADIR}/@env/build.csh -esmadir $ESMADIR $argv
else if ( -d ${ESMADIR}/env@ ) then
${ESMADIR}/env@/build.csh -esmadir $ESMADIR $argv
else if ( -d ${ESMADIR}/env ) then
${ESMADIR}/env/build.csh -esmadir $ESMADIR $argv
endif