Skip to content

Commit b8c1eee

Browse files
authored
2025 updates (#619)
* 2025 updates * Update ci.yml
1 parent d13d6a5 commit b8c1eee

418 files changed

Lines changed: 72300 additions & 561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM quay.io/pypa/manylinux2014_aarch64
2+
COPY entrypoint.sh /entrypoint.sh
3+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: manylinux build (aarch64)
2+
description: Builds Codon on manylinux (aarch64)
3+
runs:
4+
using: docker
5+
image: Dockerfile

.github/actions/build-manylinux/entrypoint.sh renamed to .github/actions/build-manylinux-aarch64/entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ set -e
44
# setup
55
cd /github/workspace
66
yum -y update
7-
yum -y install python3 python3-devel
7+
yum -y install python3 python3-devel gcc-gfortran
88

99
# env
1010
export PYTHONPATH=$(pwd)/test/python
1111
export CODON_PYTHON=$(python3 test/python/find-python-library.py)
12-
python3 -m pip install -Iv pip==21.3.1
13-
python3 -m pip install numpy
12+
python3 -m pip install -Iv pip==21.3.1 numpy==1.17.5
1413

1514
# deps
1615
if [ ! -d ./llvm ]; then
@@ -22,6 +21,7 @@ mkdir build
2221
export CC="$(pwd)/llvm/bin/clang"
2322
export CXX="$(pwd)/llvm/bin/clang++"
2423
export LLVM_DIR=$(llvm/bin/llvm-config --cmakedir)
24+
export CODON_SYSTEM_LIBRARIES=/usr/lib64
2525
(cd build && cmake .. -DCMAKE_BUILD_TYPE=Release \
2626
-DCMAKE_C_COMPILER=${CC} \
2727
-DCMAKE_CXX_COMPILER=${CXX})
@@ -44,6 +44,7 @@ build/codon_test
4444

4545
# package
4646
export CODON_BUILD_ARCHIVE=codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz
47-
rm -rf codon-deploy/lib/libfmt.a codon-deploy/lib/pkgconfig codon-deploy/lib/cmake codon-deploy/python/codon.egg-info codon-deploy/python/dist codon-deploy/python/build
47+
rm -rf codon-deploy/lib/libfmt.a codon-deploy/lib/pkgconfig codon-deploy/lib/cmake \
48+
codon-deploy/python/codon.egg-info codon-deploy/python/dist codon-deploy/python/build
4849
tar -czf ${CODON_BUILD_ARCHIVE} codon-deploy
4950
du -sh codon-deploy
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: manylinux build (x86_64)
2+
description: Builds Codon on manylinux (x86_64)
3+
runs:
4+
using: docker
5+
image: Dockerfile
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/sh -l
2+
set -e
3+
4+
# setup
5+
cd /github/workspace
6+
yum -y update
7+
yum -y install python3 python3-devel gcc-gfortran
8+
9+
# env
10+
export PYTHONPATH=$(pwd)/test/python
11+
export CODON_PYTHON=$(python3 test/python/find-python-library.py)
12+
python3 -m pip install -Iv pip==21.3.1 numpy==1.17.5
13+
14+
# deps
15+
if [ ! -d ./llvm ]; then
16+
/bin/bash scripts/deps.sh 2;
17+
fi
18+
19+
# build
20+
mkdir build
21+
export CC="$(pwd)/llvm/bin/clang"
22+
export CXX="$(pwd)/llvm/bin/clang++"
23+
export LLVM_DIR=$(llvm/bin/llvm-config --cmakedir)
24+
export CODON_SYSTEM_LIBRARIES=/usr/lib64
25+
(cd build && cmake .. -DCMAKE_BUILD_TYPE=Release \
26+
-DCMAKE_C_COMPILER=${CC} \
27+
-DCMAKE_CXX_COMPILER=${CXX})
28+
cmake --build build --config Release -- VERBOSE=1
29+
cmake --install build --prefix=codon-deploy
30+
31+
# build cython
32+
export PATH=$PATH:$(pwd)/llvm/bin
33+
python3 -m pip install cython wheel astunparse
34+
(cd codon-deploy/python && python3 setup.py sdist)
35+
CODON_DIR=$(pwd)/codon-deploy python3 -m pip install -v codon-deploy/python/dist/*.gz
36+
python3 test/python/cython_jit.py
37+
38+
# test
39+
export LD_LIBRARY_PATH=$(pwd)/build:$LD_LIBRARY_PATH
40+
export PYTHONPATH=$(pwd):$PYTHONPATH
41+
export CODON_PATH=$(pwd)/stdlib
42+
ln -s build/libcodonrt.so .
43+
build/codon_test
44+
45+
# package
46+
export CODON_BUILD_ARCHIVE=codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz
47+
rm -rf codon-deploy/lib/libfmt.a codon-deploy/lib/pkgconfig codon-deploy/lib/cmake \
48+
codon-deploy/python/codon.egg-info codon-deploy/python/dist codon-deploy/python/build
49+
tar -czf ${CODON_BUILD_ARCHIVE} codon-deploy
50+
du -sh codon-deploy

.github/actions/build-manylinux/action.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ jobs:
2626
uses: ncipollo/release-action@v1
2727

2828
manylinux:
29-
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
arch:
32+
- x86_64
33+
# - aarch64
34+
runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-arm-latest' || 'ubuntu-latest' }}
3035
name: Codon CI (manylinux)
3136
needs: create_release
3237
permissions:
@@ -39,10 +44,15 @@ jobs:
3944
uses: actions/cache@v4
4045
with:
4146
path: llvm
42-
key: manylinux-llvm
47+
key: manylinux-${{ matrix.arch }}-llvm
48+
49+
- name: Main x86_64
50+
if: matrix.arch == 'x86_64'
51+
uses: ./.github/actions/build-manylinux-x86_64
4352

44-
- name: Main
45-
uses: ./.github/actions/build-manylinux
53+
- name: Main aarch64
54+
if: matrix.arch == 'aarch64'
55+
uses: ./.github/actions/build-manylinux-aarch64
4656

4757
- name: Upload Release Asset
4858
if: contains(github.ref, 'tags/v')
@@ -66,7 +76,8 @@ jobs:
6676
matrix:
6777
os:
6878
- ubuntu-latest
69-
- macos-12
79+
- macos-latest
80+
# - ubuntu-arm-latest
7081
runs-on: ${{ matrix.os }}
7182
name: Codon CI
7283
needs: create_release
@@ -79,23 +90,49 @@ jobs:
7990
with:
8091
python-version: '3.9'
8192

82-
- name: Linux Setup
83-
if: startsWith(matrix.os, 'ubuntu')
93+
- name: x86_64 Linux Setup
94+
if: startsWith(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-arm-latest'
8495
run: |
96+
sudo apt update
97+
sudo apt install -y gfortran libgfortran5 lsb-release wget software-properties-common gnupg
98+
wget https://apt.llvm.org/llvm.sh
99+
sudo chmod +x llvm.sh
100+
sudo ./llvm.sh 17
85101
echo "LIBEXT=so" >> $GITHUB_ENV
86102
echo "OS_NAME=linux" >> $GITHUB_ENV
103+
echo "CODON_SYSTEM_LIBRARIES=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
104+
echo "CC=clang-17" >> $GITHUB_ENV
105+
echo "CXX=clang++-17" >> $GITHUB_ENV
106+
107+
- name: Arm Linux Setup
108+
if: matrix.os == 'ubuntu-arm-latest'
109+
run: |
110+
sudo apt update
111+
sudo apt install -y gfortran libgfortran5 lsb-release wget software-properties-common gnupg
112+
wget https://apt.llvm.org/llvm.sh
113+
sudo chmod +x llvm.sh
114+
sudo ./llvm.sh 17
115+
echo "LIBEXT=so" >> $GITHUB_ENV
116+
echo "OS_NAME=linux" >> $GITHUB_ENV
117+
echo "CODON_SYSTEM_LIBRARIES=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
118+
echo "CC=clang-17" >> $GITHUB_ENV
119+
echo "CXX=clang++-17" >> $GITHUB_ENV
87120
88121
- name: macOS Setup
89122
if: startsWith(matrix.os, 'macos')
90123
run: |
91-
brew install automake
92124
echo "LIBEXT=dylib" >> $GITHUB_ENV
93125
echo "OS_NAME=osx" >> $GITHUB_ENV
126+
echo "CODON_SYSTEM_LIBRARIES=$(brew --prefix gcc)/lib/gcc/current" >> $GITHUB_ENV
127+
echo "CC=clang" >> $GITHUB_ENV
128+
echo "CXX=clang++" >> $GITHUB_ENV
129+
echo "FC=gfortran-12" >> $GITHUB_ENV
94130
95131
- name: Set up Python
96132
run: |
97133
python -m pip install --upgrade pip setuptools wheel
98-
python -m pip install numpy cython wheel astunparse
134+
python -m pip install cython wheel astunparse
135+
python -m pip install --force-reinstall -v "numpy==1.26.4"
99136
which python
100137
which pip
101138
echo "CODON_PYTHON=$(python test/python/find-python-library.py)" >> $GITHUB_ENV
@@ -105,14 +142,11 @@ jobs:
105142
uses: actions/cache@v4
106143
with:
107144
path: llvm
108-
key: ${{ runner.os }}-llvm
145+
key: ${{ runner.os }}-${{ matrix.os }}-llvm
109146

110147
- name: Build Dependencies
111148
if: steps.cache-deps.outputs.cache-hit != 'true'
112149
run: ./scripts/deps.sh 2
113-
env:
114-
CC: clang
115-
CXX: clang++
116150

117151
- name: Build
118152
run: |
@@ -123,18 +157,12 @@ jobs:
123157
-DCMAKE_CXX_COMPILER=${CXX})
124158
cmake --build build --config Release -- VERBOSE=1
125159
cmake --install build --prefix=codon-deploy
126-
env:
127-
CC: clang
128-
CXX: clang++
129160
130161
- name: Build Cython
131162
run: |
132163
(cd codon-deploy/python && python3 setup.py sdist)
133164
CODON_DIR=$(pwd)/codon-deploy python -m pip install -v codon-deploy/python/dist/*.gz
134-
python test/python/cython_jit.py
135-
env:
136-
CC: clang
137-
CXX: clang++
165+
CODON_PATH=$(pwd)/codon-deploy/lib/codon/stdlib python test/python/cython_jit.py
138166
139167
- name: Test
140168
run: |
@@ -151,6 +179,11 @@ jobs:
151179
run: |
152180
echo "CODON_BUILD_ARCHIVE=codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz" >> $GITHUB_ENV
153181
182+
- name: Codesign (macOS)
183+
if: startsWith(matrix.os, 'macos')
184+
run: |
185+
codesign -f -s - codon-deploy/bin/codon codon-deploy/lib/codon/*.dylib
186+
154187
- name: Prepare Artifacts
155188
run: |
156189
cp -rf codon-deploy/python/dist .

0 commit comments

Comments
 (0)