Skip to content

Commit 491aab0

Browse files
authored
Merge pull request #155 from OpenMS/fix_git_bullshit
Fix git bullshit
2 parents 939466d + 5e72ce3 commit 491aab0

7 files changed

Lines changed: 106 additions & 24 deletions

File tree

.github/workflows/deploy-manylinux-docker.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ on:
99

1010
jobs:
1111
Deploy:
12-
runs-on: ubuntu-latest
12+
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'ubuntu-22.04-arm' }}
13+
strategy:
14+
matrix:
15+
arch: [amd64, arm64]
1316
steps:
1417
- name: Extract branch name
1518
shell: bash
@@ -39,16 +42,24 @@ jobs:
3942
username: ${{ github.actor }}
4043
password: ${{ secrets.GITHUB_TOKEN }}
4144
- name: Checkout to make context with dockerfiles available
42-
uses: actions/checkout@v3
43-
- name: Build and Push Docker Image
45+
uses: actions/checkout@v4
46+
- name: Set architecture-specific variables
47+
run: |
48+
if [[ "${{ matrix.arch }}" == "amd64" ]]; then
49+
echo "dockerfile=dockerfiles/pyopenms/manylinux/Dockerfile" >> $GITHUB_ENV
50+
echo "platform_tag=x86_64" >> $GITHUB_ENV
51+
else
52+
echo "dockerfile=dockerfiles/pyopenms/manylinux/ARM64_Dockerfile" >> $GITHUB_ENV
53+
echo "platform_tag=arm64" >> $GITHUB_ENV
54+
fi
55+
- name: Build and Push Docker Image (${{ matrix.arch }})
4456
uses: docker/build-push-action@v3
4557
with:
46-
push: true # Will only build if this is not here
47-
file: dockerfiles/pyopenms/manylinux/Dockerfile
58+
push: true
59+
file: ${{ env.dockerfile }}
4860
context: .
4961
build-args: |
5062
OPENMS_BRANCH=${{ steps.extract_branch.outputs.branch }}
5163
OPENMS_VERSION=${{ steps.tag_name.outputs.tag }}
5264
tags: |
53-
ghcr.io/openms/contrib_manylinux_2_34:${{ steps.tag_name.outputs.tag }}
54-
65+
ghcr.io/${{ steps.downcase_repo.outputs.repo }}/contrib_manylinux_2_34:${{ steps.tag_name.outputs.tag }}-${{ env.platform_tag }}

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,17 @@ jobs:
4242
path: contrib
4343

4444
- name: Setup cmake
45+
if: matrix.os != 'ubuntu-22.04-arm'
4546
uses: jwlawson/actions-setup-cmake@v2
4647
with:
4748
cmake-version: '3.29.x'
4849

50+
- name: Install CMake (Ubuntu arm64)
51+
if: matrix.os == 'ubuntu-22.04-arm'
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y cmake
55+
4956
- name: Install prerequisites
5057
shell: bash
5158
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
build
2+
.vscode/settings.json

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,12 @@ if (MSVC)
337337
set(WIN_PLATFORM_ARG "Win32")
338338
set(ARCHITECTURE_OPTION_CMAKE "-A" "Win32")
339339
else()
340-
set(BOOST_ARG "address-model=64")
340+
# Only set address-model for x86_64, not for ARM64
341+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
342+
set(BOOST_ARG "address-model=64")
343+
else()
344+
set(BOOST_ARG "")
345+
endif()
341346
set(WIN_PLATFORM_ARG "x64")
342347
# Fix bug #95 (compile with MSVS 2015)
343348
if (NOT CMAKE_GENERATOR MATCHES ".*Win64.*")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM quay.io/pypa/manylinux_2_34_aarch64
2+
3+
# Defaults, can be overwritten from outside
4+
ARG OPENMS_BRANCH="master"
5+
ARG OPENMS_VERSION="latest"
6+
7+
# Make source files from context available in docker
8+
COPY . /contrib
9+
10+
RUN yum install -y wget
11+
RUN yum install -y xz qt6-qtbase-devel qt6-qtsvg-devel
12+
RUN yum install -y libtool cmake3
13+
14+
# Build contrib for the current checked out branch
15+
# During cleanup: removes archives
16+
RUN mkdir contrib-build
17+
RUN ls -l
18+
WORKDIR /contrib-build
19+
RUN ls -l
20+
RUN cmake -DBUILD_TYPE=ALL ../contrib && rm -rf archives src
21+
22+
WORKDIR /
23+
24+
# Metadata
25+
LABEL base.image="manylinux_2_34_aarch64_main"
26+
LABEL version="1.0"
27+
LABEL software="OpenMS (dependencies for manylinux_2_34)"
28+
LABEL software.version="$OPENMS_VERSION"
29+
LABEL description="C++ libraries and tools for MS/MS data analysis"
30+
LABEL website="http://www.openms.org/"
31+
LABEL documentation="http://www.openms.org/"
32+
LABEL license="http://www.openms.org/"
33+
LABEL tags="Proteomics"

libraries.cmake/boost.cmake

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ MACRO( OPENMS_CONTRIB_BUILD_BOOST)
9898
# we need to know the compiler version for proper formating boost user-config.jam
9999
determine_compiler_version()
100100

101+
# Set architecture based on CMake's processor detection
102+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|i386|i686")
103+
set(BOOST_ARCHITECTURE "architecture=x86")
104+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64")
105+
set(BOOST_ARCHITECTURE "architecture=arm")
106+
else()
107+
message(WARNING "Unknown architecture '${CMAKE_SYSTEM_PROCESSOR}'. Letting Boost auto-detect architecture. This may cause build issues.")
108+
set(BOOST_ARCHITECTURE "")
109+
endif()
110+
101111
# use proper toolchain (random guesses. There is not proper documentation)
102112
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
103113
# Modern Clang chokes on boost 1.78 unless we pass this (https://github.com/boostorg/mpl/issues/74)
@@ -165,11 +175,11 @@ MACRO( OPENMS_CONTRIB_BUILD_BOOST)
165175
set(BOOST_DEBUG_FLAGS "--debug-configuration -d+2")
166176
endif()
167177
# boost cmd (use b2 since sometimes the copying/symlinking from b2 to bjam fails)
168-
set (BOOST_CMD "./b2 ${BOOST_DEBUG_FLAGS} architecture=x86 toolset=${_boost_toolchain} -j ${NUMBER_OF_JOBS} --disable-icu link=${BOOST_BUILD_TYPE} cxxflags=-fPIC ${BOOST_EXTRA_CXXFLAGS} ${OSX_LIB_FLAG} ${OSX_DEPLOYMENT_FLAG} ${BOOST_LINKER_FLAGS} install --build-type=complete --layout=tagged --threading=single,multi")
178+
set (BOOST_CMD "./b2 ${BOOST_DEBUG_FLAGS} ${BOOST_ARCHITECTURE} toolset=${_boost_toolchain} -j ${NUMBER_OF_JOBS} --disable-icu link=${BOOST_BUILD_TYPE} cxxflags=-fPIC ${BOOST_EXTRA_CXXFLAGS} ${OSX_LIB_FLAG} ${OSX_DEPLOYMENT_FLAG} ${BOOST_LINKER_FLAGS} install --build-type=complete --layout=tagged --threading=single,multi")
169179

170180
# boost install
171181
message(STATUS "Installing Boost libraries (${BOOST_CMD}) ...")
172-
execute_process(COMMAND ./b2 ${BOOST_DEBUG_FLAGS} architecture=x86 toolset=${_boost_toolchain}
182+
execute_process(COMMAND ./b2 ${BOOST_DEBUG_FLAGS} ${BOOST_ARCHITECTURE} toolset=${_boost_toolchain}
173183
-j ${NUMBER_OF_JOBS}
174184
--disable-icu
175185
-s NO_LZMA=1

libraries.cmake/coinor.cmake

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,22 +134,37 @@ MACRO( OPENMS_CONTRIB_BUILD_COINOR)
134134
set(COINOR_EXTRA_FLAGS "ADD_FFLAGS='${OSX_DEPLOYMENT_FLAG}' ADD_CFLAGS='${OSX_DEPLOYMENT_FLAG} ${OSX_SYSROOT_FLAG}' ADD_CXXFLAGS='${OSX_LIB_FLAG} ${OSX_DEPLOYMENT_FLAG} ${OSX_SYSROOT_FLAG} -fPIC' --disable-dependency-tracking")
135135
else()
136136
set(COINOR_EXTRA_FLAGS "ADD_CXXFLAGS='-fPIC'")
137-
endif()
138-
139-
# check if we prefer shared or static libs
140-
if (BUILD_SHARED_LIBRARIES)
141-
set(STATIC_BUILD "--enable-static=no")
142-
set(SHARED_BUILD "--enable-shared=yes")
143-
else()
144-
set(STATIC_BUILD "--enable-static=yes")
145-
set(SHARED_BUILD "--enable-shared=no")
146-
endif()
147-
148-
message( STATUS "Configure COIN-OR library (./configure -C --prefix=${PROJECT_BINARY_DIR} ${STATIC_BUILD} ${SHARED_BUILD} --with-lapack=no --with-blas=no ${COINOR_EXTRA_FLAGS} CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER})")
137+
endif()
138+
139+
# Determine build triplet for configure (only needed for Linux with old config.guess)
140+
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
141+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64")
142+
set(BUILD_TRIPLET "--build=arm-linux-gnu")
143+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
144+
set(BUILD_TRIPLET "--build=x86_64-linux-gnu")
145+
else()
146+
set(BUILD_TRIPLET "")
147+
endif()
148+
else()
149+
# macOS can auto-detect, no need to specify build triplet
150+
set(BUILD_TRIPLET "")
151+
endif()
152+
153+
# check if we prefer shared or static libs
154+
if (BUILD_SHARED_LIBRARIES)
155+
set(STATIC_BUILD "--enable-static=no")
156+
set(SHARED_BUILD "--enable-shared=yes")
157+
else()
158+
set(STATIC_BUILD "--enable-static=yes")
159+
set(SHARED_BUILD "--enable-shared=no")
160+
endif()
161+
162+
message( STATUS "Configure COIN-OR library (./configure -C --prefix=${PROJECT_BINARY_DIR} ${BUILD_TRIPLET} ${STATIC_BUILD} ${SHARED_BUILD} --with-lapack=no --with-blas=no ${COINOR_EXTRA_FLAGS} CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER})")
149163
exec_program("./configure" "${COINOR_DIR}"
150164
ARGS
151165
-C
152166
--prefix=${PROJECT_BINARY_DIR}
167+
${BUILD_TRIPLET}
153168
## Following two lines can be combined with prefix
154169
## But maybe they avoid building the doc into share (wanted?)
155170
#--libdir=${CONTRIB_BIN_LIB_DIR}
@@ -169,10 +184,10 @@ MACRO( OPENMS_CONTRIB_BUILD_COINOR)
169184
file(APPEND ${LOGFILE} ${COINOR_CONFIGURE_OUT})
170185

171186
if( NOT COINOR_CONFIGURE_SUCCESS EQUAL 0)
172-
message( STATUS "Configure COIN-OR library (./configure -C --prefix=${PROJECT_BINARY_DIR} ${STATIC_BUILD} ${SHARED_BUILD} --with-lapack=no --with-blas=no ${COINOR_EXTRA_FLAGS} CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}) .. failed")
187+
message( STATUS "Configure COIN-OR library (./configure -C --prefix=${PROJECT_BINARY_DIR} ${BUILD_TRIPLET} ${STATIC_BUILD} ${SHARED_BUILD} --with-lapack=no --with-blas=no ${COINOR_EXTRA_FLAGS} CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}) .. failed")
173188
message( FATAL_ERROR ${COINOR_CONFIGURE_OUT})
174189
else()
175-
message( STATUS "Configure COIN-OR library (./configure -C --prefix=${PROJECT_BINARY_DIR} ${STATIC_BUILD} ${SHARED_BUILD} --with-lapack=no --with-blas=no ${COINOR_EXTRA_FLAGS} CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}) .. done")
190+
message( STATUS "Configure COIN-OR library (./configure -C --prefix=${PROJECT_BINARY_DIR} ${BUILD_TRIPLET} ${STATIC_BUILD} ${SHARED_BUILD} --with-lapack=no --with-blas=no ${COINOR_EXTRA_FLAGS} CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}) .. done")
176191
endif()
177192

178193
## make install

0 commit comments

Comments
 (0)