Provide precompiled artifacts for future releases
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
using BinaryBuilder, Pkg
|
||||
|
||||
haskey(ENV, "BLAS_LAPACK_RELEASE") || error("The environment variable BLAS_LAPACK_RELEASE is not defined.")
|
||||
haskey(ENV, "BLAS_LAPACK_COMMIT") || error("The environment variable BLAS_LAPACK_COMMIT is not defined.")
|
||||
haskey(ENV, "BLAS_LAPACK_URL") || error("The environment variable BLAS_LAPACK_URL is not defined.")
|
||||
|
||||
name = "blas_lapack"
|
||||
version = VersionNumber(ENV["BLAS_LAPACK_RELEASE"])
|
||||
|
||||
# Collection of sources required to complete build
|
||||
sources = [
|
||||
GitSource(ENV["BLAS_LAPACK_URL"], ENV["BLAS_LAPACK_COMMIT"])
|
||||
]
|
||||
|
||||
# Bash recipe for building across all platforms
|
||||
script = raw"""
|
||||
cd ${WORKSPACE}/srcdir/lapack
|
||||
|
||||
# FortranCInterface_VERIFY fails on macOS, but it's not actually needed for the current build
|
||||
sed -i 's/FortranCInterface_VERIFY/# FortranCInterface_VERIFY/g' ./CBLAS/CMakeLists.txt
|
||||
sed -i 's/FortranCInterface_VERIFY/# FortranCInterface_VERIFY/g' ./LAPACKE/include/CMakeLists.txt
|
||||
|
||||
mkdir build && cd build
|
||||
cmake .. \
|
||||
-DCBLAS=ON \
|
||||
-DLAPACKE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX="$prefix" \
|
||||
-DCMAKE_FIND_ROOT_PATH="$prefix" \
|
||||
-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TARGET_TOOLCHAIN}" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DBUILD_INDEX64_EXT_API=OFF \
|
||||
-DTEST_FORTRAN_COMPILER=OFF \
|
||||
-DLAPACKE_WITH_TMG=OFF
|
||||
|
||||
make -j${nproc}
|
||||
make install
|
||||
|
||||
install_license $WORKSPACE/srcdir/lapack/LICENSE
|
||||
"""
|
||||
|
||||
# These are the platforms we will build for by default, unless further
|
||||
# platforms are passed in on the command line
|
||||
platforms = supported_platforms()
|
||||
platforms = expand_gfortran_versions(platforms)
|
||||
|
||||
# The products that we will ensure are always built
|
||||
products = [
|
||||
FileProduct("lib/libblas.a", :libblas_a),
|
||||
FileProduct("lib/libcblas.a", :libcblas_a),
|
||||
FileProduct("lib/liblapack.a", :liblapack_a),
|
||||
FileProduct("lib/liblapacke.a", :liblapacke_a),
|
||||
# LibraryProduct("libblas", :libblas),
|
||||
# LibraryProduct("libcblas", :libcblas),
|
||||
# LibraryProduct("liblapack", :liblapack),
|
||||
# LibraryProduct("liblapacke", :liblapacke),
|
||||
]
|
||||
|
||||
# Dependencies that must be installed before this package can be built
|
||||
dependencies = [
|
||||
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
|
||||
]
|
||||
|
||||
# Build the tarballs, and possibly a `build.jl` as well.
|
||||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6")
|
||||
@@ -0,0 +1,90 @@
|
||||
# Version
|
||||
haskey(ENV, "BLAS_LAPACK_RELEASE") || error("The environment variable BLAS_LAPACK_RELEASE is not defined.")
|
||||
version = VersionNumber(ENV["BLAS_LAPACK_RELEASE"])
|
||||
version2 = ENV["BLAS_LAPACK_RELEASE"]
|
||||
package = "blas_lapack"
|
||||
|
||||
platforms = [
|
||||
("aarch64-apple-darwin-libgfortran5" , "lib", "dylib"),
|
||||
# ("aarch64-linux-gnu-libgfortran3" , "lib", "so" ),
|
||||
# ("aarch64-linux-gnu-libgfortran4" , "lib", "so" ),
|
||||
("aarch64-linux-gnu-libgfortran5" , "lib", "so" ),
|
||||
# ("aarch64-linux-musl-libgfortran3" , "lib", "so" ),
|
||||
# ("aarch64-linux-musl-libgfortran4" , "lib", "so" ),
|
||||
# ("aarch64-linux-musl-libgfortran5" , "lib", "so" ),
|
||||
# ("powerpc64le-linux-gnu-libgfortran3" , "lib", "so" ),
|
||||
# ("powerpc64le-linux-gnu-libgfortran4" , "lib", "so" ),
|
||||
# ("powerpc64le-linux-gnu-libgfortran5" , "lib", "so" ),
|
||||
# ("x86_64-apple-darwin-libgfortran3" , "lib", "dylib"),
|
||||
# ("x86_64-apple-darwin-libgfortran4" , "lib", "dylib"),
|
||||
("x86_64-apple-darwin-libgfortran5" , "lib", "dylib"),
|
||||
# ("x86_64-linux-gnu-libgfortran3" , "lib", "so" ),
|
||||
# ("x86_64-linux-gnu-libgfortran4" , "lib", "so" ),
|
||||
("x86_64-linux-gnu-libgfortran5" , "lib", "so" ),
|
||||
# ("x86_64-linux-musl-libgfortran3" , "lib", "so" ),
|
||||
# ("x86_64-linux-musl-libgfortran4" , "lib", "so" ),
|
||||
# ("x86_64-linux-musl-libgfortran5" , "lib", "so" ),
|
||||
# ("x86_64-unknown-freebsd-libgfortran3", "lib", "so" ),
|
||||
# ("x86_64-unknown-freebsd-libgfortran4", "lib", "so" ),
|
||||
# ("x86_64-unknown-freebsd-libgfortran5", "lib", "so" ),
|
||||
# ("x86_64-w64-mingw32-libgfortran3" , "bin", "dll" ),
|
||||
# ("x86_64-w64-mingw32-libgfortran4" , "bin", "dll" ),
|
||||
("x86_64-w64-mingw32-libgfortran5" , "bin", "dll" ),
|
||||
]
|
||||
|
||||
|
||||
for (platform, libdir, ext) in platforms
|
||||
|
||||
tarball_name = "$package.v$version.$platform.tar.gz"
|
||||
|
||||
if isfile("products/$(tarball_name)")
|
||||
# Unzip the tarball generated by BinaryBuilder.jl
|
||||
isdir("products/$platform") && rm("products/$platform", recursive=true)
|
||||
mkdir("products/$platform")
|
||||
run(`tar -xzf products/$(tarball_name) -C products/$platform`)
|
||||
|
||||
if isfile("products/$platform/deps.tar.gz")
|
||||
# Unzip the tarball of the dependencies
|
||||
run(`tar -xzf products/$platform/deps.tar.gz -C products/$platform`)
|
||||
|
||||
# Copy the license of each dependency
|
||||
for folder in readdir("products/$platform/deps/licenses")
|
||||
cp("products/$platform/deps/licenses/$folder", "products/$platform/share/licenses/$folder")
|
||||
end
|
||||
rm("products/$platform/deps/licenses", recursive=true)
|
||||
|
||||
# Copy the shared library of each dependency
|
||||
for file in readdir("products/$platform/deps")
|
||||
cp("products/$platform/deps/$file", "products/$platform/$libdir/$file")
|
||||
end
|
||||
|
||||
# Remove the folder used to unzip the tarball of the dependencies
|
||||
rm("products/$platform/deps", recursive=true)
|
||||
rm("products/$platform/deps.tar.gz", recursive=true)
|
||||
end
|
||||
|
||||
# Create the archives *_binaries
|
||||
isfile("$(package)_binaries.$version2.$platform.tar.gz") && rm("$(package)_binaries.$version2.$platform.tar.gz")
|
||||
isfile("$(package)_binaries.$version2.$platform.zip") && rm("$(package)_binaries.$version2.$platform.zip")
|
||||
cd("products/$platform")
|
||||
|
||||
# Create a folder with the version number of the package
|
||||
mkdir("$(package)_binaries.$version2")
|
||||
for folder in ("include", "share", "lib")
|
||||
cp(folder, "$(package)_binaries.$version2/$folder")
|
||||
end
|
||||
|
||||
cd("$(package)_binaries.$version2")
|
||||
if ext == "dll"
|
||||
run(`zip -r --symlinks ../../../$(package)_binaries.$version2.$platform.zip include share lib`)
|
||||
else
|
||||
run(`tar -czf ../../../$(package)_binaries.$version2.$platform.tar.gz include share lib`)
|
||||
end
|
||||
cd("../../..")
|
||||
|
||||
# Remove the folder used to unzip the tarball generated by BinaryBuilder.jl
|
||||
rm("products/$platform", recursive=true)
|
||||
else
|
||||
@warn("The tarball for the platform $platform was not generated!")
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,239 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- 'v*' # Push events to matching v*, i.e. v1.0, v2023.11.15
|
||||
|
||||
jobs:
|
||||
build-linux-x64:
|
||||
name: blas / lapack -- Linux (x86_64) -- Release ${{ github.ref_name }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout lapack
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Julia
|
||||
uses: julia-actions/setup-julia@v2
|
||||
with:
|
||||
version: "1.7"
|
||||
arch: x64
|
||||
|
||||
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, BLAS_LAPACK_RELEASE, BLAS_LAPACK_COMMIT
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
|
||||
|
||||
- name: Cross-compilation of blas / lapack -- x86_64-linux-gnu-libgfortran5
|
||||
run: |
|
||||
julia --color=no -e 'using Pkg; Pkg.add("BinaryBuilder")'
|
||||
julia --color=no .github/julia/build_tarballs.jl x86_64-linux-gnu-libgfortran5 --verbose
|
||||
|
||||
- name: Archive artifact
|
||||
run: julia --color=no .github/julia/generate_binaries.jl
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: blas_lapack_binaries.${{ github.ref_name }}.x86_64-linux-gnu-libgfortran5.tar.gz
|
||||
path: ./blas_lapack_binaries.${{ github.ref_name }}.x86_64-linux-gnu-libgfortran5.tar.gz
|
||||
|
||||
build-linux-aarch64:
|
||||
name: blas / lapack -- Linux (aarch64) -- Release ${{ github.ref_name }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout lapack
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Julia
|
||||
uses: julia-actions/setup-julia@v2
|
||||
with:
|
||||
version: "1.7"
|
||||
arch: x64
|
||||
|
||||
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, BLAS_LAPACK_RELEASE, BLAS_LAPACK_COMMIT
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
|
||||
|
||||
- name: Cross-compilation of blas / lapack -- aarch64-linux-gnu-libgfortran5
|
||||
run: |
|
||||
julia --color=no -e 'using Pkg; Pkg.add("BinaryBuilder")'
|
||||
julia --color=no .github/julia/build_tarballs.jl aarch64-linux-gnu-libgfortran5 --verbose
|
||||
|
||||
- name: Archive artifact
|
||||
run: julia --color=no .github/julia/generate_binaries.jl
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: blas_lapack_binaries.${{ github.ref_name }}.aarch64-linux-gnu-libgfortran5.tar.gz
|
||||
path: ./blas_lapack_binaries.${{ github.ref_name }}.aarch64-linux-gnu-libgfortran5.tar.gz
|
||||
|
||||
build-windows-x64:
|
||||
name: blas / lapack -- Windows (x86_64) -- Release ${{ github.ref_name }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout lapack
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Julia
|
||||
uses: julia-actions/setup-julia@v2
|
||||
with:
|
||||
version: "1.7"
|
||||
arch: x64
|
||||
|
||||
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, BLAS_LAPACK_RELEASE, BLAS_LAPACK_COMMIT
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
|
||||
|
||||
- name: Cross-compilation of blas / lapack -- x86_64-w64-mingw32-libgfortran5
|
||||
run: |
|
||||
julia --color=no -e 'using Pkg; Pkg.add("BinaryBuilder")'
|
||||
julia --color=no .github/julia/build_tarballs.jl x86_64-w64-mingw32-libgfortran5 --verbose
|
||||
- name: Archive artifact
|
||||
run: julia --color=no .github/julia/generate_binaries.jl
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: blas_lapack_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-libgfortran5.zip
|
||||
path: ./blas_lapack_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-libgfortran5.zip
|
||||
|
||||
build-mac-x64:
|
||||
name: blas / lapack -- macOS (x86_64) -- Release ${{ github.ref_name }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout lapack
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Julia
|
||||
uses: julia-actions/setup-julia@v2
|
||||
with:
|
||||
version: "1.7"
|
||||
arch: x64
|
||||
|
||||
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, BLAS_LAPACK_RELEASE, BLAS_LAPACK_COMMIT
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
|
||||
|
||||
- name: Cross-compilation of blas / lapack -- x86_64-apple-darwin-libgfortran5
|
||||
run: |
|
||||
julia --color=no -e 'using Pkg; Pkg.add("BinaryBuilder")'
|
||||
julia --color=no .github/julia/build_tarballs.jl x86_64-apple-darwin-libgfortran5 --verbose
|
||||
|
||||
- name: Archive artifact
|
||||
run: julia --color=no .github/julia/generate_binaries.jl
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: blas_lapack_binaries.${{ github.ref_name }}.x86_64-apple-darwin-libgfortran5.tar.gz
|
||||
path: ./blas_lapack_binaries.${{ github.ref_name }}.x86_64-apple-darwin-libgfortran5.tar.gz
|
||||
|
||||
build-mac-aarch64:
|
||||
name: blas / lapack -- macOS (aarch64) -- Release ${{ github.ref_name }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout lapack
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Julia
|
||||
uses: julia-actions/setup-julia@v2
|
||||
with:
|
||||
version: "1.7"
|
||||
arch: x64
|
||||
|
||||
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, BLAS_LAPACK_RELEASE, BLAS_LAPACK_COMMIT
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
|
||||
echo "BLAS_LAPACK_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
|
||||
|
||||
- name: Cross-compilation of blas / lapack -- aarch64-apple-darwin-libgfortran5
|
||||
run: |
|
||||
julia --color=no -e 'using Pkg; Pkg.add("BinaryBuilder")'
|
||||
julia --color=no .github/julia/build_tarballs.jl aarch64-apple-darwin-libgfortran5 --verbose
|
||||
|
||||
- name: Archive artifact
|
||||
run: julia --color=no .github/julia/generate_binaries.jl
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: blas_lapack_binaries.${{ github.ref_name }}.aarch64-apple-darwin-libgfortran5.tar.gz
|
||||
path: ./blas_lapack_binaries.${{ github.ref_name }}.aarch64-apple-darwin-libgfortran5.tar.gz
|
||||
|
||||
release:
|
||||
name: Create Release and Upload Binaries
|
||||
needs: [build-windows-x64, build-linux-x64, build-linux-aarch64, build-mac-x64, build-mac-aarch64]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout lapack
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: .
|
||||
|
||||
- name: Create GitHub Release
|
||||
run: |
|
||||
gh release create ${{ github.ref_name }} \
|
||||
--title "${{ github.ref_name }}" \
|
||||
--notes "" \
|
||||
--verify-tag
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload Linux (x86_64) artifact
|
||||
run: |
|
||||
gh release upload ${{ github.ref_name }} \
|
||||
blas_lapack_binaries.${{ github.ref_name }}.x86_64-linux-gnu-libgfortran5.tar.gz/blas_lapack_binaries.${{ github.ref_name }}.x86_64-linux-gnu-libgfortran5.tar.gz#blas_lapack.${{ github.ref_name }}.linux.x86_64.tar.gz
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload Linux (aarch64) artifact
|
||||
run: |
|
||||
gh release upload ${{ github.ref_name }} \
|
||||
blas_lapack_binaries.${{ github.ref_name }}.aarch64-linux-gnu-libgfortran5.tar.gz/blas_lapack_binaries.${{ github.ref_name }}.aarch64-linux-gnu-libgfortran5.tar.gz#blas_lapack.${{ github.ref_name }}.linux.aarch64.tar.gz
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload Mac (x86_64) artifact
|
||||
run: |
|
||||
gh release upload ${{ github.ref_name }} \
|
||||
blas_lapack_binaries.${{ github.ref_name }}.x86_64-apple-darwin-libgfortran5.tar.gz/blas_lapack_binaries.${{ github.ref_name }}.x86_64-apple-darwin-libgfortran5.tar.gz#blas_lapack.${{ github.ref_name }}.mac.x86_64.tar.gz
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload Mac (aarch64) artifact
|
||||
run: |
|
||||
gh release upload ${{ github.ref_name }} \
|
||||
blas_lapack_binaries.${{ github.ref_name }}.aarch64-apple-darwin-libgfortran5.tar.gz/blas_lapack_binaries.${{ github.ref_name }}.aarch64-apple-darwin-libgfortran5.tar.gz#blas_lapack.${{ github.ref_name }}.mac.aarch64.tar.gz
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload Windows (x86_64) artifact
|
||||
run: |
|
||||
gh release upload ${{ github.ref_name }} \
|
||||
blas_lapack_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-libgfortran5.zip/blas_lapack_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-libgfortran5.zip#blas_lapack.${{ github.ref_name }}.windows.x86_64.zip
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user