Skip to content

Commit

Permalink
[SLICOT] Another attempt to work around mingw/BB/LBT problems (#5909)
Browse files Browse the repository at this point in the history
* Another attempt to work around mingw/bb/LBT problems

* [SLICOT] use ILP64 OpenBLAS on Windows

* [SLICOT] ILP64 OpenBLAS, paying more attention

* [SLICOT] add BLAS/LAPACK symbols needed for new routines

* bump JLL version for Julia compat update
  • Loading branch information
RalphAS authored Nov 24, 2022
1 parent 4533b19 commit a064c12
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions S/SLICOT/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ using BinaryBuilder, Pkg
using BinaryBuilderBase: get_addable_spec

name = "SLICOT"
version = v"5.8.0"

# NOTE: upstream library version is v5.8 + apparently cosmetic commits
# patch number is added here to avoid poisoning the JLL version sequence
version = v"5.8.1"

# Collection of sources required to complete build
# Note to maintainers: extracts from LAPACK are deprecated routines, so probably don't want
Expand Down Expand Up @@ -53,6 +56,7 @@ ZGESVD ZGETRF ZGETRI ZGETRS ZHGEQZ ZLACGV ZLACON ZLACP2 ZLACPY ZLADIV
ZLAHQR ZLAIC1 ZLANGE ZLANHS ZLANTR ZLAPMT ZLARF ZLARFG ZLARNV ZLARTG
ZLASCL ZLASET ZLASSQ ZLATRS ZLATZM ZROT ZSCAL ZSWAP ZTRSM ZTZRZF
ZUNGQR ZUNMQR ZUNMRQ ZUNMRZ ZGERC ZGERU DGGHRD
ZTRMM ZDOTU ZTREXC ZTRMV ZGERQF ZSTEIN ZGGES
)
Expand All @@ -72,12 +76,20 @@ if [[ ${nbits} == 64 ]]; then
FFLAGS="${FFLAGS} -fdefault-integer-8 ${SYMBOL_DEFS[@]}"
fi
if [[ "${target}" == *mingw* && ${nbits} == 32 ]]; then
BLAS_LAPACK="-L${libdir} -lopenblas"
elif [[ "${target}" == *mingw* && ${nbits} == 64 ]]; then
BLAS_LAPACK="-L${libdir} -lopenblas64_"
else
BLAS_LAPACK="-L${libdir} -lblastrampoline"
fi
mkdir ../build
cd ../build/
# Above on the fly added CMake code builds shared library with specified LAPACK/BLAS
cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DLAPACK_blas_LIBRARIES="-L${libdir} -lblastrampoline" \
-DLAPACK_blas_LIBRARIES="${BLAS_LAPACK}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_Fortran_FLAGS="${FFLAGS}" \
..
Expand All @@ -96,21 +108,6 @@ install_license ../LICENSE
# platforms are passed in on the command line
platforms = expand_gfortran_versions(supported_platforms())

# The following was derived from #4770 (Pfapack)
# https://github.com/JuliaPackaging/Yggdrasil/pull/4770
# Since we need to link to libblastrampoline which has seen multiple
# ABI-incompatible versions, we need to expand the julia versions we target
julia_versions = [v"1.7", v"1.8", v"1.9", v"1.10"]
function set_julia_version(platforms::Vector{Platform}, julia_version::VersionNumber)
_platforms = deepcopy(platforms)
for p in _platforms
p["julia_version"] = string(julia_version)
end
return _platforms
end
expand_julia_versions(platforms::Vector{Platform}, julia_versions::Vector{VersionNumber}) =
vcat(set_julia_version.(Ref(platforms), julia_versions)...)
platforms = expand_julia_versions(platforms, julia_versions)

# The products that we will ensure are always built
products = [
Expand All @@ -119,10 +116,20 @@ products = [

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(get_addable_spec("libblastrampoline_jll", v"3.0.4+0"); platforms=filter(p -> VersionNumber(p["julia_version"]) == v"1.7.0", platforms)),
Dependency(get_addable_spec("libblastrampoline_jll", v"5.1.1+1"); platforms=filter(p -> VersionNumber(p["julia_version"]) >= v"1.8.0", platforms)),
Dependency(PackageSpec(name="OpenBLAS_jll", uuid="4536629a-c528-5b80-bd46-f80d51c5b363"), platforms=filter(Sys.iswindows, platforms)),
Dependency(PackageSpec(name="libblastrampoline_jll", uuid="8e850b90-86db-534c-a0d3-1478176c7d93"), platforms=filter(!Sys.iswindows, platforms)),
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae"))
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.7")
build_tarballs(
ARGS,
name,
version,
sources,
script,
platforms,
products,
dependencies;
julia_compat="1.8"
)

0 comments on commit a064c12

Please sign in to comment.