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

Revise libsingular_julia #1798

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder
import Pkg: PackageSpec
import Pkg.Types: VersionSpec

const name = "libsingular_julia"
const version = v"0.2.0"
const version = VersionNumber(0, 3, 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", "b63a76c1634dc680485f5b7d4c81235e39d714bd"),
]

# 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" \
-DSingular_PREFIX="$prefix" \
-DCMAKE_INSTALL_PREFIX="$prefix" \
-DCMAKE_FIND_ROOT_PATH="$prefix" \
-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TARGET_TOOLCHAIN}" \
Expand All @@ -29,21 +25,23 @@ cmake libsingular-j*/ -B build \

VERBOSE=ON cmake --build build --config Release --target install -- -j${nproc}

install_license $WORKSPACE/srcdir/libsingular-j*/LICENSE.md
install_license 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 = filter!(!Sys.iswindows, platforms) # Singular does not support Windows
platforms = expand_cxxstring_abis(platforms)

# The products that we will ensure are always built
const products = [
Expand All @@ -52,11 +50,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")),
BuildDependency(PackageSpec(name="libjulia_jll", version=julia_version)),
Dependency("libcxxwrap_julia_jll"),
Dependency("Singular_jll"),
Dependency(PackageSpec(name="Singular_jll", version=VersionSpec("401.390"))), # require 4.1.4-DEV snapshot
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"8",
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")