From ad5d3eaa105015f2fb48e55fc705facfcc13598b Mon Sep 17 00:00:00 2001 From: huangwei Date: Thu, 22 Jul 2021 19:46:05 +0800 Subject: [PATCH 1/3] update gtest & small fixs --- fetch_resource.sh | 2 +- pack_all.sh | 4 ++++ pack_boost.sh | 7 ++++--- pack_other.sh | 20 ++++++++++---------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/fetch_resource.sh b/fetch_resource.sh index 895596f..89ebe58 100755 --- a/fetch_resource.sh +++ b/fetch_resource.sh @@ -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 diff --git a/pack_all.sh b/pack_all.sh index 995d40c..32cb9ea 100755 --- a/pack_all.sh +++ b/pack_all.sh @@ -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" diff --git a/pack_boost.sh b/pack_boost.sh index 487fd27..47caae8 100755 --- a/pack_boost.sh +++ b/pack_boost.sh @@ -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 /#include /' 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 /#include /' 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 diff --git a/pack_other.sh b/pack_other.sh index 8811090..5243245 100755 --- a/pack_other.sh +++ b/pack_other.sh @@ -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 @@ -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 @@ -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* @@ -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)" From 4ada26843074a7576f31c86c3d8869ae203e70a9 Mon Sep 17 00:00:00 2001 From: huangwei Date: Thu, 22 Jul 2021 19:49:04 +0800 Subject: [PATCH 2/3] fix --- pack_boost.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pack_boost.sh b/pack_boost.sh index 47caae8..67402fe 100755 --- a/pack_boost.sh +++ b/pack_boost.sh @@ -34,7 +34,7 @@ if [[ "${ARCH}" == "Mac" ]]; then else ./bootstrap.sh fi -./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" --with-regex --with-filesystem --with-date_time # TODO +./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" --with-regex --with-filesystem --with-date_time popd From 3e71b6cef53e6ec45da1a7e90dd68ffe12a1fa43 Mon Sep 17 00:00:00 2001 From: huangwei Date: Thu, 22 Jul 2021 23:49:44 +0800 Subject: [PATCH 3/3] fix name, build all boost libs --- .github/workflows/build.yml | 4 ++-- pack_boost.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa3b06c..01e5452 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -279,13 +279,13 @@ jobs: run: | cp ../pack_all.sh . ./pack_all.sh - for var in artifact/thirdparty*.tar.gz; do mv "$var" "${var%.tar.gz}-mac.tar.gz"; done + for var in artifact/thirdparty*.tar.gz; do mv "$var" "${var%.tar.gz}-darwin.tar.gz"; done - name: Release uses: softprops/action-gh-release@v1 with: files: | linux/artifact/third*.tar.gz - mac/artifact/thirdparty*-mac.tar.gz + mac/artifact/thirdparty*-darwin.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pack_boost.sh b/pack_boost.sh index 67402fe..3a3bb4e 100755 --- a/pack_boost.sh +++ b/pack_boost.sh @@ -34,7 +34,7 @@ if [[ "${ARCH}" == "Mac" ]]; then else ./bootstrap.sh fi -./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" --with-regex --with-filesystem --with-date_time +./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" popd