-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
2,525 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,9 @@ x86/ | |
/build | ||
/docs/_build | ||
|
||
# Vagrant | ||
.vagrant/ | ||
|
||
# Balázs (Visual Studio etc) | ||
.vscode/ | ||
.cproject | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Installing Vagrant | ||
|
||
To download Vagrant for supported platforms, see [here](https://www.vagrantup.com/downloads.html) | ||
|
||
# Installing VirtualBox | ||
|
||
If choosing VirtualBox as your virtualization provider, see [here](https://www.virtualbox.org/wiki/Downloads). | ||
|
||
You may have to enable hardware virtualization extensions in your BIOS before using it. | ||
|
||
If running on Ubuntu, you may have to install a newer version of VirtualBox than what is available in the public repositories in order for it to work correctly with Vagrant. | ||
|
||
# Setting up val3dity with Vagrant & VirtualBox | ||
Once Vagrant has been installed, you can start an environment by checking out the val3dity code, then changing to the directory which contains the Vagrantfile by typing: | ||
|
||
# Windows users will need to uncomment the line ending configuration option. | ||
git clone [email protected]:tudelft3d/val3dity.git val3dity #--config core.autocrlf=input | ||
cd val3dity | ||
vagrant up | ||
|
||
# Other Virtualization Providers | ||
|
||
If you would like to use Parallels instead of VirtualBox, please run the following command: | ||
``` | ||
vagrant up --provider=parallels | ||
``` | ||
Please note that this requires the Parallels Vagrant plugin, which can be installed: | ||
``` | ||
vagrant plugin install vagrant-parallels | ||
``` | ||
|
||
Similarly, if you would like to use VMware Workstation instead of VirtualBox, please run the following command: | ||
``` | ||
vagrant up --provider vmware_workstation | ||
``` | ||
Please note that this requires the VMware Vagrant plugin, which can be installed: | ||
``` | ||
vagrant plugin install vagrant-vmware-workstation | ||
``` | ||
|
||
# Vagrant Provisioning | ||
|
||
The initialization of the vagrant vm (`vagrant up`) will take about an hour at first. | ||
|
||
You should be able to log into the running VM by typing: | ||
|
||
vagrant ssh | ||
|
||
Within this login shell, you can build the code, run the server or the tests. For example, to run the tests: | ||
|
||
``` | ||
vagrant ssh | ||
cd ~/val3dity_build | ||
cmake ../val3dity | ||
make | ||
make install | ||
``` | ||
|
||
The val3dity root folder (on host) is mapped to the `/home/vagrant/val3dity` folder on the guest. Note that # Vagrant shared folders (e.g. `/home/vagrant/val3dity`) incur a heavy performance penalty within the virtual machine when there is heavy I/O, so they should only be used for source files. Any compilation step, database files, and so on should be done outside the shared folder filesystem inside the guest filesystem itself. | ||
|
||
**Acknowledgement** | ||
|
||
The majority of this description was taken from the [Hootenanny project](https://github.com/ngageoint/hootenanny/blob/master/VAGRANT.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Set environment variables | ||
BUILDS="/opt" | ||
HOME="/home/vagrant" | ||
echo HOME: $HOME | ||
|
||
apt-get update >/dev/null 2>&1 | ||
|
||
# CMake, C/++ compiler --------------------------------------------------------- | ||
echo "Installing C/++ compiler and CMake..." | ||
apt-get install -y cmake gcc g++ >/dev/null 2>&1 | ||
|
||
# pip -------------------------------------------------------------------------- | ||
echo "Installing pip..." | ||
apt-get install -y python3-pip >/dev/null 2>&1 | ||
|
||
# CGAL requirements ------------------------------------------------------------ | ||
echo "Installing Eigen3, Boost, GMP, MPFR..." | ||
# get Boost | ||
apt-get install -y libboost-all-dev >/dev/null 2>&1 | ||
# get Eigen3 | ||
apt-get install -y libeigen3-dev >/dev/null 2>&1 | ||
# get GMP and MPFR | ||
apt-get install -y libgmp10 libgmp-dev libmpfr-dev libmpfr4 >/dev/null 2>&1 | ||
|
||
apt-get update >/dev/null 2>&1 | ||
apt-get upgrade -y >/dev/null 2>&1 | ||
|
||
# GEOS ------------------------------------------------------------------------- | ||
echo "Downloading and building GEOS 3.6.2 ..." | ||
cd $BUILDS | ||
wget https://git.osgeo.org/gitea/geos/geos/archive/3.6.2.tar.gz >/dev/null 2>&1 | ||
tar xf 3.6.2.tar.gz | ||
rm 3.6.2.tar.gz | ||
mkdir $BUILDS/geos/build && cd $BUILDS/geos/build | ||
cmake .. | ||
make | ||
geos_test=$(make check | grep -o '100% tests passed') | ||
if [ "$geos_test" = "100% tests passed" ]; then | ||
make install | ||
ldconfig | ||
make clean | ||
else | ||
echo "GEOS test failed, exiting provisioning" | ||
exit 1 | ||
fi | ||
|
||
|
||
# CGAL ------------------------------------------------------------------------- | ||
# For some reason CGAL cannot link Eigen3 to boost_thread when the release tarball | ||
# is used for compilation. However, everything works when CGAL is compiled from | ||
# the source tarball (copy of GitHub master branch). Only the md5sum is not | ||
# correct in the provided md5sum.txt | ||
echo "Downloading and building CGAL 4.10.2 ..." | ||
cd $BUILDS | ||
wget https://github.com/CGAL/cgal/archive/releases/CGAL-4.10.2.tar.gz >/dev/null 2>&1 | ||
#wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.10.2/md5sum.txt >/dev/null 2>&1 | ||
|
||
#CGAL_TAR=$(md5sum CGAL-4.10.2.tar.xz) | ||
#CGAL_MD5=$(cat md5sum.txt | grep CGAL-4.10.2.tar.xz) | ||
#if [ "$CGAL_TAR" = "$CGAL_MD5" ]; then | ||
# tar -xf CGAL-4.10.2.tar.xz | ||
# rm CGAL-4.10.2.tar.xz | ||
# rm md5sum.txt | ||
#else | ||
# echo "md5sum of CGAL not matching, exiting provisioning" | ||
# exit 1 | ||
#fi | ||
|
||
tar -xf CGAL-4.10.2.tar.gz | ||
rm CGAL-4.10.2.tar.gz | ||
|
||
mkdir $BUILDS/cgal-releases-CGAL-4.10.2/build && cd $BUILDS/cgal-releases-CGAL-4.10.2/build | ||
cmake .. -DWITH_Eigen3=ON | ||
make | ||
make install | ||
make clean | ||
ldconfig | ||
|
||
|
||
# pytest ----------------------------------------------------------------------- | ||
echo "Installing pytest..." | ||
pip3 install pytest | ||
|
||
# val3dity --------------------------------------------------------------------- | ||
echo "Building val3dity..." | ||
# Vagrant shared folders incur a heavy performance penalty within the | ||
# virtual machine when there is heavy I/O, so they should only be used for | ||
# source files. Any compilation step, database files, and so on should be done | ||
# outside the shared folder filesystem inside the guest filesystem itself. | ||
mkdir $HOME/val3dity_build && cd $HOME/val3dity_build | ||
cmake $HOME/val3dity | ||
make | ||
make install | ||
cd $HOME | ||
|
||
val3dity --version | ||
|
||
chown vagrant:vagrant $HOME/val3dity_build | ||
|
||
echo "See VAGRANT.md for additional configuration instructions and then run 'vagrant ssh' to log into the val3dity virtual machine." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# -*- 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. | ||
|
||
# Every Vagrant development environment requires a box. You can search for | ||
# boxes at https://vagrantcloud.com/search. | ||
# config.vm.box = "debian/stretch64" | ||
config.vm.box = "ubuntu/xenial64" | ||
|
||
# Disable automatic box update checking. If you disable this, then | ||
# boxes will only be checked for updates when the user runs | ||
# `vagrant box outdated`. This is not recommended. | ||
# config.vm.box_check_update = false | ||
|
||
# VirtualBox Guest Additions plugin | ||
config.vbguest.auto_update = true | ||
|
||
# Create a forwarded port mapping which allows access to a specific port | ||
# within the machine from a port on the host machine. In the example below, | ||
# accessing "localhost:8080" will access port 80 on the guest machine. | ||
# NOTE: This will enable public access to the opened port | ||
# config.vm.network "forwarded_port", guest: 80, host: 8080 | ||
|
||
# Create a forwarded port mapping which allows access to a specific port | ||
# within the machine from a port on the host machine and only allow access | ||
# via 127.0.0.1 to disable public access | ||
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" | ||
|
||
# Create a private network, which allows host-only access to the machine | ||
# using a specific IP. | ||
# config.vm.network "private_network", ip: "192.168.33.10" | ||
|
||
# Create a public network, which generally matched to bridged network. | ||
# Bridged networks make the machine appear as another physical device on | ||
# your network. | ||
# config.vm.network "public_network" | ||
|
||
# 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 ".", "/vagrant", disabled: true | ||
config.vm.synced_folder ".", "/home/vagrant/val3dity" | ||
|
||
# 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| | ||
# Display the VirtualBox GUI when booting the machine | ||
# vb.gui = true | ||
|
||
# Customize the amount of memory and CPUs on the VM: | ||
vb.memory = 2048 | ||
vb.cpus = 2 | ||
end | ||
|
||
# View the documentation for the provider you are using for more | ||
# information on available options. | ||
|
||
# Enable provisioning with a shell script. Additional provisioners such as | ||
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the | ||
# documentation for more information about their specific syntax and use. | ||
# config.vm.provision "shell", path: "VagrantProvisionDebian9.sh" | ||
config.vm.provision "shell", path: "VagrantProvisionUbuntu1604.sh" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.