Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Eosio build: 7 gigs of ram requirement and other fixes #2355

Merged
merged 10 commits into from
Apr 13, 2018
5 changes: 4 additions & 1 deletion eosio_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,16 @@
if [ "$OS_NAME" == "CentOS Linux" ]; then
printf "\tsource /opt/rh/python33/enable\n"
fi
if [ "$OS_NAME" != "Fedora" ]; then
printf '\texport PATH=${HOME}/opt/mongodb/bin:$PATH\n'
fi
printf "\tcd ${HOME}/eos/build; make test\n\n"
printf "\tFor more information:\n"
printf "\tEOS.IO website: https://eos.io\n"
printf "\tEOS.IO Telegram channel @ https://t.me/EOSProject\n"
printf "\tEOS.IO resources: https://eos.io/resources/\n"
printf "\tEOS.IO wiki: https://github.com/EOSIO/eos/wiki\n\n\n"
if [ "x${EOSIO_BUILD_PACKAGE}" != "x" ]; then
# Build eos.io package
$CMAKE -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} \
Expand Down
43 changes: 31 additions & 12 deletions scripts/eosio_build_amazon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
printf "\tDisk space total: ${DISK_TOTAL}G\n"
printf "\tDisk space available: ${DISK_AVAIL}G\n"

if [ $MEM_MEG -lt 4000 ]; then
printf "\tYour system must have 4 or more Gigabytes of physical memory installed.\n"
if [ $MEM_MEG -lt 7000 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we settle on 8 GB of RAM during the scrum today?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gleehokie We explicitly and unquestionably decided in the presence of all that the minimum requirements for physical RAM would be 8 Gigs.
However ... my dev servers only have been 7.8 gigs of ram installed!
[bhamilton@ip-10-160-13-251 eos]$ free -m
total used free shared buff/cache available
Mem: 7821 193 5838 40 1788 7170
Swap: 0 0 0

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

printf "\tYour system must have 7 or more Gigabytes of physical memory installed.\n"
printf "\texiting now.\n"
exit 1
fi
Expand Down Expand Up @@ -108,7 +108,7 @@
mkdir -p ${HOME}/opt/ 2>/dev/null
cd ${HOME}/opt
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz)
if [ $STATUS -ne 200 ]; then
if [ "${STATUS}" -ne 200 ]; then
printf "\tUnable to download CMAKE at this time.\n"
printf "\tExiting now.\n\n"
exit;
Expand All @@ -134,38 +134,57 @@
fi

printf "\n\tChecking boost library installation.\n"
if [ ! -d ${HOME}/opt/boost_1_66_0 ]; then
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\._]//gI'`
if [ "${BVERSION}" != "1_66" ]; then
printf "\tRemoving existing boost libraries in ${HOME}/opt/boost* .\n"
rm -rf ${HOME}/opt/boost*
if [ $? -ne 0 ]; then
printf "\n\tUnable to remove deprecated boost libraries at this time.\n"
printf "\n\tExiting now.\n"
exit 1
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
if [ "${STATUS}" -ne 200 ]; then
printf "\tUnable to download Boost libraries at this time.\n"
printf "\tExiting now.\n\n"
exit;
fi
tar xf boost_1.66.0.tar.bz2
cd boost_1_66_0/
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/
rm -f ${TEMP_DIR}/boost_1.66.0.tar.bz2
else
printf "\tBoost 1.66 found at ${HOME}/opt/boost_1_66_0\n"
printf "\tBoost 1.66.0 found at ${HOME}/opt/boost_1_66_0.\n"
fi

printf "\n\tChecking MongoDB installation.\n"
if [ ! -e ${MONGOD_CONF} ]; then
printf "\n\tInstalling MongoDB 3.6.3.\n"
cd ${HOME}/opt
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.6.3.tgz)
if [ $STATUS -ne 200 ]; then
if [ "${STATUS}" -ne 200 ]; then
printf "\tUnable to download MongoDB at this time.\n"
printf "\tExiting now.\n\n"
exit;
fi
tar xf mongodb-linux-x86_64-amazon-3.6.3.tgz
rm -f mongodb-linux-x86_64-amazon-3.6.3.tgz
ln -s mongodb-linux-x86_64-amazon-3.6.3/ mongodb
ln -s ${HOME}/opt/mongodb-linux-x86_64-3.6.3/ mongodb
mkdir ${HOME}/opt/mongodb/data
mkdir ${HOME}/opt/mongodb/log
touch ${HOME}/opt/mongodb/log/mongodb.log
Expand All @@ -191,7 +210,7 @@ mongodconf
if [ ! -e /usr/local/lib/libmongocxx-static.a ]; then
cd ${TEMP_DIR}
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://github.com/mongodb/mongo-c-driver/releases/download/1.9.3/mongo-c-driver-1.9.3.tar.gz)
if [ $STATUS -ne 200 ]; then
if [ "${STATUS}" -ne 200 ]; then
rm -f ${TEMP_DIR}/mongo-c-driver-1.9.3.tar.gz
printf "\tUnable to download MongoDB C driver at this time.\n"
printf "\tExiting now.\n\n"
Expand Down
133 changes: 80 additions & 53 deletions scripts/eosio_build_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
DISK_TOTAL=$(( $DISK_TOTAL_KB / 1048576 ))
DISK_AVAIL=$(( $DISK_AVAIL_KB / 1048576 ))

MEM_GIG=$(( (($MEM_MEG / 1000) / 2) ))
JOBS=$(( ${MEM_GIG} > ${CPU_CORE} ? ${CPU_CORE} : ${MEM_GIG} ))

printf "\n\tOS name: $OS_NAME\n"
printf "\tOS Version: ${OS_VER}\n"
printf "\tCPU speed: ${CPU_SPEED}Mhz\n"
Expand All @@ -21,21 +24,21 @@
printf "\tDisk space total: ${DISK_TOTAL%.*}G\n"
printf "\tDisk space available: ${DISK_AVAIL%.*}G\n"

if [ $MEM_MEG -lt 4000 ]; then
echo "Your system must have 4 or more Gigabytes of physical memory installed."
if [ $MEM_MEG -lt 7000 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 GB?

echo "Your system must have 7 or more Gigabytes of physical memory installed."
echo "exiting now."
exit 1
fi

if [ $OS_VER -lt 7 ]; then
echo "You must be running Centos 7 or higher to install EOSIO."
echo "exiting now"
echo "exiting now."
exit 1
fi

if [ ${DISK_AVAIL%.*} -lt $DISK_MIN ]; then
echo "You must have at least ${DISK_MIN}GB of available storage to install EOSIO."
echo "exiting now"
echo "exiting now."
exit 1
fi
printf "\n\tChecking Yum installation\n"
Expand Down Expand Up @@ -102,14 +105,14 @@
fi
printf "\tCentos devtoolset-7 successfully enabled.\n"

printf "\n\tEnabling Centos python3 installation.\n"
source /opt/rh/python33/enable
if [ $? -ne 0 ]; then
printf "\n\tUnable to enable Centos python3 at this time.\n"
printf "\n\tExiting now.\n"
exit 1
fi
printf "\tCentos python3 successfully enabled.\n"
# printf "\n\tEnabling Centos python3 installation.\n"
# source /opt/rh/python33/enable
# if [ $? -ne 0 ]; then
# printf "\n\tUnable to enable Centos python3 at this time.\n"
# printf "\n\tExiting now.\n"
# exit 1
# fi
# printf "\tCentos python3 successfully enabled.\n"

printf "\n\tUpdating YUM repository.\n"

Expand Down Expand Up @@ -176,18 +179,23 @@
printf "\tInstalling CMAKE\n"
mkdir -p ${HOME}/opt/ 2>/dev/null
cd ${HOME}/opt
curl -L -O https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz)
if [ "${STATUS}" -ne 200 ]; then
printf "\tUnable to download Boost libraries at this time.\n"
printf "\tExiting now.\n\n"
exit;
fi
tar xf cmake-3.10.2.tar.gz
rm -f cmake-3.10.2.tar.gz
ln -s cmake-3.10.2/ cmake
ln -s ${HOME}/opt/cmake-3.10.2/ cmake
cd cmake
./bootstrap
if [ $? -ne 0 ]; then
printf "\tError running bootstrap for CMAKE.\n"
printf "\tExiting now.\n\n"
exit;
fi
make
make -j${JOBS}
if [ $? -ne 0 ]; then
printf "\tError compiling CMAKE.\n"
printf "\tExiting now.\n\n"
Expand All @@ -198,36 +206,60 @@
fi

printf "\n\tChecking boost library installation.\n"
if [ ! -d ${HOME}/opt/boost_1_66_0 ]; then
printf "\tInstalling boost libraries\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\._]//gI'`
if [ "${BVERSION}" != "1_66" ]; then
printf "\tRemoving existing boost libraries in ${HOME}/opt/boost* .\n"
rm -rf ${HOME}/opt/boost*
if [ $? -ne 0 ]; then
printf "\n\tUnable to remove deprecated boost libraries at this time.\n"
printf "\n\tExiting now.\n"
exit 1
fi
printf "\tInstalling boost libraries.\n"
cd ${TEMP_DIR}
curl -L https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 > boost_1.66.0.tar.bz2
tar xf boost_1.66.0.tar.bz2
cd boost_1_66_0/
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/
rm -f ${TEMP_DIR}/boost_1.66.0.tar.bz2
else
printf "\tBoost 1.66 found at ${HOME}/opt/boost_1_66_0\n"
printf "\tBoost 1.66.0 found at ${HOME}/opt/boost_1_66_0.\n"
fi

printf "\n\tChecking MongoDB installation.\n"
if [ ! -e ${MONGOD_CONF} ]; then
printf "\n\tInstalling MongoDB 3.6.3.\n"
cd ${HOME}/opt
curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.6.3.tgz
if [ $? -ne 0 ]; then
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.3.tgz)
if [ "${STATUS}" -ne 200 ]; then
printf "\tUnable to download MongoDB at this time.\n"
printf "\tExiting now.\n\n"
exit;
fi
tar xf mongodb-linux-x86_64-amazon-3.6.3.tgz
rm -f mongodb-linux-x86_64-amazon-3.6.3.tgz
ln -s ${HOME}/opt/mongodb-linux-x86_64-amazon-3.6.3/ ${HOME}/opt/mongodb
tar xf mongodb-linux-x86_64-3.6.3.tgz
rm -f mongodb-linux-x86_64-3.6.3.tgz
ln -s ${HOME}/opt/mongodb-linux-x86_64-3.6.3/ mongodb
mkdir ${HOME}/opt/mongodb/data
mkdir ${HOME}/opt/mongodb/log
touch ${HOME}/opt/mongodb/log/mongod.log
touch ${HOME}/opt/mongodb/log/mongodb.log

tee > /dev/null ${MONGOD_CONF} <<mongodconf
systemLog:
Expand All @@ -250,8 +282,8 @@ mongodconf
if [ ! -e /usr/local/lib/libmongocxx-static.a ]; then
printf "\n\tInstalling MongoDB C & C++ drivers.\n"
cd ${TEMP_DIR}
curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/1.9.3/mongo-c-driver-1.9.3.tar.gz
if [ $? -ne 0 ]; then
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://github.com/mongodb/mongo-c-driver/releases/download/1.9.3/mongo-c-driver-1.9.3.tar.gz)
if [ "${STATUS}" -ne 200 ]; then
rm -f ${TEMP_DIR}/mongo-c-driver-1.9.3.tar.gz 2>/dev/null
printf "\tUnable to download MongoDB C driver at this time.\n"
printf "\tExiting now.\n\n"
Expand All @@ -266,7 +298,7 @@ mongodconf
printf "\tExiting now.\n\n"
exit;
fi
make -j${CPU_CORE}
make -j${JOBS}
if [ $? -ne 0 ]; then
printf "\tError compiling MongoDB C driver.\n"
printf "\tExiting now.\n\n"
Expand Down Expand Up @@ -295,7 +327,7 @@ mongodconf
printf "\tExiting now.\n\n"
exit;
fi
sudo make -j${CPU_CORE}
sudo make -j${JOBS}
if [ $? -ne 0 ]; then
printf "\tError compiling MongoDB C++ driver.\n"
printf "\tExiting now.\n\n"
Expand All @@ -318,6 +350,11 @@ mongodconf
printf "\tInstalling secp256k1-zkp (Cryptonomex branch)\n"
cd ${TEMP_DIR}
git clone https://github.com/cryptonomex/secp256k1-zkp.git
if [ $? -ne 0 ]; then
printf "\tUnable to clone repo secp256k1-zkp @ https://github.com/cryptonomex/secp256k1-zkp.git.\n"
printf "\tExiting now.\n\n"
exit;
fi
cd secp256k1-zkp
./autogen.sh
if [ $? -ne 0 ]; then
Expand All @@ -338,35 +375,25 @@ mongodconf
printf "\tsecp256k1 found\n"
fi

printf "\n\tChecking binaryen installation.\n"
if [ ! -d ${HOME}/opt/binaryen ]; then
printf "\tInstalling binaryen v1.37.14:\n"
cd ${TEMP_DIR}
git clone https://github.com/EOSIO/binaryen
cd binaryen
git checkout eosio
$CMAKE . && make
if [ $? -ne 0 ]; then
printf "\tError compiling binaryen.\n"
printf "\tExiting now.\n\n"
exit;
fi
mkdir -p ${HOME}/opt/binaryen/ 2>/dev/null
mv ${TEMP_DIR}/binaryen/bin ${HOME}/opt/binaryen/
rm -rf ${TEMP_DIR}/binaryen
else
printf "\tBinaryen found at ${HOME}/opt/binaryen\n"
fi

printf "\n\tChecking LLVM with WASM support installation.\n"
if [ ! -d ${HOME}/opt/wasm/bin ]; then
printf "\tInstalling LLVM & WASM\n"
cd ${TEMP_DIR}
mkdir llvm-compiler 2>/dev/null
cd llvm-compiler
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git
if [ $? -ne 0 ]; then
printf "\tUnable to clone llvm repo @ https://github.com/llvm-mirror/llvm.git.\n"
printf "\tExiting now.\n\n"
exit;
fi
cd llvm/tools
git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git
if [ $? -ne 0 ]; then
printf "\tUnable to clone clang repo @ https://github.com/llvm-mirror/clang.git.\n"
printf "\tExiting now.\n\n"
exit;
fi
cd ..
mkdir build 2>/dev/null
cd build
Expand All @@ -378,7 +405,7 @@ mongodconf
printf "\tExiting now.\n\n"
exit;
fi
make -j$(nproc)
make -j${JOBS}
if [ $? -ne 0 ]; then
printf "\tError compiling LLVM and clang with EXPERIMENTAL WASM support.\n"
printf "\tExiting now.\n\n"
Expand Down
6 changes: 3 additions & 3 deletions scripts/eosio_build_darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
printf "\tDisk space total: ${DISK_TOTAL}G\n"
printf "\tDisk space available: ${DISK_AVAIL}G\n\n"

if [ $MEM_GIG -lt 8 ]; then
echo "Your system must have 8 or more Gigabytes of physical memory installed."
if [ $MEM_GIG -lt 7 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 GB?

echo "Your system must have 7 or more Gigabytes of physical memory installed."
echo "Exiting now."
exit 1
fi
Expand Down Expand Up @@ -172,7 +172,7 @@
brew install --force pkgconfig
brew unlink pkgconfig && brew link --force pkgconfig
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://github.com/mongodb/mongo-c-driver/releases/download/1.9.3/mongo-c-driver-1.9.3.tar.gz)
if [ $STATUS -ne 200 ]; then
if [ "${STATUS}" -ne 200 ]; then
rm -f ${TEMP_DIR}/mongo-c-driver-1.9.3.tar.gz
printf "\tUnable to download MongoDB C driver at this time.\n"
printf "\tExiting now.\n\n"
Expand Down
Loading