Skip to content

Commit

Permalink
python from brew
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Feb 21, 2024
1 parent 65c8861 commit dbd78b0
Showing 1 changed file with 84 additions and 82 deletions.
166 changes: 84 additions & 82 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ env:
CC: clang
CXX: clang++

DEPENDENCIES: cmake ccache [email protected]

PYTHON_VERSION: 3.10.7
XERCESC_VERSION: 3.2.2
ROOT_VERSION: 6.30.02
Expand All @@ -27,48 +29,48 @@ env:
EDM4HEP_VERSION: v00-10-01

jobs:
build_python:
runs-on: macos-13
steps:
- name: Install dependencies
run: |
brew install ccache openssl@3
brew unlink gettext
- name: Cache build
uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
key: builddir-${{ runner.os }}-${{ github.job }}-${{ env.PYTHON_VERSION }}-r1
restore-keys: |
builddir-${{ runner.os }}-${{ github.job }}-${{ env.PYTHON_VERSION }}-r1
builddir-${{ runner.os }}-${{ github.job }}-
- name: Build
run: >
curl -SL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | tar -xzC .
&& mv Python-* ${SRC_DIR} && cd ${SRC_DIR}
&& export CC="ccache $CC"
&& mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
&& ${SRC_DIR}/configure
--prefix=${DEPENDENCY_DIR}
--enable-optimizations
--with-ensurepip=install
--with-openssl=$(brew --prefix openssl)
&& make -j2
&& sudo make install
&& tar czf ../python.tar.gz -C ${DEPENDENCY_DIR} .
- uses: actions/upload-artifact@v3
with:
name: python
path: python.tar.gz
# build_python:
# runs-on: macos-13
# steps:
# - name: Install dependencies
# run: |
# brew install ${DEPENDENCIES} openssl@3
# brew unlink gettext

# - name: Cache build
# uses: actions/cache@v3
# with:
# path: ${{ env.BUILD_DIR }}
# key: builddir-${{ runner.os }}-${{ github.job }}-${{ env.PYTHON_VERSION }}-r1
# restore-keys: |
# builddir-${{ runner.os }}-${{ github.job }}-${{ env.PYTHON_VERSION }}-r1
# builddir-${{ runner.os }}-${{ github.job }}-

# - name: Build
# run: >
# curl -SL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | tar -xzC .
# && mv Python-* ${SRC_DIR} && cd ${SRC_DIR}
# && export CC="ccache $CC"
# && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
# && ${SRC_DIR}/configure
# --prefix=${DEPENDENCY_DIR}
# --enable-optimizations
# --with-ensurepip=install
# --with-openssl=$(brew --prefix openssl)
# && make -j2
# && sudo make install
# && tar czf ../python.tar.gz -C ${DEPENDENCY_DIR} .

# - uses: actions/upload-artifact@v3
# with:
# name: python
# path: python.tar.gz

build_boost:
runs-on: macos-13
steps:
- name: Install dependencies
run: brew install ccache
run: brew install ${DEPENDENCIES}

- name: Cache build
uses: actions/cache@v3
Expand Down Expand Up @@ -113,7 +115,7 @@ jobs:
runs-on: macos-13
steps:
- name: Install dependencies
run: brew install cmake ccache
run: brew install ${DEPENDENCIES}

- name: Cache build
uses: actions/cache@v3
Expand Down Expand Up @@ -145,11 +147,11 @@ jobs:
build_root:
runs-on: macos-13
needs:
- build_python
# - build_python
- build_tbb
steps:
- name: Install dependencies
run: brew install cmake ccache openssl@3
run: brew install ${DEPENDENCIES} openssl@3

- name: Cache build
uses: actions/cache@v3
Expand All @@ -160,17 +162,17 @@ jobs:
ccache-${{ runner.os }}-${{ github.job }}-${{ env.ROOT_VERSION }}-r1
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v3
with:
name: python
path: .
# - uses: actions/download-artifact@v3
# with:
# name: python
# path: .
- uses: actions/download-artifact@v3
with:
name: tbb
path: .

- run: sudo mkdir -p ${DEPENDENCY_DIR}
- run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
# - run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf tbb.tar.gz -C ${DEPENDENCY_DIR}

- name: Build
Expand Down Expand Up @@ -207,7 +209,7 @@ jobs:
- build_xercesc
steps:
- name: Install dependencies
run: brew install cmake ccache
run: brew install ${DEPENDENCIES}

- name: Cache build
uses: actions/cache@v3
Expand Down Expand Up @@ -250,11 +252,11 @@ jobs:
build_podio:
runs-on: macos-13
needs:
- build_python
# - build_python
- build_root
steps:
- name: Install dependencies
run: brew install cmake ccache openssl@3
run: brew install ${DEPENDENCIES} openssl@3

- name: Cache build
uses: actions/cache@v3
Expand All @@ -265,17 +267,17 @@ jobs:
ccache-${{ runner.os }}-${{ github.job }}-${{ env.PODIO_VERSION }}
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v3
with:
name: python
path: .
# - uses: actions/download-artifact@v3
# with:
# name: python
# path: .
- uses: actions/download-artifact@v3
with:
name: root
path: .

- run: sudo mkdir -p ${DEPENDENCY_DIR}
- run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
# - run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf root.tar.gz -C ${DEPENDENCY_DIR}

- name: Install Python dependencies
Expand Down Expand Up @@ -306,12 +308,12 @@ jobs:
build_edm4hep:
runs-on: macos-13
needs:
- build_python
# - build_python
- build_root
- build_podio
steps:
- name: Install dependencies
run: brew install cmake ccache openssl@3
run: brew install ${DEPENDENCIES} openssl@3

- name: Cache build
uses: actions/cache@v3
Expand All @@ -322,10 +324,10 @@ jobs:
ccache-${{ runner.os }}-${{ github.job }}-${{ env.EDM4HEP_VERSION }}
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v3
with:
name: python
path: .
# - uses: actions/download-artifact@v3
# with:
# name: python
# path: .
- uses: actions/download-artifact@v3
with:
name: root
Expand All @@ -336,7 +338,7 @@ jobs:
path: .

- run: sudo mkdir -p ${DEPENDENCY_DIR}
- run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
# - run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf root.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf podio.tar.gz -C ${DEPENDENCY_DIR}

Expand Down Expand Up @@ -369,7 +371,7 @@ jobs:
build_dd4hep:
runs-on: macos-13
needs:
- build_python
# - build_python
- build_boost
- build_tbb
- build_xercesc
Expand All @@ -380,7 +382,7 @@ jobs:
steps:
- name: Install dependencies
run: |
brew install cmake ccache openssl@3
brew install ${DEPENDENCIES} openssl@3
brew unlink gettext
- name: Cache build
Expand All @@ -392,10 +394,10 @@ jobs:
ccache-${{ runner.os }}-${{ github.job }}-${{ env.DD4HEP_VERSION }}-r1
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v3
with:
name: python
path: .
# - uses: actions/download-artifact@v3
# with:
# name: python
# path: .
- uses: actions/download-artifact@v3
with:
name: boost
Expand Down Expand Up @@ -426,7 +428,7 @@ jobs:
path: .

- run: sudo mkdir -p ${DEPENDENCY_DIR}
- run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
# - run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf boost.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf xercesc.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf tbb.tar.gz -C ${DEPENDENCY_DIR}
Expand Down Expand Up @@ -510,7 +512,7 @@ jobs:
build_pythia8:
runs-on: macos-13
needs:
- build_python
# - build_python
steps:
- name: Install dependencies
run: brew install ccache
Expand All @@ -524,22 +526,22 @@ jobs:
ccache-${{ runner.os }}-${{ github.job }}-${{ env.PYTHIA8_VERSION }}
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v3
with:
name: python
path: .
# - uses: actions/download-artifact@v3
# with:
# name: python
# path: .

- run: sudo mkdir -p ${DEPENDENCY_DIR}
- run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
# - run: sudo mkdir -p ${DEPENDENCY_DIR}
# - run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}

- run: ls -al ${DEPENDENCY_DIR}/include/python3.10
# - run: ls -al ${DEPENDENCY_DIR}/include/python3.10

- name: Build
run: >
curl -SL https://pythia.org/download/pythia8${PYTHIA8_VERSION:0:1}/pythia8${PYTHIA8_VERSION}.tgz | tar -xzC .
&& mv pythia8* ${SRC_DIR}
&& cd ${SRC_DIR}
&& CC="ccache $CC" CXX="ccache $CXX" ./configure --prefix=${INSTALL_DIR} --with-python-include=${DEPENDENCY_DIR}/include/python3.10
&& CC="ccache $CC" CXX="ccache $CXX" ./configure --prefix=${INSTALL_DIR}
&& make -j2
&& make install
&& tar czf ../pythia8.tar.gz -C ${INSTALL_DIR} .
Expand All @@ -552,7 +554,7 @@ jobs:
make_tarball:
runs-on: ubuntu-latest # we don't need macOS here
needs:
- build_python
# - build_python
- build_tbb
- build_xercesc
- build_root
Expand All @@ -563,10 +565,10 @@ jobs:
- build_edm4hep
- build_dd4hep
steps:
- uses: actions/download-artifact@v3
with:
name: python
path: .
# - uses: actions/download-artifact@v3
# with:
# name: python
# path: .
- uses: actions/download-artifact@v3
with:
name: boost
Expand Down Expand Up @@ -609,7 +611,7 @@ jobs:
path: .

- run: sudo mkdir -p ${DEPENDENCY_DIR}
- run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
# - run: sudo tar xf python.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf tbb.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf boost.tar.gz -C ${DEPENDENCY_DIR}
- run: sudo tar xf xercesc.tar.gz -C ${DEPENDENCY_DIR}
Expand Down

0 comments on commit dbd78b0

Please sign in to comment.