forked from hafs-community/HAFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_hycom_utils.sh
executable file
·51 lines (45 loc) · 1.19 KB
/
build_hycom_utils.sh
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
#!/bin/sh
set -eux
source ./machine-setup.sh > /dev/null 2>&1
cwd=`pwd`
if [ $target = wcoss_cray ]; then
export DM_FC="ftn -static"
export DM_F90="ftn -free -static"
export DM_CC="cc -static"
fi
module use ../modulefiles
module load modulefile.hafs.$target
module list
cd hafs_hycom_utils.fd/libs
if [ -d "build" ]; then
rm -rf build
fi
mkdir build
cd build
if [ $target = wcoss_cray ]; then
CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER:-ftn}
CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-cc}
else
CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER:-ifort}
CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-icc}
fi
cmake .. -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
make -j 8 VERBOSE=1
cd ${cwd}/hafs_hycom_utils.fd
if [ -d "build" ]; then
rm -rf build
fi
mkdir build
cd build
if [ $target = wcoss_cray ]; then
CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER:-ftn}
CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-cc}
else
CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER:-ifort}
CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-icc}
fi
cmake .. -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
make -j 8 VERBOSE=1
make install
cd ../
exit