Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update msgpack c #270

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 27 additions & 11 deletions keyvi/3rdparty/msgpack-c/.github/depends/boost.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
#!/bin/sh
#!/bin/bash

usage()
{
cat <<EOL
-b - 32-bit or 64-bit library, maybe 32, 64 or both
-t - the toolset, maybe gcc, clang or both
-p - installation prefix
EOL
}

build_boost()
{
BASE=`pwd`/..
./b2 -j4 --toolset=$1 --prefix=${BASE}/usr --libdir="${BASE}/usr/$1/lib$2" --with-chrono --with-context --with-filesystem --with-system --with-timer address-model=$2 install
./b2 \
--toolset=$1 \
--prefix=$3/$2 \
--with-test \
--with-headers \
--with-chrono \
--with-context \
--with-filesystem \
--with-system \
--with-timer \
address-model=$2 \
install || exit 1
}

bit="64"
toolset="gcc"
prefix="$HOME/boost-prefix"

while getopts "b:t:" c; do
while getopts "b:t:p:" c; do
case "$c" in
b)
bit="$OPTARG"
Expand All @@ -27,24 +39,28 @@ while getopts "b:t:" c; do
toolset="$OPTARG"
[ "$toolset" != "gcc" ] && [ "$toolset" != "clang" ] && [ "$toolset" != "both" ] && usage && exit 1
;;
p)
prefix="$OPTARG"
;;
?*)
echo "invalid arguments." && exit 1
;;
esac
done

wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2
tar xf boost_1_71_0.tar.bz2
cd boost_1_71_0
./bootstrap.sh
mkdir $prefix || exit 1
wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 || exit 1
tar xf boost_1_76_0.tar.bz2 || exit 1
cd boost_1_76_0
./bootstrap.sh || exit 1

build()
{
if [ "$bit" = "both" ]; then
build_boost $1 32
build_boost $1 64
build_boost $1 32 $prefix
build_boost $1 64 $prefix
else
build_boost $1 $bit
build_boost $1 $bit $prefix
fi
}

Expand Down
51 changes: 51 additions & 0 deletions keyvi/3rdparty/msgpack-c/.github/depends/zlib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

usage()
{
cat <<EOL
-b - 32-bit or 64-bit library, maybe 32 or 64
-p - installation prefix
EOL
}

bit="64"
prefix="$HOME/zlib-prefix"

while getopts "b:t:p:" c; do
case "$c" in
b)
bit="$OPTARG"
[ "$bit" != "32" ] && [ "$bit" != "64" ] && [ "$bit" != "both" ] && usage && exit 1
;;
p)
prefix="$OPTARG"
;;
?*)
echo "invalid arguments." && exit 1
;;
esac
done

mkdir $prefix || exit 1
wget https://zlib.net/zlib-1.3.tar.gz || exit 1
tar -xf zlib-1.3.tar.gz || exit 1
cd zlib-1.3

build()
{
cmake \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=$2/$1 \
-D CMAKE_C_FLAGS="-m$1" \
-D CMAKE_SHARED_LINKER_FLAGS="-m$1" \
-B build$1 \
-S .
cmake --build build$1 --target install
}

if [ "$bit" = "both" ]; then
build 32 $prefix
build 64 $prefix
else
build $bit $prefix
fi
62 changes: 37 additions & 25 deletions keyvi/3rdparty/msgpack-c/.github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,59 @@ on:
- '*'

jobs:

codecov:
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: install depends
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install g++-multilib lcov
sudo apt-get install g++-10 cmake lcov -y
./ci/set_gcc_10.sh

- name: Cache boost
id: cache-boost
uses: actions/cache@v1
with:
path: usr
key: ${{ runner.os }}-boost-20200401
path: ~/boost-prefix/
key: ${{ runner.os }}-boost-64-1-76-0-2021-08-09

- name: Build boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: ./.github/depends/boost.sh -b both -t gcc
run: ./.github/depends/boost.sh -b 64 -t gcc -p $HOME/boost-prefix

- name: Cache zlib
id: cache-zlib
uses: actions/cache@v1
with:
path: ~/zlib-prefix/
key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09

- name: Build zlib
if: steps.cache-zlib.outputs.cache-hit != 'true'
run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix

- name: Compile tests
run: |
# install gtest
BASE=`pwd`
wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
unzip -q googletest-release-1.7.0.zip
cd googletest-release-1.7.0
g++ -m64 src/gtest-all.cc -I. -Iinclude -c -fPIC
g++ -m64 src/gtest_main.cc -I. -Iinclude -c -fPIC
ar -rv libgtest.a gtest-all.o
ar -rv libgtest_main.a gtest_main.o
mkdir -p ${BASE}/usr/include
cp -r include/gtest ${BASE}/usr/include
mkdir -p ${BASE}/usr/lib
mv *.a ${BASE}/usr/lib
cd ..

mkdir build && cd build
CMAKE_LIBRARY_PATH="${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib64/cmake" cmake -DMSGPACK_CXX17=ON -DMSGPACK_32BIT=OFF -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_USE_X3_PARSE=ON -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON ..
make -j4
make test
mkdir build
cmake \
-D MSGPACK_CXX20=ON \
-D MSGPACK_32BIT=OFF \
-D MSGPACK_CHAR_SIGN=signed \
-D MSGPACK_USE_X3_PARSE=ON \
-D MSGPACK_BUILD_EXAMPLES=ON \
-D MSGPACK_BUILD_TESTS=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D MSGPACK_GEN_COVERAGE=ON \
-D MSGPACK_USE_STD_VARIANT_ADAPTOR=ON \
-D CMAKE_PREFIX_PATH="$HOME/zlib-prefix/64;$HOME/boost-prefix/64" \
-B build \
-S . || exit 1
cmake --build build --target all || exit 1
ctest --test-dir build || exit 1

- name: Upload coverage to Codecov
working-directory: build
run: |
Expand Down
Loading
Loading