Skip to content

Commit

Permalink
update gtest & small fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
vagetablechicken committed Jul 22, 2021
1 parent d0097d6 commit ad5d3ea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion fetch_resource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pushd "$DOWNLOAD_DIR"
echo -e "${GREEN}downloading resources into $DOWNLOAD_DIR${NC}"

# google test
fetch https://github.com/google/googletest/archive/refs/tags/release-1.10.0.tar.gz googletest-release-1.10.0.tar.gz
fetch https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz googletest-release-1.11.0.tar.gz

# zlib
fetch https://github.com/madler/zlib/archive/v1.2.11.tar.gz zlib-1.2.11.tar.gz
Expand Down
4 changes: 4 additions & 0 deletions pack_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ unpack_and_install boost
unpack_and_install llvm
unpack_and_install libother

# needs a soft link lib64->lib for Mac OS
pushd "$INSTALL_DIR"
ln -s lib lib64
popd
tar czf "$INSTALL_DIR.tar.gz" "$INSTALL_DIR"

mkdir -p "$SRC_DIR"
Expand Down
7 changes: 4 additions & 3 deletions pack_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ if [[ "${ARCH}" == "Mac" ]]; then
else
./bootstrap.sh
fi
./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX"
./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" --with-regex --with-filesystem --with-date_time # TODO

popd

tar xzf common-1.0.0.tar.gz
pushd common-1.0.0
if [[ "${ARCH}" == "Mac" ]]; then
sed -i '' 's/^#include <syscall.h>/#include <sys\/syscall.h>/' src/logging.cc
sed -i '' 's/syscall(__NR_gettid)/syscall(SYS_gettid)/' src/logging.cc
# 'syscall' is deprecated: first deprecated in OS X 10.12
sed -i '' 's/^#include <syscall.h>/#include <pthread.h>/' src/logging.cc
sed -i '' 's/thread_id = syscall(__NR_gettid)/pthread_threadid_np(0, \&thread_id)/' src/logging.cc
fi
make -j"$(nproc)" INCLUDE_PATH="-Iinclude -I$DEPS_PREFIX/include" PREFIX="$DEPS_PREFIX" install

Expand Down
20 changes: 10 additions & 10 deletions pack_other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ pushd "$DEPS_SOURCE"

if [ ! -f gtest_succ ]; then
echo "installing gtest ...."
tar xzf googletest-release-1.10.0.tar.gz
tar xzf googletest-release-1.11.0.tar.gz

pushd googletest-release-1.10.0
pushd googletest-release-1.11.0
cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX="$DEPS_PREFIX" -DCMAKE_CXX_FLAGS=-fPIC
cmake --build build -- -j"$(nproc)"
cmake --build build --target install
Expand Down Expand Up @@ -153,16 +153,16 @@ else
touch unwind_succ
fi

if [ -f "gperf_tool" ]; then
echo "gperf_tool exist"
if [ -f "gperf_succ" ]; then
echo "gperf_succ exist"
else
tar zxf gperftools-2.5.tar.gz
pushd gperftools-2.5
./configure --enable-cpu-profiler --enable-heap-checker --enable-heap-profiler --enable-static --prefix="$DEPS_PREFIX"
./configure --enable-cpu-profiler --enable-heap-checker --enable-heap-profiler --prefix="$DEPS_PREFIX" --enable-shared=no
make "-j$(nproc)"
make install
popd
touch gperf_tool
touch gperf_succ
fi

if [ -f "leveldb_succ" ]; then
Expand All @@ -183,11 +183,11 @@ if [ -f "openssl_succ" ]; then
else
unzip OpenSSL_1_1_0.zip
pushd openssl-OpenSSL_1_1_0
# On MACOS, sed must use `-i extension` for saving backups with the specified extension.
# On Mac OS, sed must use `-i extension` for saving backups with the specified extension.
# But we can give a zero-length extension, no backup will be saved.
sed -i'' -e 's#qw/glob#qw/:glob#' Configure
sed -i'' -e 's#qw/glob#qw/:glob#' test/build.info
./config --prefix="$DEPS_PREFIX" --openssldir="$DEPS_PREFIX"
./config --prefix="$DEPS_PREFIX" --openssldir="$DEPS_PREFIX" no-shared
make "-j$(nproc)"
make install
rm -rf "$DEPS_PREFIX"/lib/libssl.so*
Expand Down Expand Up @@ -290,11 +290,11 @@ fi
tar -zxf apache-zookeeper-3.4.14.tar.gz
pushd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c
if [[ "$ARCH" == "Mac" ]]; then
CC="clang" CFLAGS="$CFLAGS" ./configure --prefix="$DEPS_PREFIX"
CC="clang" CFLAGS="$CFLAGS" ./configure --prefix="$DEPS_PREFIX" --enable-shared=no
else
autoreconf -if
# see https://issues.apache.org/jira/browse/ZOOKEEPER-3293
CFLAGS="$CFLAGS -Wno-error=format-overflow=" ./configure --prefix="$DEPS_PREFIX"
CFLAGS="$CFLAGS -Wno-error=format-overflow=" ./configure --prefix="$DEPS_PREFIX" --enable-shared=no
fi

make -j"$(nproc)"
Expand Down

0 comments on commit ad5d3ea

Please sign in to comment.