<commit_before>#!/usr/bin/env sh

if [ "$#" -ne 2 ]; then
    echo "Usage: $0 envision_path inviwo_install_path"
    echo "Example: $0 /home/andkem/ENVISIoN /home/andkem/inviwo"
    exit 0
fi

grep 18.04 /etc/os-release 2>&1 > /dev/null
if [ $? -ne 0 ]; then
    echo "This installation script currently only supports Ubuntu 18.04."
    echo "Exiting!"
    exit 1
fi

sudo apt install git \
                 build-essential \
                 libpng-dev \
                 libhdf5-dev \
                 qtbase5-dev \
                 qttools5-dev \
                 gcc-6 \
                 g++-6 \
                 cmake \
                 python3-dev \
                 python3-numpy \
                 python3-h5py \
                 python3-regex \
                 libglu1-mesa-dev \
                 libxrandr-dev \
                 libxinerama-dev \
                 libxcursor-dev

git clone https://github.com/inviwo/inviwo.git "$2"
cd "$2"

# Check out the correct version of Inviwo.
git checkout v0.9.9

# Init and update submodules.
git submodule init
git submodule update

# Apply Ubuntu 18.04 compatability patch.
git apply < "$1/inviwo/patches/2018/2018-compatability.patch"

mkdir build
cd build

# Use GCC 6, because Inviwo won't build with GCC 7.
export CC=gcc-6
export CXX=g++-6
cmake .. -DIVW_EXTERNAL_MODULES="$1/inviwo/modules" \
         -DIVW_MODULE_CRYSTALVISUALIZATIO=ON \
         -DIVW_MODULE_FERMI=OFF \
         -DIVW_MODULE_GRAPH2D=ON \
         -DIVW_MODULE_PYTHON3=ON \
         -DIVW_MODULE_PYTHON3QT=ON \
         -DIVW_MODULE_QTWIDGETS=ON \
         -DIVW_MODULE_HDF5=ON

echo ""
echo ""
echo ""
echo ""
echo "To build Inviwo with ENVISIoN:"
echo "Execute make in $2/build, i.e:"
echo ""
echo "cd \"$2/build\""
echo "make"<commit_msg>Installation script: Handle broken submodules.<commit_after>#!/usr/bin/env sh

if [ "$#" -ne 2 ]; then
    echo "Usage: $0 envision_path inviwo_install_path"
    echo "Example: $0 /home/andkem/ENVISIoN /home/andkem/inviwo"
    exit 0
fi

grep 18.04 /etc/os-release 2>&1 > /dev/null
if [ $? -ne 0 ]; then
    echo "This installation script currently only supports Ubuntu 18.04."
    echo "Exiting!"
    exit 1
fi

sudo apt install git \
                 build-essential \
                 libpng-dev \
                 libhdf5-dev \
                 qtbase5-dev \
                 qttools5-dev \
                 gcc-6 \
                 g++-6 \
                 cmake \
                 python3-dev \
                 python3-numpy \
                 python3-h5py \
                 python3-regex \
                 libglu1-mesa-dev \
                 libxrandr-dev \
                 libxinerama-dev \
                 libxcursor-dev

git clone https://github.com/inviwo/inviwo.git "$2"
cd "$2"

# Check out the correct version of Inviwo.
git checkout v0.9.9

# Update broken eigen module
sed -i 's/https:\/\/github\.com\/RLovelett\/eigen/https:\/\/github.com\/eigenteam\/eigen-git-mirror/g' .gitmodules
git submodule sync

# Init and update submodules.
git submodule init

# Disable HDF5 submodule
git submodule deinit modules/hdf5/ext/hdf5

# Fetch submodules
git submodule update

# Apply Ubuntu 18.04 compatability patch.
git apply < "$1/inviwo/patches/2018/2018-compatability.patch"

mkdir build
cd build

# Use GCC 6, because Inviwo won't build with GCC 7.
export CC=gcc-6
export CXX=g++-6
cmake .. -DIVW_EXTERNAL_MODULES="$1/inviwo/modules" \
         -DIVW_MODULE_CRYSTALVISUALIZATIO=ON \
         -DIVW_MODULE_FERMI=OFF \
         -DIVW_MODULE_GRAPH2D=ON \
         -DIVW_MODULE_PYTHON3=ON \
         -DIVW_MODULE_PYTHON3QT=ON \
         -DIVW_MODULE_QTWIDGETS=ON \
         -DIVW_MODULE_HDF5=ON

echo ""
echo ""
echo ""
echo ""
echo "To build Inviwo with ENVISIoN:"
echo "Execute make in $2/build, i.e:"
echo ""
echo "cd \"$2/build\""
echo "make"
{'fraction_non_alphanumeric': 0.10815047021943573, 'fraction_numerical': 0.030041797283176592, 'mean_word_length': 1.8133725202057311, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '809096', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1323, 'n_words': 313}