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

Bump boost version, change caching strategy #443

Merged
merged 3 commits into from
Aug 21, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/composite-actions/download-libraries/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ inputs:
description: 'Download googletest'
default: true

install-boost:
type: boolean
description: 'Install boost'
default: true

runs:
using: 'composite'
steps:
Expand All @@ -21,10 +26,6 @@ runs:
sudo apt-get install gcc-10 g++-10 cmake build-essential -y
shell: bash

- name: Install Boost
run: sudo apt-get install libboost-all-dev -y
shell: bash

- name: Make lib directory
run: |
mkdir -p lib
Expand Down Expand Up @@ -65,6 +66,19 @@ runs:
with:
directory: atomicbitvector
download-command: git clone https://github.com/ekg/atomicbitvector.git --depth 1
- name: Download boost
uses: ./.github/composite-actions/download-library
with:
directory: boost
download-command: wget -O boost_1_81_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.gz/download && tar xzvf boost_1_81_0.tar.gz && mv boost_1_81_0 boost

- name: Install Boost
run: |
cd lib/boost
./bootstrap.sh --prefix=/usr
sudo ./b2 install --prefix=/usr
shell: bash
if: inputs.install-boost != 'false'

# Uncomment this if we set up our own git lfs server
# - name: Install git-lfs
Expand Down
15 changes: 6 additions & 9 deletions .github/composite-actions/download-library/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
runs:
using: 'composite'
steps:
- uses: actions/cache@v3
- uses: actions/cache/restore@v4
id: cache-library
with:
path: ${{github.workspace}}/lib/${{inputs.directory}}
Expand All @@ -20,11 +20,8 @@ runs:
${{inputs.download-command}}
shell: bash
if: steps.cache-library.outputs.cache-hit != 'true'
- run: |
if ! test -d lib/'${{inputs.directory}}'; then
echo 'Library directory name is not correct:' '${{inputs.directory}}'
ls lib
exit 1
fi
exit 0
shell: bash
- uses: actions/cache/save@v4
with:
path: ${{github.workspace}}/lib/${{inputs.directory}}
key: ${{runner.os}}-${{inputs.directory}}
if: steps.cache-library.outputs.cache-hit != 'true'
26 changes: 4 additions & 22 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ jobs:
CIBW_ARCHS_LINUX: x86_64
# Builds wheels for PyPy & CPython on manylinux
CIBW_BUILD: "*manylinux*"
# musllinux crashes during Boost 1.78.0 compilation
# May be related to https://bugs.gentoo.org/829147
# Perhaps that bumping Boost version in workflow can solve the issue
CIBW_SKIP: "*musllinux*"
CIBW_TEST_REQUIRES: pytest
CIBW_BUILD_VERBOSITY: 1
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
Expand All @@ -79,31 +75,17 @@ jobs:
with:
download-pybind: true
download-googletest: false

- name: Cache unpacked Boost
uses: actions/cache@v3
id: cache-unpacked-boost
with:
path: ${{github.workspace}}/lib/boost_1_78_0
key: ${{ runner.os }}-boost-for-wheels-78

- name: Download & unpack Boost
run: |
cd ${{github.workspace}}/lib
wget -O boost_1_78_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.gz/download
tar xzf boost_1_78_0.tar.gz
shell: bash
if: steps.cache-unpacked-boost.outputs.cache-hit != 'true'
install-boost: false

- name: Build wheels
uses: pypa/[email protected]
with:
only: ${{ matrix.only }}
env:
CIBW_BEFORE_ALL: >
cd lib/boost_1_78_0 &&
./bootstrap.sh --prefix=/usr/local &&
./b2 install -j4 --prefix=/usr/local
cd lib/boost &&
./bootstrap.sh --prefix=/usr &&
./b2 install -j4 --prefix=/usr
CIBW_TEST_COMMAND: >
cp {project}/test_input_data/WDC_satellites.csv {project}/src/python_bindings &&
cp {project}/test_input_data/transactional_data/rules-kaggle-rows.csv {project}/src/python_bindings &&
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ endif()

# configuring boost
set(Boost_USE_STATIC_LIBS OFF)
find_package(Boost 1.72.0 REQUIRED COMPONENTS container thread graph)
find_package(Boost 1.81.0 REQUIRED COMPONENTS container thread graph)
include_directories(${Boost_INCLUDE_DIRS})
message(${Boost_INCLUDE_DIRS})

Expand Down
Loading