[go: up one dir, main page]

Menu

[cc3aef]: / Vagrantfile  Maximize  Restore  History

Download this file

93 lines (77 with data), 3.9 kB

 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
config.vm.box = "debian/bullseye64"
config.vm.box_check_update = false
# Forwards port 8888 in the guest VM (used by default by the Jupyter notebook)
# to port 18888 on the localhost interface in the host.
config.vm.network "forwarded_port", guest: 8888, host: 18888, host_ip: "127.0.0.1"
# -------------------------------------------
# Begin Settings that you may want to change
# -------------------------------------------
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "c:/users/lu/wavepacket_shared", "/home/vagrant/shared", create: true
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# Customize the name of the virtual machine
vb.name = "wavepacket"
# Customize the amount of memory on the VM (Megabytes)
# Most people can easily assign ca. half of their memory here
vb.memory = "2048"
# Customize the number of CPUs available for the VM:
vb.cpus = 2
end
# ----------------------------------------
# End settings that you may want to change
# ----------------------------------------
# Sample customization for HyperV
# See the VirtualBox example for comments
config.vm.provider "hyperv" do |h|
h.vmname = "wavepacket"
h.maxmemory = 2048
h.cpus = 2
end
# Enable provisioning with a shell script. Additional provisioners such as
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
# install packages: utilities, build-tools, libraries, Python, processing-helpers
sudo apt-get -y update
sudo apt-get -y install wget git
sudo apt-get -y install g++ cmake ninja-build pkg-config
sudo apt-get -y install libfftw3-dev libopenblas-dev libboost-dev liblapack-dev
sudo apt-get -y install python3 python3-pip python3-dev
sudo apt-get -y install gnuplot imagemagick ffmpeg
# Install required or useful Python packages
pip3 install matplotlib pybind11 numpy pytest notebook
# Download a specific snapshot of the tensor lib and build it
git clone https://github.com/juanjosegarciaripoll/tensor.git src/libtensor
git -C src/libtensor checkout 563ce976e22ddbca16b89edc2d693973f8cf8dc3
mkdir -p build/tensor
cmake -D BUILD_SHARED_LIBS=ON -D TENSOR_FFTW=ON -D TENSOR_TEST=OFF -S src/libtensor/ -B build/tensor -G Ninja
ninja -C build/tensor -j 2
sudo ninja -C build/tensor install
# Build Wavepacket. The directory containing this Vagrantfile is mounted under /vagrant
mkdir -p build/wavepacket
cmake -G Ninja -D WP_BUILD_DOCUMENTATION=OFF -D WP_BUILD_UNITTESTS=OFF -S /vagrant -B build/wavepacket
ninja -C build/wavepacket -j 2
sudo ninja -C build/wavepacket install
# export the path to the Wavepacket Python module
# and a shortcut for the notebook call
echo -e '\nexport PYTHONPATH=/usr/local/lib/wavepacket_python\n' >> .profile
echo 'alias notebook="cd ~ && python3 -m notebook --NotebookApp.token= --ip=0.0.0.0"' >> .profile
SHELL
end