Skip to content

Commit

Permalink
Merge pull request #86 from BOINC/vko_build_linux_binaries_with_older…
Browse files Browse the repository at this point in the history
…_libc
  • Loading branch information
AenBleidd authored Jul 23, 2023
2 parents 94e1d36 + b37b3c3 commit 98cf70d
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ jobs:
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc-apps/,read" >> $GITHUB_ENV
- name: Build
if: ${{ success() && matrix.configuration != 'coverage-report' }}
if: ${{ success() }}
run: |
python3 build.py -nt -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
python3 build.py -nt -ql -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
83 changes: 73 additions & 10 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,93 @@ env:
AWS_DEFAULT_REGION: us-west-2

jobs:
build:
build-clang:
name: ${{ matrix.app }}-${{ matrix.configuration }}-build
runs-on: ubuntu-latest
container:
image: debian:buster
strategy:
matrix:
app: [boinc-autodock-vina]
configuration: [x64-linux-static, x86-linux-static, arm-linux-static, armneon-linux-static, arm64-linux-static, coverage-report]
configuration: [x64-linux-static, x86-linux-static]
fail-fast: false
steps:
- name: Install dependencies
run: |
apt-get -qq update
apt-get install -y clang-11 make build-essential m4 pkg-config autoconf libtool git python3 python3-distutils curl zip unzip tar bison p7zip-full
- name: Install aws cli tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
- name: Install cmake
run: |
curl -L https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-linux-x86_64.sh -o cmake.sh
chmod +x cmake.sh
./cmake.sh --skip-license --prefix=/usr/local
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Fix git configuration
if: success()
run: |
CWD=$(pwd)
echo "Current working directory: $CWD"
git config --global --add safe.directory "$CWD"
- name: Install x86 dependencies
if: ${{ success() && matrix.configuration == 'x86-linux-static' }}
run: |
sudo apt-get -qq update
sudo apt-get install -y gcc-multilib g++-multilib
apt-get -qq update
apt-get install -y gcc-multilib g++-multilib
- name: Check if build is running from origin repo
if: ${{ success() && env.AWS_ACCESS_KEY_ID != 0 && env.AWS_SECRET_ACCESS_KEY != 0 }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg.cache.boinc-apps/,readwrite" >> $GITHUB_ENV
- name: Check if build is running from fork
if: ${{ success() && (env.AWS_ACCESS_KEY_ID == 0 || env.AWS_SECRET_ACCESS_KEY == 0) }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc-apps/,read" >> $GITHUB_ENV
- name: Build
if: ${{ success() }}
run: |
python3 build.py -nt -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
- name: Test x86 and x64
if: ${{ success() && (matrix.configuration == 'x86-linux-static' || matrix.configuration == 'x64-linux-static') }}
run: |
python3 build.py -nb -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
- name: Upload boinc-autodock-vina artifacts
if: ${{ success() && matrix.app == 'boinc-autodock-vina' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.app }}-${{ matrix.configuration }}-${{ github.event.pull_request.head.sha }}
path: |
build/${{ matrix.app }}/${{ matrix.configuration }}/boinc-autodock-vina
build/${{ matrix.app }}/${{ matrix.configuration }}/config-validator
build/${{ matrix.app }}/${{ matrix.configuration }}/work-generator
build-gcc:
name: ${{ matrix.app }}-${{ matrix.configuration }}-build
runs-on: ubuntu-latest
strategy:
matrix:
app: [boinc-autodock-vina]
configuration: [arm-linux-static, armneon-linux-static, arm64-linux-static, coverage-report]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Install arm dependencies
if: ${{ success() && (matrix.configuration == 'arm-linux-static' || matrix.configuration == 'armneon-linux-static') }}
Expand All @@ -63,7 +132,6 @@ jobs:
sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-9 99
sudo update-alternatives --set arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-9
- name: Install arm64 dependencies
if: ${{ success() && matrix.configuration == 'arm64-linux-static' }}
run: |
Expand All @@ -90,11 +158,6 @@ jobs:
run: |
python3 build.py -nt -cr -ts=ci -t=x64-linux-static ${{ matrix.app }}
- name: Test x86 and x64
if: ${{ success() && (matrix.configuration == 'x86-linux-static' || matrix.configuration == 'x64-linux-static') }}
run: |
python3 build.py -nb -ts=ci -t=${{ matrix.configuration }} ${{ matrix.app }}
- name: Test arm and armneon
if: ${{ success() && (matrix.configuration == 'arm-linux-static' || matrix.configuration == 'armneon-linux-static') }}
run: |
Expand Down
54 changes: 32 additions & 22 deletions boinc-autodock-vina/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,30 +169,36 @@ target_include_directories(jsoncons_helper
)

if (NOT COVERAGE_REPORT)
set (BOINC_AUTODOCK_VINA_LINK_LIBRARIES
config
calculate
unofficial::boinc::boinc
unofficial::boinc::boincapi
autodock-vina::autodock-vina::vina
autodock-vina::autodock-vina::vina_split
OpenSSL::SSL
OpenSSL::Crypto
Boost::boost
Boost::filesystem
Boost::log
Boost::math_tr1
Boost::program_options
Boost::random
Boost::serialization
Boost::thread
Boost::timer
magic_enum::magic_enum
jsoncons
jsoncons_helper
zip_helper
libzip::zip
)
if (UNIX AND NOT APPLE AND NOT VCPKG_TARGET_TRIPLET MATCHES "android" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(BOINC_AUTODOCK_VINA_LINK_LIBRARIES ${BOINC_AUTODOCK_VINA_LINK_LIBRARIES} stdc++fs)
endif()
target_link_libraries(boinc-autodock-vina
PRIVATE
config
calculate
unofficial::boinc::boinc
unofficial::boinc::boincapi
autodock-vina::autodock-vina::vina
autodock-vina::autodock-vina::vina_split
OpenSSL::SSL
OpenSSL::Crypto
Boost::boost
Boost::filesystem
Boost::log
Boost::math_tr1
Boost::program_options
Boost::random
Boost::serialization
Boost::thread
Boost::timer
magic_enum::magic_enum
jsoncons
jsoncons_helper
zip_helper
libzip::zip
${BOINC_AUTODOCK_VINA_LINK_LIBRARIES}
)
endif()

Expand All @@ -219,6 +225,10 @@ set (UNIT_TEST_LINK_LIBRARIES
libzip::zip
)

if (UNIX AND NOT APPLE AND NOT VCPKG_TARGET_TRIPLET MATCHES "android" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(UNIT_TEST_LINK_LIBRARIES ${UNIT_TEST_LINK_LIBRARIES} stdc++fs)
endif()

target_link_libraries(unit-tests
PRIVATE
${UNIT_TEST_LINK_LIBRARIES}
Expand Down
17 changes: 13 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def build_specific_init_params(CC, CXX, LD, CFLAGS, CXXFLAGS, LDFLAGS):

return specific_init_params

def build_linux_specific_init_params(arch):
def build_linux_specific_init_params(arch, code_analysis=False):
CC = None
CXX = None
LD = None
Expand All @@ -111,11 +111,17 @@ def build_linux_specific_init_params(arch):
LDFLAGS = None

if (arch == '64' or arch == '32'):
CC = ('gcc -m{arch}').format(arch=arch)
CXX = ('g++ -m{arch}').format(arch=arch)
if (code_analysis == True):
CC = ('gcc -m{arch}').format(arch=arch)
CXX = ('g++ -m{arch}').format(arch=arch)
else:
CC = ('clang-11 -m{arch}').format(arch=arch)
CXX = ('clang++-11 -m{arch}').format(arch=arch)
LD = ('lld-11 -m{arch}').format(arch=arch)
CFLAGS = ('-m{arch}').format(arch=arch)
CXXFLAGS = ('-m{arch}').format(arch=arch)
LDFLAGS =('-m{arch} -static-libstdc++ -static').format(arch=arch)

elif (arch == 'arm'):
CC = 'arm-linux-gnueabihf-gcc'
CXX = 'arm-linux-gnueabihf-g++'
Expand Down Expand Up @@ -275,6 +281,7 @@ def fix_path_for_android(arch, android_tc_path):
run_tests = True

coverage_report = False
code_ql = False

for a in sys.argv[1:]:
if a in apps:
Expand All @@ -286,6 +293,8 @@ def fix_path_for_android(arch, android_tc_path):
run_tests = False
elif (a == '-cr'):
coverage_report = True
elif (a == '-ql'):
code_ql = True
else:
p = a.split('=')
if (len(p) < 2):
Expand Down Expand Up @@ -366,7 +375,7 @@ def fix_path_for_android(arch, android_tc_path):
coverage_report_param = ''

if (get_target_os_from_triplet(vcpkg_overlay_triplet) == 'linux'):
specific_init_params = build_linux_specific_init_params(arch)
specific_init_params = build_linux_specific_init_params(arch, coverage_report or code_ql)
if (get_arch_from_triplet(vcpkg_overlay_triplet) == '64'):
build_work_generator_param = '-DBUILD_WORK_GENERATOR=ON'

Expand Down

0 comments on commit 98cf70d

Please sign in to comment.