diff --git a/eosio_build.sh b/eosio_build.sh index e97823cbe1f8f78ff3a0a42cdf3dda239a4501fc..b1b98267c9a28d365f1a1390d645f85cc1074856 100755 --- a/eosio_build.sh +++ b/eosio_build.sh @@ -60,6 +60,7 @@ printf "\n\tBeginning build version: ${VERSION}\n" printf "\t$( date -u )\n" + printf "\tUser: $( whoami )\n" printf "\tgit head id: $( cat .git/refs/heads/master )\n" printf "\tCurrent branch: $( git branch | grep \* )\n" printf "\n\tARCHITECTURE: ${ARCH}\n" @@ -141,6 +142,7 @@ FILE=${WORK_DIR}/scripts/eosio_build_darwin.sh CXX_COMPILER=clang++ C_COMPILER=clang + export BOOST_ROOT=/usr/local MONGOD_CONF=/usr/local/etc/mongod.conf OPENSSL_ROOT_DIR=/usr/local/opt/openssl export WASM_ROOT=/usr/local/wasm diff --git a/scripts/eosio_build_darwin.sh b/scripts/eosio_build_darwin.sh index e14b8ea71c43c0e16871577e305c77722a1cb4c0..7a7d31c641ab58b3cc051bb1211fa893bbd7695c 100644 --- a/scripts/eosio_build_darwin.sh +++ b/scripts/eosio_build_darwin.sh @@ -97,19 +97,6 @@ do printf "\tChecking $name ... " if [ ${tester} ${testee} ]; then - # check boost version, it should be 1_66 - if [ "${brewname}" = "boost" ]; then - BVERSION=`cat "${testee}" 2>/dev/null | grep "#define BOOST_VERSION" | tail -1 \ - | tr -s ' ' | cut -d\ -f3` - if [ ${BVERSION} < 106600 ]; then - BOOST_CHECK=1 - DEP=$DEP"${brewname} " - DISPLAY="${DISPLAY}${COUNT}. ${name}\n\t" - printf "\t\t ${name} ${bldred}needs updating.${txtrst}.\n" - let COUNT++ - continue - fi - fi printf '\t\t %s found\n' "$name" continue fi @@ -183,6 +170,73 @@ printf "\n\tNo required Home Brew dependencies to install.\n" fi + printf "\n\tChecking boost library installation.\n" + BVERSION=`cat "${BOOST_ROOT}/include/boost/version.hpp" 2>/dev/null | grep BOOST_LIB_VERSION | tail -1 | tr -s ' ' | cut -d\ -f3 | sed 's/[^0-9_]//g'` + if [ "${BVERSION}" != "1_67" ]; then + if [ ! -z "${BVERSION}" ]; then + printf "\tFound Boost Version ${BVERSION}.\n" + printf "\tEOS.IO requires Boost version 1.66.\n" + printf "\tWould you like to uninstall version ${BVERSION} and install Boost version 1.66.\n" + select yn in "Yes" "No"; do + case $yn in + [Yy]* ) + printf "\tRemoving Boost Version ${BVERSION}.\n" + if [ -L "/usr/local/include/boost/version.hpp" ]; then + brew remove boost 2>/dev/null + if [ $? -ne 0 ]; then + printf "\tUnable to remove boost libraries at this time. 0\n" + printf "\tExiting now.\n\n" + exit 1; + fi + else + sudo rm -rf "${BOOST_ROOT}/include/boost" + if [ $? -ne 0 ]; then + printf "\tUnable to remove boost libraries at this time. 1\n" + printf "\tExiting now.\n\n" + exit; + fi + sudo rm -rf "${BOOST_ROOT}/lib/libboost*" + if [ $? -ne 0 ]; then + printf "\tUnable to remove boost libraries at this time. 2\n" + printf "\tExiting now.\n\n" + exit; + fi + fi + break;; + [Nn]* ) echo "User cancalled installation of Boost libraries, Exiting now."; exit;; + * ) echo "Please type 1 for yes or 2 for no.";; + esac + done + fi + printf "\tInstalling boost libraries.\n" + cd ${TEMP_DIR} + STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2) + if [ "${STATUS}" -ne 200 ]; then + printf "\tUnable to download Boost libraries at this time.\n" + printf "\tExiting now.\n\n" + exit; + fi + tar xf ${TEMP_DIR}/boost_1_66_0.tar.bz2 + rm -f ${TEMP_DIR}/boost_1_66_0.tar.bz2 + cd ${TEMP_DIR}/boost_1_66_0/ + ./bootstrap.sh "--prefix=$BOOST_ROOT" + if [ $? -ne 0 ]; then + printf "\n\tInstallation of boost libraries failed. 0\n" + printf "\n\tExiting now.\n" + exit 1 + fi + ./b2 install + if [ $? -ne 0 ]; then + printf "\n\tInstallation of boost libraries failed. 1\n" + printf "\n\tExiting now.\n" + exit 1 + fi + rm -rf ${TEMP_DIR}/boost_1_66_0/ + printf "\tBoost 1.66.0 successfully installed @ ${BOOST_ROOT}.\n" + else + printf "\tBoost 1.66.0 found at ${BOOST_ROOT}.\n" + fi + printf "\n\tChecking MongoDB C++ driver installation.\n" if [ ! -e /usr/local/lib/libmongocxx-static.a ]; then cd ${TEMP_DIR} diff --git a/scripts/eosio_build_dep b/scripts/eosio_build_dep index 38b866ffdb67ca6ff59572a91a34208c8b62660b..7123baf02f5e7200cbb4aa62e3b645f1a3090c6e 100644 --- a/scripts/eosio_build_dep +++ b/scripts/eosio_build_dep @@ -4,7 +4,6 @@ OpenSSL,-f,/usr/local/opt/openssl/lib/libssl.a,openssl,https://www.openssl.org/s llvm,-x,/usr/local/opt/llvm@4/bin/clang-4.0,llvm@4,http://releases.llvm.org/5.0.1/llvm-5.0.1.src.tar.xz wget,-x,/usr/local/bin/wget,wget,https://ftp.gnu.org/gnu/wget/wget-1.19.2.tar.gz CMake,-x,/usr/local/bin/cmake,cmake,https://cmake.org/files/v3.10/cmake-3.10.1-Darwin-x86_64.tar.gz -Boost,-f,/usr/local/opt/boost/include/boost/version.hpp,boost,https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz GMP,-f,/usr/local/opt/gmp/include/gmpxx.h,gmp,https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2 gettext,-x,/usr/local/opt/gettext/bin/gettext,gettext,https://ftp.gnu.org/pub/gnu/gettext/gettext-latest.tar.gz MongoDB,-x,/usr/local/opt/mongodb/bin/mongod,mongodb,https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-3.6.3.tgz