Skip to content

Commit

Permalink
Better parametrization and defaults for madx build script
Browse files Browse the repository at this point in the history
  • Loading branch information
coldfix committed Dec 15, 2024
1 parent b7c6615 commit 1fd2658
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
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 MADXDIRDIR="$(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 @@ -64,7 +64,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 @@ -73,14 +73,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

0 comments on commit 1fd2658

Please sign in to comment.