forked from ecmwf/magics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
70 lines (61 loc) · 1.81 KB
/
Vagrantfile
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
# HOWTO:
# To start the VM, "vagrant up"
# Then add the output of "vagrant ssh-config"
# to your ~/.ssh/config
$script = <<-SCRIPT
sudo dnf config-manager --set-enabled PowerTools
sudo yum update -y
sudo yum install -y git
sudo yum install -y ninja-build
sudo yum install -y netcdf-devel
sudo yum install -y cairo-devel
sudo yum install -y proj-devel
sudo yum install -y pango-devel
sudo yum install -y udunits2-devel
cmake=$(cmake --version|head -1|awk '{print $3;}')
echo "CMAKE version [$cmake]"
cmake --version
which cmake
if [[ "$cmake" != "3.15.2" ]]
then
wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz
tar -zxvf cmake-3.15.2.tar.gz
cd cmake-3.15.2
./bootstrap
make
sudo make install
fi
cd
rm -fr git build
mkdir -p git build
cd git
[[ -d ecbuild ]] || git clone [email protected]:ecmwf/ecbuild.git
git clone [email protected]:ecmwf/eccodes.git
git clone [email protected]:b8raoult/magics.git
cd ~/git/eccodes
git pull
cd ~/build
mkdir -p eccodes
cd eccodes
set -
~/git/ecbuild/bin/ecbuild -G Ninja -DENABLE_FORTRAN=0 -DENABLE_MEMFS=1 ~/git/eccodes
cmake --build .
sudo cmake --build . --target install
cd ~/build
mkdir -p magics
cd magics
~/git/ecbuild/bin/ecbuild -G Ninja -DENABLE_FORTRAN=0 -DENABLE_PYTHON=0 ~/git/magics
cmake --build .
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "generic/centos8"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: "~/.ssh/id_rsa"
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/id_rsa.pub"
config.vm.provision "file", source: "~/.ssh/known_hosts", destination: "~/.ssh/known_hosts"
config.vm.provision "shell", inline: $script, privileged: false
config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 4
end
end