-
Notifications
You must be signed in to change notification settings - Fork 23
/
SOURCEME
101 lines (86 loc) · 2.84 KB
/
SOURCEME
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
# directory where installation takes place
export WRF_BASE=~/wrf
# | intel | for intel compilers |
# | gcc | gcc & gfortan compilers |
# | xl | for ibm aix machines |
# | pgi | pgi compilers |
compiler=gcc
# System Specific
# | sgi | sgi altix |
# | ubuntu | 64 bit ubuntu |
# | sr16000 | hitachi AIX machine |
# | linux | some linux |
export machine=ubuntu
# following setting is useful when you want to build WRF with different
# compilers but not its the dependencies. I generally set it to "deps". If you
# dont understand what it is right now, leave it 'as it is'™.
export dep_root=$compiler # where to install common dependencies.
# Some customization.
export teeing=false
#------- NO NEED TO EDIT BELOW ----------
# figure out absolute path of our repository; and bind it SCRIPTS_DIR
#it can fix error in zsh environment.
if [ -z "$ZSH_NAME" ] && [ "x$0" = "x./SOURCEME" ]; then
red_echo "Error: This script needs to be sourced. Please run as 'source SOURCEME'"
return 2
else
if [ -n "$BASH_SOURCE" ]; then
export SCRIPTS_DIR="`dirname $BASH_SOURCE`"
else
export SCRIPTS_DIR="`pwd`"
fi
export SCRIPTS_DIR=$(cd `dirname $BASH_SOURCE`; pwd)
# export SCRIPTS_DIR=`readlink -f "$SCRIPTS_DIR"`
fi
source $SCRIPTS_DIR/lib/fun.bash
# some internal varialbles
export appsdir=$SCRIPTS_DIR/apps
export BASE=$WRF_BASE
# let user know what kind of set up (s)he asked for
echo '================================================================='
echo compiler=$compiler
echo machine=$machine
echo WRF_BASE=$WRF_BASE
echo SCRIPTS_DIR=$SCRIPTS_DIR
echo "dep_root=$dep_root # where dependencies will be installed"
echo '================================================================='
echo
# Unset first
unset COMP CC CFLAGS CXX CXXFLAGS CPP CXXFLAGS FC F77 F9X FFLAGS
# load envis for the COMPILER
if [ -f $SCRIPTS_DIR/${compiler}/compiler.env ]; then
. $SCRIPTS_DIR/${compiler}/compiler.env
if [ $? != 0 ]; then
echo "something wrong with: $SCRIPTS_DIR/${compiler}/compiler.env"
return $?
fi
else
echo ERROR: no file named $SCRIPTS_DIR/${compiler}/compiler.env
return 128
fi
red_echo " ** IMPORTANT **
Compiler flags are set. If you like to change any of following values,
please see these files.
\"$SCRIPTS_DIR/${compiler}/compiler.env\"
\"$SCRIPTS_DIR/${machine}/${COMP}.env\" (Change if available/create if necessary)
and source this file again.
"
echo '-----------------------------------------------------------------'
echo COMP=$COMP
echo CC=$CC
echo CFLAGS=$CFLAGS
echo
echo CXX=$CXX
echo CXXFLAGS=$CXXFLAGS
echo
echo CPP=$CPP
echo CXXCPP=$CXXCPP
echo
echo FC=$FC
echo F77=$F77
echo F9X=$F9X
echo FFLAGS=$FFLAGS
echo '-----------------------------------------------------------------'
# Local Variables:
# mode: sh
# End: