-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathprovision.yml
92 lines (81 loc) · 2.64 KB
/
provision.yml
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
---
- hosts: all
vars:
build_root: /opt
uvcdat_install_dir: /opt/uvcdat_install
test_output_file: ~/out.nc
test_input_files: /opt/uvcdat_install/share/uvcmetrics/test_data/cam_output/*.nc
tasks:
- name: Update apt cache
apt: update_cache=yes
sudo: yes
- name: Install base packages
apt: name={{ item }} state=present
sudo: yes
with_items:
- git
- gfortran
- g++
- libffi-dev
- libsqlite3-dev
- libssl-dev
- libcurl3-openssl-dev
- libbz2-dev
- libexpat-dev
- ncurses-dev
- curl
- make
- wget
- libjpeg-dev
- libpng-dev
- m4
- cmake
- automake
- zlib1g-dev
- name: Install GUI packages
apt: name={{ item }} state=present
sudo: yes
with_items:
- libxt-dev
- qt-sdk
when: "{{ gui|bool }}"
- name: Clone UVCDAT source repo
git:
repo: git://github.com/UV-CDAT/uvcdat.git
dest: "{{build_root}}/uvcdat"
accept_hostkey: yes
version: master
force: yes
sudo: yes
- name: Point to "devel" branch of uvcmetrics subproject
lineinfile:
dest: "{{build_root}}/uvcdat/CMake/cdat_modules/uvcmetrics_pkg.cmake"
state: present
regexp: 'set\(UVCMETRICS_BRANCH'
line: 'set(UVCMETRICS_BRANCH devel)'
sudo: yes
when: "{{ uvcmetrics|bool }}"
- name: Create build directory if it does not exist
file: path={{build_root}}/uvcdat-build state=directory mode=0775
sudo: yes
- name: Set UV-CDAT build options
set_fact:
cdat_opts:
- "-DCDAT_BUILD_WEB=ON"
- "-DCDAT_BUILD_GUI={{ 'ON' if gui else 'OFF' }}"
- "-DCDAT_BUILD_OSMESA={{ 'OFF' if gui else 'ON' }}"
- "-DCDAT_BUILD_OFFSCREEN={{ 'OFF' if gui else 'ON' }}"
- "-DCDAT_DOWNLOAD_UVCMETRICS_TESTDATA={{ 'ON' if uvcmetrics else 'OFF' }}"
- name: Configure UVCDAT
command: cmake {{ cdat_opts|join(' ') }} -DCMAKE_INSTALL_PREFIX={{uvcdat_install_dir}} {{build_root}}/uvcdat chdir={{build_root}}/uvcdat-build
sudo: yes
- name: Build UVCDAT
command: make -j{{ cpus|int + 1 }} chdir={{build_root}}/uvcdat-build
sudo: yes
- name: Disable UV-CDAT anonymous log
lineinfile: dest=$HOME/.bashrc line="export UVCDAT_ANONYMOUS_LOG=no"
sudo: no
- name: Create script for running climatology2.py example
template: src=run_climatology_example.sh.j2 dest={{uvcdat_install_dir}}/run_climatology_example.sh mode=0775
sudo: yes
when: "{{ uvcmetrics|bool }}"