Skip to content

Commit

Permalink
Merge branch 'fix-linux-build'
Browse files Browse the repository at this point in the history
  • Loading branch information
coldfix committed Dec 27, 2024
2 parents 8a4208f + 61f6645 commit 32f0b0c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .github/build/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM quay.io/pypa/$BASE

ARG UID=1000
ARG GID=$UID
ENV PATH="/opt/python/cp36-cp36m/bin:${PATH}"
# Highest version supported by manylinux1:
ENV PATH="/opt/python/cp39-cp39/bin:${PATH}"

RUN groupadd -o -g $GID runner && \
useradd -o -u $UID -g $GID runner && \
Expand Down
2 changes: 1 addition & 1 deletion .github/build/linux/cpymad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
set -ex

# Build variables:
export MADXDIR=$(readlink -nf "$1")
export MADXDIR="$(readlink -nf "${1:-/mnt/dist/MAD-X}")"
export X11=0 BLAS=0 LAPACK=0
export CFLAGS="-fno-lto"
export LDFLAGS="-fno-lto"
Expand Down
19 changes: 10 additions & 9 deletions .github/build/linux/madx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@
#
# Arguments:
# <SRCDIR>: root directory of MAD-X sources
#
# Outputs:
# <SRCDIR>/build: cmake build directory
# <SRCDIR>/dist: MAD-X installation directory (binary distribution)
# <BUILDDIR>: cmake build directory
# <INSTALLDIR>: MAD-X installation directory (binary distribution)
set -ex

cd "$1"
mkdir -p build
cd build
SRCDIR="$(readlink -nm "${1:-/mnt/src/MAD-X}")"
BUILDDIR="$(readlink -nm "${2:-/mnt/build/MAD-X}")"
INSTALLDIR="$(readlink -nm "${3:-/mnt/dist/MAD-X}")"

mkdir -p "$BUILDDIR"
cd "$BUILDDIR"

if [[ ! -f CMakeCache.txt ]]; then
cmake .. \
cmake "$SRCDIR" \
-DBUILD_SHARED_LIBS=OFF \
-DMADX_STATIC=ON \
-DCMAKE_INSTALL_PREFIX=../dist \
-DCMAKE_INSTALL_PREFIX="$INSTALLDIR" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-fvisibility=hidden" \
-DCMAKE_CXX_FLAGS="-fvisibility=hidden" \
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
-w /mnt \
-v `pwd`:/mnt \
builder \
.github/build/linux/madx.sh src/MAD-X
.github/build/linux/madx.sh src/MAD-X build/MAD-X dist/MAD-X
shell: bash

- name: Build cpymad wheels
Expand All @@ -74,14 +74,16 @@ jobs:
-w /mnt \
-v `pwd`:/mnt \
builder \
.github/build/linux/cpymad.sh src/MAD-X/dist
.github/build/linux/cpymad.sh dist/MAD-X
shell: bash

- name: Upload cpymad wheels
uses: actions/upload-artifact@v4
with:
name: dist-linux-${{ matrix.base }}
path: dist
path: |
dist/
!dist/MAD-X
build_windows:
name: "Build: Windows"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ optional-dependencies.dev = [
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >= 61.0",
"setuptools[core] >= 61.0",
"cython>=3.1.0a1 ; python_version >= '3.13'", # Cython3.1 needed for free-threaded python
"cython<3 ; python_version < '3.8'", # Cython3.1 dropped support for python<3.8
"cython ; python_version >= '3.8' and python_version < '3.13'", # no particular requirements
Expand Down

0 comments on commit 32f0b0c

Please sign in to comment.