Skip to content

Commit

Permalink
Merge pull request #380 from DrTimothyAldenDavis/dev2
Browse files Browse the repository at this point in the history
SuiteSparse v7.2.0.beta1
  • Loading branch information
DrTimothyAldenDavis authored Sep 8, 2023
2 parents b65115d + eaa4684 commit 0ddf46e
Show file tree
Hide file tree
Showing 330 changed files with 24,567 additions and 13,874 deletions.
169 changes: 169 additions & 0 deletions .github/workflows/build-arch-emu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: arch-emu
on:
push:
branches-ignore:
- '**/dev2'
pull_request:

concurrency: ci-arch-emu-${{ github.ref }}

env:
# string with name of libraries to be built
BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SuiteSparse_GPURuntime:GPUQREngine:SPQR:SPEX"
# string with name of libraries to be checked
CHECK_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SPQR:SPEX"


jobs:

alpine:
runs-on: ubuntu-latest

defaults:
run:
# Use emulated shell as default
shell: alpine.sh {0}

strategy:
# Allow other runners in the matrix to continue if some fail
fail-fast: false

matrix:
# For available CPU architectures, see:
# https://github.com/marketplace/actions/setup-alpine-linux-environment
arch: [x86, aarch64, armv7, ppc64le, s390x]
include:
- arch: x86
ccache-max: 42M
- arch: aarch64
ccache-max: 42M
- arch: armv7
ccache-max: 42M
- arch: ppc64le
ccache-max: 45M
- arch: s390x
ccache-max: 42M

name: alpine (${{ matrix.arch }})

steps:
- name: checkout repository
uses: actions/checkout@v3
# shell: bash

- name: install dependencies
uses: jirutka/setup-alpine@v1
# shell: bash
with:
arch: ${{ matrix.arch }}
packages: >
build-base
ccache
cmake
gfortran
m4
gmp-dev
mpfr-dev
openblas-dev
- name: prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "key=ccache:alpine:${{ matrix.arch }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
- name: restore ccache
# setup the GitHub cache used to maintain the ccache from one job to the next
uses: actions/cache/restore@v3
with:
# location of the ccache of the chroot in the root file system
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
# Prefer caches from the same branch. Fall back to caches from the dev branch.
restore-keys: |
ccache:alpine:${{ matrix.arch }}:${{ github.ref }}
ccache:alpine:${{ matrix.arch }}
- name: configure ccache
env:
CCACHE_MAX: ${{ matrix.ccache-max }}
run: |
test -d ~/.ccache || mkdir ~/.ccache
echo "max_size = $CCACHE_MAX" >> ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache -s
which ccache
# echo "/usr/lib/ccache" >> $GITHUB_PATH
- name: build
run: |
echo "gcc --version"
gcc --version
echo "gcc -dumpmachine"
gcc -dumpmachine
IFS=:
for lib in ${BUILD_LIBS}; do
printf " \033[0;32m==>\033[0m Building library \033[0;32m${lib}\033[0m\n"
echo "::group::Configure $lib"
cd ${GITHUB_WORKSPACE}/${lib}/build
cmake -DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \
-DBLA_VENDOR="OpenBLAS" \
..
echo "::endgroup::"
echo "::group::Build $lib"
cmake --build . --config Release
echo "::endgroup::"
done
- name: check
run: |
IFS=':'
for lib in ${CHECK_LIBS}; do
printf "::group:: \033[0;32m==>\033[0m Checking library \033[0;32m${lib}\033[0m\n"
cd ${GITHUB_WORKSPACE}/${lib}
make demos
echo "::endgroup::"
done
- name: ccache status
continue-on-error: true
run: ccache -s

- name: save ccache
# Save the cache after we are done (successfully) building
# This helps to retain the ccache even if the subsequent steps are failing.
uses: actions/cache/save@v3
with:
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}

- name: install
run: |
IFS=':'
for lib in ${BUILD_LIBS}; do
printf "::group::\033[0;32m==>\033[0m Installing library \033[0;32m${lib}\033[0m\n"
cd ${GITHUB_WORKSPACE}/${lib}/build
cmake --install .
echo "::endgroup::"
done
- name: build example
run: |
cd ${GITHUB_WORKSPACE}/Example/build
printf "::group::\033[0;32m==>\033[0m Configuring example\n"
cmake \
-DBLA_VENDOR="OpenBLAS" \
..
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Building example\n"
cmake --build .
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Executing example\n"
LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_demo
echo "::endgroup::"
35 changes: 31 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ jobs:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest

name: ubuntu (${{ matrix.compiler }} ${{ matrix.cuda }} CUDA)

strategy:
# Allow other runners in the matrix to continue if some fail
fail-fast: false

matrix:
compiler: [gcc, clang]
cuda: [with, without]
include:
- compiler: gcc
compiler-pkgs: "g++ gcc"
Expand All @@ -42,6 +45,12 @@ jobs:
ccache-max: 600M
- compiler: clang
ccache-max: 500M
- cuda: with
cuda-pkgs: "nvidia-cuda-dev nvidia-cuda-toolkit"
cuda-cmake-flags:
-DENABLE_CUDA=On
-DCUDAToolkit_INCLUDE_DIR="/usr/include"
-DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"

env:
CC: ${{ matrix.cc }}
Expand All @@ -54,18 +63,19 @@ jobs:
- name: install dependencies
env:
COMPILER_PKGS: ${{ matrix.compiler-pkgs }}
CUDA_PKGS: ${{ matrix.cuda-pkgs }}
run: |
sudo apt -qq update
sudo apt install -y ${COMPILER_PKGS} autoconf automake ccache cmake \
dvipng gfortran libgmp-dev liblapack-dev libmpfr-dev \
libopenblas-dev
libopenblas-dev ${CUDA_PKGS}
- name: prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "key=ccache:ubuntu:${{ matrix.compiler }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
echo "key=ccache:ubuntu:${{ matrix.compiler }}:${{ matrix.cuda }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
- name: restore ccache
# setup the GitHub cache used to maintain the ccache from one job to the next
Expand All @@ -75,8 +85,23 @@ jobs:
key: ${{ steps.ccache-prepare.outputs.key }}
# Prefer caches from the same branch. Fall back to caches from the dev branch.
restore-keys: |
ccache:ubuntu:${{ matrix.compiler }}:${{ github.ref }}
ccache:ubuntu:${{ matrix.compiler }}
ccache:ubuntu:${{ matrix.compiler }}:${{ matrix.cuda }}:${{ github.ref }}
ccache:ubuntu:${{ matrix.compiler }}:${{ matrix.cuda }}
- name: create empty libraries
# This is to work around a bug in nvlink.
# See: https://forums.developer.nvidia.com/t/nvlink-fatal-could-not-open-input-file-when-linking-with-empty-static-library/208517
if: matrix.cuda == 'with'
run: |
touch empty.c
gcc -fPIC -c empty.c -oempty.o
ar rcsv libdl.a empty.o
ar rcsv librt.a empty.o
ar rcsv libpthread.a empty.o
# overwrite system libraries with "valid" empty libraries
sudo mv ./libdl.a /usr/lib/x86_64-linux-gnu/libdl.a
sudo mv ./librt.a /usr/lib/x86_64-linux-gnu/librt.a
sudo mv ./libpthread.a /usr/lib/x86_64-linux-gnu/libpthread.a
- name: configure ccache
env:
Expand All @@ -101,6 +126,7 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \
-DBLA_VENDOR="OpenBLAS" \
${{ matrix.cuda-cmake-flags }} \
..
echo "::endgroup::"
echo "::group::Build $lib"
Expand Down Expand Up @@ -146,6 +172,7 @@ jobs:
printf "::group::\033[0;32m==>\033[0m Configuring example\n"
cmake \
-DBLA_VENDOR="OpenBLAS" \
${{ matrix.cuda-cmake-flags }} \
..
echo "::endgroup::"
printf "::group::\033[0;32m==>\033[0m Building example\n"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ SPQR/Tcov/gpu_results.txt
SPQR/Tcov/gpuqrengine_demo
SPQR/Tcov/qrdemo_gpu
SPQR/Tcov/qrtest
SPQR/Tcov/qrtest32
SPQR/Tcov/qrtest_out.txt
SPQR/Tcov/qrtest_out32.txt
SPQR/Tcov/troll.m
SPQR/Tcov/cov.out

Expand Down
Loading

0 comments on commit 0ddf46e

Please sign in to comment.