<commit_before>#!/bin/bash

################################################################################
# build-macx.sh
#
# Author: <NAME> <<EMAIL>>
#
# Run this script to create a static build of the DLVHEX project for Mac OS X.
#  The script clones a clean copy of the repositories and builds the
# binaries. Tested on Mac OS X 10.10 and above.
#
# The Mac OS X script uses the homebrew package manager to install additional
# dependencies.
#
################################################################################


################################################################################
# Configuration parameters

BOOST_VERSION="1.59.0"
PYTHON_VERSION="2.7"

CORE_CLONE_URL="https://github.com/hexhex/core.git"

# Don't change the following ones
ROOT_DIR=`pwd`
OUTPUT_IO=/dev/null
BUILD_DIR=$ROOT_DIR/build-macx
LIB_DIR=$BUILD_DIR/out
BOOST_FILE_VERSION=`echo $BOOST_VERSION | sed -e "s/\./_/g"`


################################################################################
# Helper functions

function usage {
  echo "usage: $0 [-v -h]"
  echo
  echo "Parameters:"
  echo "  -h     print this help"
  echo "  -v     Enable verbose output"
}

function prepare {
  echo "==> Creating build directory"
  mkdir -p $BUILD_DIR
}

# Check for missing depdencies
function checkDependencies {
  echo "==> Checking build dependencies"

  deps="git autoconf automake libtool pkg-config wget scons bison re2c python"
  missing_deps=""

  for dep in `echo $deps`; do
    if ! which $dep &> /dev/null; then
      missing_deps="$missing_deps $dep"
    fi
  done

  if [ ! -z "$missing_deps" ]; then
    echo "Error: Missing build dependencies, use:"
    echo "brew install$missing_deps"
    exit 1
  fi
}

# Boost is built standalone and not used from the package manager
function buildBoost {
  cd $BUILD_DIR

  echo "==> Downloading Boost $BOOST_VERSION"

  # Download and extract boost
  wget http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$BOOST_FILE_VERSION.tar.gz &> $OUTPUT_IO<commit_msg>Add hint about bison version<commit_after>#!/bin/bash

################################################################################
# build-macx.sh
#
# Author: <NAME> <<EMAIL>>
#
# Run this script to create a static build of the DLVHEX project for Mac OS X.
#  The script clones a clean copy of the repositories and builds the
# binaries. Tested on Mac OS X 10.10 and above.
#
# The Mac OS X script uses the homebrew package manager to install additional
# dependencies.
#
################################################################################


################################################################################
# Configuration parameters

BOOST_VERSION="1.59.0"
PYTHON_VERSION="2.7"

CORE_CLONE_URL="https://github.com/hexhex/core.git"

# Don't change the following ones
ROOT_DIR=`pwd`
OUTPUT_IO=/dev/null
BUILD_DIR=$ROOT_DIR/build-macx
LIB_DIR=$BUILD_DIR/out
BOOST_FILE_VERSION=`echo $BOOST_VERSION | sed -e "s/\./_/g"`


################################################################################
# Helper functions

function usage {
  echo "usage: $0 [-v -h]"
  echo
  echo "Parameters:"
  echo "  -h     print this help"
  echo "  -v     Enable verbose output"
}

function prepare {
  echo "==> Creating build directory"
  mkdir -p $BUILD_DIR
}

# Check for missing depdencies
function checkDependencies {
  echo "==> Checking build dependencies"

  # TODO: Bison is always found on Mac OS X, so we have to check for min version too!
  deps="git autoconf automake libtool pkg-config wget scons bison re2c python"
  missing_deps=""

  for dep in `echo $deps`; do
    if ! which $dep &> /dev/null; then
      missing_deps="$missing_deps $dep"
    fi
  done

  if [ ! -z "$missing_deps" ]; then
    echo "Error: Missing build dependencies, use:"
    echo "brew install$missing_deps"
    exit 1
  fi
}

# Boost is built standalone and not used from the package manager
function buildBoost {
  cd $BUILD_DIR

  echo "==> Downloading Boost $BOOST_VERSION"

  # Download and extract boost
  wget http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$BOOST_FILE_VERSION.tar.gz &> $OUTPUT_IO
{'fraction_non_alphanumeric': 0.2418003351687814, 'fraction_numerical': 0.0062245630835527895, 'mean_word_length': 4.570666666666667, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '881498', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1192, 'n_words': 389}