Skip to content

Commit

Permalink
Revise libsingular_julia
Browse files Browse the repository at this point in the history
Adapt to latest CxxWrap; in particular, build separate binaries for each
minor Julia version (1.3, 1.4, 1.5, ...)

This also adds support for more platforms.

The build dependencies on GMP_jll and MPFR_jll were only implicit so far,
but we need to make them explicit and with version constraints to avoid
issues on macOS (when this JLL is built against a too-new version of either
of these libraries, it becomes unloadable in older Julia versions)
  • Loading branch information
fingolfin committed Nov 21, 2020
1 parent caee25a commit 0c13d87
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@ using BinaryBuilder
import Pkg: PackageSpec

const name = "libsingular_julia"
const version = v"0.2.0"
const version = VersionNumber(0, 2, julia_version.minor)

# Collection of sources required to build libsingular-julia
const sources = [
ArchiveSource("https://github.com/oscar-system/libsingular-julia/archive/v$(version).tar.gz",
"ee4e5ef96caf9d18553600d87f922e5d40cb1c7d30a1697c92b23b493498db1a"),
GitSource("https://github.com/oscar-system/libsingular-julia",
"d88ee35e8a1cb10be271d1482ee7c8e3f108e2e4"),
]

# Bash recipe for building across all platforms
const script = raw"""
# remove $libdir from LD_LIBRARY_PATH as this causes issues with perl
if [[ -n "$LD_LIBRARY_PATH" ]]; then
LD_LIBRARY_PATH=$(echo -n $LD_LIBRARY_PATH | sed -e "s|[:^]$libdir\w*|:|g")
fi
cmake libsingular-j*/ -B build \
-DJulia_PREFIX="$prefix" \
-DCMAKE_INSTALL_PREFIX="$prefix" \
Expand All @@ -34,16 +29,17 @@ install_license $WORKSPACE/srcdir/libsingular-j*/LICENSE.md

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
const platforms = expand_cxxstring_abis([
Platform("x86_64", "linux"; libc="glibc", cxxstring_abi = "cxx11"),
Platform("x86_64", "macos"; cxxstring_abi = "cxx11"),
#Platform("i686", "linux"; libc="glibc", cxxstring_abi="cxx11"), # Wrapper code is buggy
#Platform("x86_64", "freebsd"; cxxstring_abi = "cxx11"),
])
platforms = supported_platforms()

# skip i686 musl builds (not supported by libjulia_jll)
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

# skip PowerPC builds in Julia 1.3 (not supported by libjulia_jll)
if julia_version < v"1.4"
filter!(p -> !(Sys.islinux(p) && arch(p) == "powerpc64le"), platforms)
end

#platforms = supported_platforms()
#platforms = filter!(!Sys.iswindows, platforms)
#platforms = expand_cxxstring_abis(platforms)
platforms = expand_cxxstring_abis(platforms)

# The products that we will ensure are always built
const products = [
Expand All @@ -53,10 +49,14 @@ const products = [
# Dependencies that must be installed before this package can be built
const dependencies = [
Dependency("CompilerSupportLibraries_jll"),
BuildDependency(PackageSpec(name="Julia_jll", version="v1.4.1")),
Dependency("libcxxwrap_julia_jll"),
BuildDependency(PackageSpec(name="libjulia_jll", version=julia_version))
Dependency("libcxxwrap_julia_jll", VersionNumber(0, 8, julia_version.minor)),
Dependency("Singular_jll"),
BuildDependency(PackageSpec(name="GMP_jll", version=v"6.1.2")),
BuildDependency(PackageSpec(name="MPFR_jll", version=v"4.0.2")),
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"7")
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
preferred_gcc_version=v"7",
julia_compat = "$(julia_version.major).$(julia_version.minor)")
2 changes: 2 additions & 0 deletions L/libsingular_julia/libsingular_julia@1.3/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const julia_version = v"1.3.1"
include("../common.jl")

0 comments on commit 0c13d87

Please sign in to comment.