Skip to content
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 24 additions & 33 deletions S/SuiteSparse/SuiteSparse/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,48 @@ include("../common.jl")

name = "SuiteSparse"

sources = [
sources;
DirectorySource("./bundled")
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/SuiteSparse
apk add --upgrade cmake --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main

# Apply Jameson's shlib patch
atomic_patch -p1 ${WORKSPACE}/srcdir/patches/SuiteSparse-shlib.patch
cd $WORKSPACE/srcdir/SuiteSparse

# Disable OpenMP as it will probably interfere with blas threads and Julia threads
FLAGS+=(INSTALL="${prefix}" INSTALL_LIB="${libdir}" INSTALL_INCLUDE="${prefix}/include" CFOPENMP=)

if [[ ${bb_full_target} == *-sanitize+memory* ]]; then
# Install msan runtime (for clang)
cp -rL ${libdir}/linux/* /opt/x86_64-linux-musl/lib/clang/*/lib/linux/
fi

if [[ ${target} == *mingw32* ]]; then
FLAGS+=(UNAME=Windows)
FLAGS+=(LDFLAGS="${LDFLAGS} -L${libdir} -shared")
else
FLAGS+=(UNAME="$(uname)")
FLAGS+=(LDFLAGS="${LDFLAGS} -L${libdir}")
fi

BLAS_NAME=blastrampoline
if [[ ${nbits} == 64 ]]; then
SUN="-DSUN64 -DLONGBLAS='long long'"
fi

FLAGS+=(BLAS="-l${BLAS_NAME}" LAPACK="-l${BLAS_NAME}")

# Disable METIS in CHOLMOD by passing -DNPARTITION and avoiding linking metis
#FLAGS+=(MY_METIS_LIB="-lmetis" MY_METIS_INC="${prefix}/include")
FLAGS+=(UMFPACK_CONFIG="$SUN" CHOLMOD_CONFIG+="$SUN -DNPARTITION" SPQR_CONFIG="$SUN")

make -j${nproc} -C SuiteSparse_config "${FLAGS[@]}" library config

for proj in SuiteSparse_config AMD BTF CAMD CCOLAMD COLAMD CHOLMOD LDL KLU UMFPACK RBio SPQR; do
make -j${nproc} -C $proj "${FLAGS[@]}" library CFOPENMP="$CFOPENMP"
make -j${nproc} -C $proj "${FLAGS[@]}" install CFOPENMP="$CFOPENMP"
cd ${proj}/build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DNOPENMP=ON \
-DNPARTITION=ON \
-DBLAS_FOUND=1 \
-DBLAS64_SUFFIX="_64" \
-DBLAS_LIBRARIES="${libdir}/libblastrampoline.${dlext}" \
-DBLAS_LINKER_FLAGS="blastrampoline" \
-DBLA_VENDOR="${BLAS_NAME}" \
-DALLOW_64BIT_BLAS=ON \
-DLAPACK_FOUND=1 \
-DLAPACK_LINKER_FLAGS="blastrampoline" \
-DLAPACK_LIBRARIES="${libdir}/libblastrampoline.${dlext}" \
-DBLAS_UNDERSCORE \
DCMAKE_Fortran_COMPILER=""
make -j${nproc}
make install
cd $WORKSPACE/srcdir/SuiteSparse
done

# For now, we'll have to adjust the name of the Lbt library on macOS and FreeBSD.
# Eventually, this should be fixed upstream
if [[ ${target} == *-apple-* ]] || [[ ${target} == *freebsd* ]]; then
echo "-- Modifying library name for Lbt"

BLAS_NAME="blastrampoline"
for nm in libcholmod libspqr libumfpack; do
# Figure out what version it probably latched on to:
if [[ ${target} == *-apple-* ]]; then
Expand Down
43 changes: 0 additions & 43 deletions S/SuiteSparse/SuiteSparse/bundled/patches/SuiteSparse-shlib.patch

This file was deleted.

4 changes: 2 additions & 2 deletions S/SuiteSparse/common.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using BinaryBuilder, Pkg

version = v"5.10.1"
version = v"6.0.2"

# Collection of sources required to build SuiteSparse
sources = [
GitSource("https://github.com/DrTimothyAldenDavis/SuiteSparse.git",
"538273cfd53720a10e34a3d80d3779b607e1ac26"),
"25fc8e8b7317dea1793828a1e95f05fd13a85470"),
]

# We enable experimental platforms as this is a core Julia dependency
Expand Down