<commit_before>#!/bin/bash

if [ "$#" -ne 1 ]; then
  echo "Usage: ./release_macos.sh path-to-bin-folder"
  exit 1
fi

destdir=`readlink -f "$1"`

mkdir -p build
cd build
rm CMakeCache.txt # make sure to use default settigs
cmake \
-D COMPILER=ICC \
-D CMAKE_SKIP_RPATH=ON \
..
make -j 8 preinstall
cmake -D CMAKE_INSTALL_PREFIX="$destdir" -P cmake_install.cmake
cd ..

# assumes documentation repo cloned into embree-doc
make -C embree-doc docbin
cp embree-doc/docbin/* "$destdir"<commit_msg>replaced readlink by realpath implementation on MacOSX<commit_after>#!/bin/bash

if [ "$#" -ne 1 ]; then
  echo "Usage: ./release_macos.sh path-to-bin-folder"
  exit 1
fi

realpath() {
  OURPWD=$PWD
  cd "$(dirname "$1")"
  LINK=$(readlink "$(basename "$1")")
  while [ "$LINK" ]; do
    cd "$(dirname "$LINK")"
    LINK=$(readlink "$(basename "$1")")
  done
  destdir="$PWD/$(basename "$1")"
  cd "$OURPWD"
}

realpath $1

mkdir -p build
cd build
rm CMakeCache.txt # make sure to use default settigs
cmake \
-D COMPILER=ICC \
-D CMAKE_SKIP_RPATH=ON \
..
make -j 8 preinstall
cmake -D CMAKE_INSTALL_PREFIX="$destdir" -P cmake_install.cmake
cd ..

# assumes documentation repo cloned into embree-doc
make -C embree-doc docbin
cp embree-doc/docbin/* "$destdir"
{'fraction_non_alphanumeric': 0.15027977617905675, 'fraction_numerical': 0.009592326139088728, 'mean_word_length': 3.7604562737642584, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5737105', 'n_tokens_mistral': 507, 'n_tokens_neox': 474, 'n_words': 138}