Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPEX] Add builder #5504

Merged
merged 13 commits into from
Sep 17, 2022
Merged
Changes from 9 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: 57 additions & 0 deletions S/SPEX/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using BinaryBuilder, Pkg

name = "SPEX"
version = v"1.1.5"

# Collection of sources required to build SuiteSparse:GraphBLAS
sources = [
GitSource("https://github.com/clouren/SPEX",
"9471682b072419063d73bc950949bf3458b187f9"),
DirectorySource("./bundled")
]

# Bash recipe for building across all platforms
script = raw"""
# Compile GraphBLAS
cd ${WORKSPACE}/srcdir/SPEX
atomic_patch -p1 ../werror.patch
CFLAGS="${CFLAGS} -std=c99"
cd ${WORKSPACE}/srcdir/SPEX/SPEX/SPEX_Util
if [[ "${target}" == *mingw* ]]; then
make library -j${nproc} UNAME=Windows SO_OPTS="${SO_OPTS} -shared -L${libdir}"
else
make library -j${nproc}
fi
cp ${WORKSPACE}/srcdir/SPEX/include/SPEX_Util.h ${includedir}
cp ${WORKSPACE}/srcdir/SPEX/lib/libspexutil* ${libdir}
cd ${WORKSPACE}/srcdir/SPEX/SPEX/SPEX_Left_LU
if [[ "${target}" == *mingw* ]]; then
make library UNAME=Windows SO_OPTS="${SO_OPTS} -shared -L${libdir}"
else
make library -j${nproc}
fi
cp ${WORKSPACE}/srcdir/SPEX/include/SPEX_Left_LU.h ${includedir}
cp ${WORKSPACE}/srcdir/SPEX/lib/libspexleftlu* ${libdir}
install_license ${WORKSPACE}/srcdir/SPEX/SPEX/LICENSE.txt
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms(;experimental=true)
rayegun marked this conversation as resolved.
Show resolved Hide resolved

# The products that we will ensure are always built
products = [
LibraryProduct("libspexutil", :libspexutil),
LibraryProduct("libspexleftlu", :libspexleftlu)
]

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("SuiteSparse_jll"),
Dependency("GMP_jll"),
Dependency("MPFR_jll")
rayegun marked this conversation as resolved.
Show resolved Hide resolved
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
preferred_gcc_version=v"9", julia_compat="1.6")
26 changes: 26 additions & 0 deletions S/SPEX/bundled/werror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/SPEX/SPEX_Left_LU/Lib/Makefile b/SPEX/SPEX_Left_LU/Lib/Makefile
index 72e207a..7032800 100644
--- a/SPEX/SPEX_Left_LU/Lib/Makefile
+++ b/SPEX/SPEX_Left_LU/Lib/Makefile
@@ -22,7 +22,7 @@ SUITESPARSE ?= $(realpath $(CURDIR)/../../..)
include ../../../SuiteSparse_config/SuiteSparse_config.mk

# uncomment for extra error checking:
-CFLAGS += -Wall -Wextra -Wpedantic -Werror
+CFLAGS += -Wall -Wextra -Wpedantic

# SPEX_Left LU depends on SuiteSparse_config, AMD, COLAMD, M, GMP, and MPFR
LDLIBS += -lspexutil -lsuitesparseconfig -lamd -lcolamd -lm -lgmp -lmpfr
diff --git a/SPEX/SPEX_Util/Lib/Makefile b/SPEX/SPEX_Util/Lib/Makefile
index 754ab87..7ac6e88 100644
--- a/SPEX/SPEX_Util/Lib/Makefile
+++ b/SPEX/SPEX_Util/Lib/Makefile
@@ -22,7 +22,7 @@ SUITESPARSE ?= $(realpath $(CURDIR)/../../..)
include ../../../SuiteSparse_config/SuiteSparse_config.mk

# uncomment for extra error checking:
-CFLAGS += -Wall -Wextra -Wpedantic -Werror
+CFLAGS += -Wall -Wextra -Wpedantic

# SPEX_Util depends on SuiteSparse_config, AMD, COLAMD, M, GMP, and MPFR
LDLIBS += -lsuitesparseconfig -lamd -lcolamd -lm -lgmp -lmpfr