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

add prometheus to thirdparty #284

Merged
merged 11 commits into from
Jul 31, 2019
15 changes: 15 additions & 0 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ function exit_if_fail()
{
if [ $2 -ne 0 ]; then
echo "build $1 failed"
echo "maybe the file is not a complete or right one"
vagetablechicken marked this conversation as resolved.
Show resolved Hide resolved
echo "else please check cmake or make"
exit $2
fi
}
Expand Down Expand Up @@ -264,3 +266,16 @@ if [ ! -d $TP_OUTPUT/include/gflags ]; then
else
echo "skip build gflags"
fi

#build prometheus-cpp
if [ ! -d $TP_OUTPUT/include/prometheus ]; then
mkdir -p $TP_BUILD/prometheus
cd $TP_BUILD/prometheus
cmake $TP_SRC/prometheus-cpp -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT
make -j8 && make install
res=$?
exit_if_fail "prometheus-cpp" $res
cd $TP_DIR
else
echo "skip build prometheus-cpp"
fi
vagetablechicken marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions thirdparty/download-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,18 @@ check_and_download "${GFLAGS_PKG}"\
"${GFLAGS_NAME}"
exit_if_fail $?

# prometheus-cpp
if [ ! -d $TP_SRC/prometheus-cpp ]; then
git clone https://github.com/jupp0r/prometheus-cpp.git --recursive
Copy link
Contributor

@neverchanje neverchanje Jul 26, 2019

Choose a reason for hiding this comment

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

用 0.7.0 有没有问题?我们的依赖包为了加速通常放在阿里云 oss,你应当这个也一样。没问题我就放上去。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

用release版本的话prometheus本身会缺少第三方库,并且无法用git submodule init/update获取,在build的时候会失败

Copy link
Member

@vagetablechicken vagetablechicken Jul 29, 2019

Choose a reason for hiding this comment

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

第三方库gtest可以禁掉,option(ENABLE_TESTING "Build tests" ON)。也不会为第三方跑测试,不用build。
civetweb就和Prometheus一样,单独下来吧

git clone master还是不能保证稳定性

if [ $? != 0 ]; then
echo "ERROR: download prometheus-cpp wrong"
exit 2
fi
else
echo "prometheus-cpp has already downloaded, skip it"
fi
exit_if_fail $?

# s2geometry
# from: https://github.com/google/s2geometry/archive/0239455c1e260d6d2c843649385b4fb9f5b28dba.zip
S2GEOMETRY_NAME=s2geometry-0239455c1e260d6d2c843649385b4fb9f5b28dba
Expand Down