2017-08-24 23:53:16 +08:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
required_pkgs=(git arcanist # source code control
|
2019-04-19 16:44:25 +08:00
|
|
|
make pkg-config # build system
|
2017-08-24 23:53:16 +08:00
|
|
|
curl wget # for downloading libs
|
|
|
|
uuid-dev default-jre-headless # required by antlr
|
|
|
|
libreadline-dev # for memgraph console
|
2018-06-20 23:44:47 +08:00
|
|
|
libssl-dev
|
2018-08-06 19:05:42 +08:00
|
|
|
libseccomp-dev
|
2017-08-24 23:53:16 +08:00
|
|
|
python3 python-virtualenv python3-pip # for qa, macro_benchmark and stress tests
|
2019-12-09 18:31:27 +08:00
|
|
|
python3-yaml # for the configuration generator
|
2018-07-06 15:28:05 +08:00
|
|
|
uuid-dev # mg-utils
|
|
|
|
libcurl4-openssl-dev # mg-requests
|
Add Lisp C++ Preprocessing (LCP)
Summary:
In order to enhance C++ metaprogramming capabilities, a custom
preprocessing step is added before compilation. C++ code may be mixed
with Lisp code in order to generate a complete C++ source code. The
mechanism is hooked into cmake. To notify cmake of .lcp files, `add_lcp`
function in src/CMakeLists.txt needs to be invoked.
The main executable entry point is in tools/lcp, while the source code
is in src/lisp/lcp.lisp
The main goal of LCP is to auto generate class serialization code and
member variable getter functions. This should now be significantly less
error prone, since you cannot forget to serialize a member variable
through this mechanism. Future uses should be generating other repeating
code, such as `Clone` methods or perhaps some debug information.
.lcp files may contain mixed C++ code (enclosed in #>cpp ... cpp<#
blocks) with Common Lisp code.
NOTE: With great power comes great responsibility. Lisp metaprogramming
capabilities are incredibly powerful. To keep the sanity of the team
intact, use Lisp preprocessing only when *really* necessary.
Reviewers: buda, mferencevic, msantl, dgleich, ipaljak, mculinovic, mtomic
Reviewed By: mtomic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D1361
2018-04-27 21:48:30 +08:00
|
|
|
sbcl # for custom Lisp C++ preprocessing
|
2020-02-13 18:38:32 +08:00
|
|
|
php-xml # for arcanist linters
|
2017-08-24 23:53:16 +08:00
|
|
|
)
|
|
|
|
|
2019-04-19 16:44:25 +08:00
|
|
|
optional_pkgs=(doxygen graphviz # source documentation generators
|
2017-08-24 23:53:16 +08:00
|
|
|
php-cli # for user technical documentation generators
|
2018-08-22 22:05:38 +08:00
|
|
|
mono-runtime mono-mcs nodejs # for driver tests
|
2017-08-24 23:53:16 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
use_sudo=0
|
|
|
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
cd "$DIR"
|
2016-11-19 00:35:29 +08:00
|
|
|
|
2017-04-06 18:05:58 +08:00
|
|
|
function print_help () {
|
|
|
|
echo "Usage: $0 [OPTION]"
|
|
|
|
echo -e "Check for missing packages and install them if possible.\n"
|
|
|
|
echo "Optional arguments:"
|
|
|
|
echo -e " -s\tuse sudo apt-get for installing packages"
|
|
|
|
echo -e " -h\tdisplay this help and exit"
|
|
|
|
}
|
|
|
|
|
2017-08-24 23:53:16 +08:00
|
|
|
function setup_virtualenv () {
|
|
|
|
pushd $1 > /dev/null
|
|
|
|
echo "Setting up virtualenv for: $1"
|
2017-04-06 18:05:58 +08:00
|
|
|
|
2017-08-24 23:53:16 +08:00
|
|
|
# remove old virtualenv
|
|
|
|
if [ -d ve3 ]; then
|
|
|
|
rm -rf ve3
|
|
|
|
fi
|
2017-04-06 18:05:58 +08:00
|
|
|
|
2017-08-24 23:53:16 +08:00
|
|
|
# create new virtualenv
|
|
|
|
virtualenv -p python3 ve3 || exit 1
|
|
|
|
source ve3/bin/activate
|
2018-04-17 17:17:30 +08:00
|
|
|
# we need to increase the timeout for pip because our local cache server
|
|
|
|
# can sometimes be stupid, see: https://github.com/devpi/devpi/issues/208
|
|
|
|
pip --timeout 1000 install -i http://deps.memgraph.io:3141/root/pypi \
|
2017-08-24 23:53:16 +08:00
|
|
|
--trusted-host deps.memgraph.io -r requirements.txt || exit 1
|
|
|
|
deactivate
|
|
|
|
|
|
|
|
popd > /dev/null
|
|
|
|
}
|
2017-04-06 18:05:58 +08:00
|
|
|
|
|
|
|
if [[ $# -gt 1 ]]; then
|
|
|
|
print_help
|
|
|
|
exit 1
|
|
|
|
elif [[ $# -eq 1 ]]; then
|
|
|
|
case "$1" in
|
|
|
|
-s)
|
|
|
|
use_sudo=1
|
|
|
|
;;
|
|
|
|
-h)
|
|
|
|
print_help
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# unknown option
|
|
|
|
print_help
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Started installing dependencies for Memgraph"
|
|
|
|
|
|
|
|
required_missing=0
|
2017-03-08 01:25:49 +08:00
|
|
|
|
2017-02-21 22:44:12 +08:00
|
|
|
# install all dependencies on debian based operating systems
|
2017-04-06 18:05:58 +08:00
|
|
|
for pkg in ${required_pkgs[@]}; do
|
|
|
|
if dpkg -s $pkg 2>/dev/null >/dev/null; then
|
|
|
|
echo "Found $pkg"
|
|
|
|
elif (( $use_sudo )); then
|
|
|
|
echo "Installing $pkg"
|
|
|
|
if [[ ! `sudo apt-get -y install $pkg` ]]; then
|
|
|
|
echo "Didn't install $pkg [required]"
|
|
|
|
required_missing=1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Missing $pkg [required]"
|
|
|
|
required_missing=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for pkg in ${optional_pkgs[@]}; do
|
|
|
|
if dpkg -s $pkg 2>/dev/null >/dev/null; then
|
|
|
|
echo "Found $pkg [optional]"
|
|
|
|
else
|
|
|
|
echo "Missing $pkg [optional]"
|
|
|
|
fi
|
2017-02-21 22:44:12 +08:00
|
|
|
done
|
2016-11-19 00:35:29 +08:00
|
|
|
|
2017-04-06 18:05:58 +08:00
|
|
|
if (( $required_missing )); then
|
|
|
|
echo "Missing required packages. EXITING!"
|
|
|
|
echo "Please, install required packages and rerun $0 again."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2017-03-06 23:15:20 +08:00
|
|
|
# create a default build directory
|
|
|
|
mkdir -p ./build
|
|
|
|
|
Add Lisp C++ Preprocessing (LCP)
Summary:
In order to enhance C++ metaprogramming capabilities, a custom
preprocessing step is added before compilation. C++ code may be mixed
with Lisp code in order to generate a complete C++ source code. The
mechanism is hooked into cmake. To notify cmake of .lcp files, `add_lcp`
function in src/CMakeLists.txt needs to be invoked.
The main executable entry point is in tools/lcp, while the source code
is in src/lisp/lcp.lisp
The main goal of LCP is to auto generate class serialization code and
member variable getter functions. This should now be significantly less
error prone, since you cannot forget to serialize a member variable
through this mechanism. Future uses should be generating other repeating
code, such as `Clone` methods or perhaps some debug information.
.lcp files may contain mixed C++ code (enclosed in #>cpp ... cpp<#
blocks) with Common Lisp code.
NOTE: With great power comes great responsibility. Lisp metaprogramming
capabilities are incredibly powerful. To keep the sanity of the team
intact, use Lisp preprocessing only when *really* necessary.
Reviewers: buda, mferencevic, msantl, dgleich, ipaljak, mculinovic, mtomic
Reviewed By: mtomic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D1361
2018-04-27 21:48:30 +08:00
|
|
|
# quicklisp package manager for Common Lisp
|
|
|
|
quicklisp_install_dir="$HOME/quicklisp"
|
|
|
|
if [[ -v QUICKLISP_HOME ]]; then
|
|
|
|
quicklisp_install_dir="${QUICKLISP_HOME}"
|
|
|
|
fi
|
2018-10-15 17:01:57 +08:00
|
|
|
|
Add Lisp C++ Preprocessing (LCP)
Summary:
In order to enhance C++ metaprogramming capabilities, a custom
preprocessing step is added before compilation. C++ code may be mixed
with Lisp code in order to generate a complete C++ source code. The
mechanism is hooked into cmake. To notify cmake of .lcp files, `add_lcp`
function in src/CMakeLists.txt needs to be invoked.
The main executable entry point is in tools/lcp, while the source code
is in src/lisp/lcp.lisp
The main goal of LCP is to auto generate class serialization code and
member variable getter functions. This should now be significantly less
error prone, since you cannot forget to serialize a member variable
through this mechanism. Future uses should be generating other repeating
code, such as `Clone` methods or perhaps some debug information.
.lcp files may contain mixed C++ code (enclosed in #>cpp ... cpp<#
blocks) with Common Lisp code.
NOTE: With great power comes great responsibility. Lisp metaprogramming
capabilities are incredibly powerful. To keep the sanity of the team
intact, use Lisp preprocessing only when *really* necessary.
Reviewers: buda, mferencevic, msantl, dgleich, ipaljak, mculinovic, mtomic
Reviewed By: mtomic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D1361
2018-04-27 21:48:30 +08:00
|
|
|
if [[ ! -f "${quicklisp_install_dir}/setup.lisp" ]]; then
|
|
|
|
wget -nv https://beta.quicklisp.org/quicklisp.lisp -O quicklisp.lisp || exit 1
|
|
|
|
echo \
|
|
|
|
"
|
|
|
|
(load \"${DIR}/quicklisp.lisp\")
|
|
|
|
(quicklisp-quickstart:install :path \"${quicklisp_install_dir}\")
|
|
|
|
" | sbcl --script || exit 1
|
|
|
|
rm -rf quicklisp.lisp || exit 1
|
|
|
|
fi
|
2018-10-18 17:34:37 +08:00
|
|
|
ln -Tfs "$DIR/src/lisp" "${quicklisp_install_dir}/local-projects/lcp"
|
2019-05-09 20:57:02 +08:00
|
|
|
# Install LCP dependencies
|
|
|
|
# TODO: We should at some point cache or have a mirror of packages we use.
|
|
|
|
# TODO: move the installation of LCP's dependencies into ./setup.sh
|
|
|
|
echo \
|
|
|
|
"
|
|
|
|
(load \"${quicklisp_install_dir}/setup.lisp\")
|
|
|
|
(ql:quickload '(:lcp :lcp/test) :silent t)
|
|
|
|
" | sbcl --script
|
Add Lisp C++ Preprocessing (LCP)
Summary:
In order to enhance C++ metaprogramming capabilities, a custom
preprocessing step is added before compilation. C++ code may be mixed
with Lisp code in order to generate a complete C++ source code. The
mechanism is hooked into cmake. To notify cmake of .lcp files, `add_lcp`
function in src/CMakeLists.txt needs to be invoked.
The main executable entry point is in tools/lcp, while the source code
is in src/lisp/lcp.lisp
The main goal of LCP is to auto generate class serialization code and
member variable getter functions. This should now be significantly less
error prone, since you cannot forget to serialize a member variable
through this mechanism. Future uses should be generating other repeating
code, such as `Clone` methods or perhaps some debug information.
.lcp files may contain mixed C++ code (enclosed in #>cpp ... cpp<#
blocks) with Common Lisp code.
NOTE: With great power comes great responsibility. Lisp metaprogramming
capabilities are incredibly powerful. To keep the sanity of the team
intact, use Lisp preprocessing only when *really* necessary.
Reviewers: buda, mferencevic, msantl, dgleich, ipaljak, mculinovic, mtomic
Reviewed By: mtomic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D1361
2018-04-27 21:48:30 +08:00
|
|
|
|
2017-02-21 22:44:12 +08:00
|
|
|
# setup libs (download)
|
2016-11-19 00:35:29 +08:00
|
|
|
cd libs
|
2017-12-05 17:00:38 +08:00
|
|
|
./cleanup.sh
|
2016-11-19 00:35:29 +08:00
|
|
|
./setup.sh
|
|
|
|
cd ..
|
|
|
|
|
2017-07-21 19:09:22 +08:00
|
|
|
# setup qa dependencies
|
2017-08-24 23:53:16 +08:00
|
|
|
setup_virtualenv tests/qa
|
2017-07-21 19:09:22 +08:00
|
|
|
|
2017-08-02 16:48:33 +08:00
|
|
|
# setup stress dependencies
|
2017-08-24 23:53:16 +08:00
|
|
|
setup_virtualenv tests/stress
|
2017-08-02 16:48:33 +08:00
|
|
|
|
2019-09-11 22:39:35 +08:00
|
|
|
# setup integration/ldap dependencies
|
|
|
|
setup_virtualenv tests/integration/ldap
|
|
|
|
|
2017-04-06 18:05:58 +08:00
|
|
|
echo "Done installing dependencies for Memgraph"
|