-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to BinaryBuilder binaries (#74)
* switch to BinaryBuilder binaries * fix alignment check for MKL * latest FFTW build always has threads * support installing MKL via Conda, and use for testing; bugfix for MKL claiming to be FFTW 3.3.4 but not having sprint_plan * no need for dlext
- Loading branch information
Showing
8 changed files
with
147 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ julia 0.7.0-DEV.3449 | |
AbstractFFTs 0.3.0 | ||
Reexport | ||
Compat 0.62.0 | ||
BinDeps 0.6.0 | ||
BinaryProvider 0.3.0 | ||
Conda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,47 @@ | ||
using Libdl | ||
using BinDeps | ||
using BinDeps: builddir, depsdir, libdir | ||
|
||
# Binaries is not a recognized provider on Linux >:/ | ||
modified_defaults = false | ||
if !in(BinDeps.Binaries, BinDeps.defaults) | ||
pushfirst!(BinDeps.defaults, BinDeps.Binaries) | ||
modified_defaults = true | ||
end | ||
|
||
BinDeps.@setup | ||
|
||
const FFTW_VER = v"3.3.6-pl2" | ||
|
||
if Sys.iswindows() | ||
const libfftw_name = "libfftw3" | ||
const libfftwf_name = "libfftw3f" | ||
else | ||
const libfftw_name = "libfftw3_threads" | ||
const libfftwf_name = "libfftw3f_threads" | ||
end | ||
|
||
# Why can't everyone just agree on what to call this library... | ||
function makealiases(lib) | ||
major = string(FFTW_VER.major) | ||
nover = replace(lib, major => "") | ||
return String[ | ||
nover, | ||
join([lib, Libdl.dlext, major], "."), | ||
join([nover, Libdl.dlext, major], "."), | ||
lib * "-" * major, | ||
nover * "-" * major, | ||
] | ||
end | ||
|
||
libfftw = library_dependency(libfftw_name, aliases=makealiases(libfftw_name)) | ||
libfftwf = library_dependency(libfftwf_name, aliases=makealiases(libfftwf_name)) | ||
|
||
const URL = "https://github.com/ararslan/fftw-builder/releases/download/v$FFTW_VER/libfftw-$FFTW_VER" | ||
|
||
# Mapping of Sys.MACHINE to (url, sha) for precompiled binaries from fftw-builder | ||
const downloads = Dict( | ||
"x86_64-pc-linux-gnu" => ("$URL-linux-x86_64.tar.gz", | ||
"43a049496d47dd1919283a981d21078942d04b067edd75b61cc6aef538098b53"), | ||
"i686-pc-linux-gnu" => ("$URL-linux-i686.tar.gz", | ||
"0b6ec1440ea76f72ed6e5d105a4d634e195b484e847c521ac0812092069f0c74"), | ||
"x86_64-apple-darwin" => ("$URL-osx-x86_64.tar.gz", | ||
"193f20bba844fd2524f70e941aa5203b153bdcd321df2f20fc3a9d15b4aae50a"), | ||
"x86_64-w64-mingw32" => ("$URL-win-x86_64.zip", | ||
"4e9bd1022c5980869b06bb9d10767fd2578dfe47f9323e6f572d0918da8c8a07"), | ||
"i686-w64-mingw32" => ("$URL-win-i686.zip", | ||
"60a65fd689495629a1558858f3a52011f9ce28df8aa756f5b315b17dd8dd8843"), | ||
using BinaryProvider # requires BinaryProvider 0.3.0 or later | ||
|
||
# Parse some basic command-line arguments | ||
const verbose = "--verbose" in ARGS | ||
const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) | ||
products = [ | ||
LibraryProduct(prefix, String["libfftw3"], :libfftw3), | ||
LibraryProduct(prefix, String["libfftw3f"], :libfftw3f), | ||
] | ||
|
||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/JuliaMath/FFTWBuilder/releases/download/v3.3.8+1" | ||
|
||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
Linux(:aarch64, :glibc) => ("$bin_prefix/FFTW.aarch64-linux-gnu.tar.gz", "4296ad9af20d4441fd809c6aaa3ee5fa36818b7a2eb3372da7d2ead454b4e570"), | ||
Linux(:aarch64, :musl) => ("$bin_prefix/FFTW.aarch64-linux-musl.tar.gz", "ef6d4e56bd9e405ef2895a857ffbc07cb7abcf450040a2335b83a95f4a431392"), | ||
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/FFTW.arm-linux-gnueabihf.tar.gz", "8f8c69a6eca468465734e1fd58801519cea0f7a8f9e08bba93e39315758f7a7c"), | ||
Linux(:armv7l, :musl, :eabihf) => ("$bin_prefix/FFTW.arm-linux-musleabihf.tar.gz", "48d137fddab6888bdc59893d22728f081578ff0884954f0f6f5df51afff53ece"), | ||
Linux(:i686, :glibc) => ("$bin_prefix/FFTW.i686-linux-gnu.tar.gz", "76d85d81a81752a0e08bc2eec51a568a6000928a550c37a181b51340452b1b5f"), | ||
Linux(:i686, :musl) => ("$bin_prefix/FFTW.i686-linux-musl.tar.gz", "5ee42df3aa002e9511c3cc808f728429e4930bb24df8b461dc137bf49aa71b8f"), | ||
Windows(:i686) => ("$bin_prefix/FFTW.i686-w64-mingw32.tar.gz", "28b96cb5d78c87d16d305a63a838c5027d319c0292f00c925e14f21c744535a8"), | ||
Linux(:powerpc64le, :glibc) => ("$bin_prefix/FFTW.powerpc64le-linux-gnu.tar.gz", "53d305eebb3a152df093d637fe8a4d6288a2b7175bf91ab9242dad62e5e0853a"), | ||
MacOS(:x86_64) => ("$bin_prefix/FFTW.x86_64-apple-darwin14.tar.gz", "7562aed6279ea965435c8a388be1494b9a18f7e00058d0fa260a711bffde1bd5"), | ||
Linux(:x86_64, :glibc) => ("$bin_prefix/FFTW.x86_64-linux-gnu.tar.gz", "70dcc7ad2697121564d5d91da9f2544b0e68b026779a45063039a39cd5585711"), | ||
Linux(:x86_64, :musl) => ("$bin_prefix/FFTW.x86_64-linux-musl.tar.gz", "4bf1c1e7489241c38788bc061f2a091fe72605f67e58411b2933313fa0923877"), | ||
FreeBSD(:x86_64) => ("$bin_prefix/FFTW.x86_64-unknown-freebsd11.1.tar.gz", "ad70aca12821f6df1c67da74fc2f1b4fa009ac14d8570ff1f912876e731185af"), | ||
Windows(:x86_64) => ("$bin_prefix/FFTW.x86_64-w64-mingw32.tar.gz", "6726bff25faeca8e29dfce8be5b0fb7da0a380faa9fdb5a5a6c98ea76d009b2f"), | ||
) | ||
|
||
const machine = Sys.isapple() ? "x86_64-apple-darwin" : Sys.MACHINE | ||
|
||
if haskey(downloads, machine) | ||
url, sha = downloads[machine] | ||
provides(Binaries, URI(url), [libfftw, libfftwf], SHA=sha, os=BinDeps.OSNAME, | ||
unpacked_dir=joinpath("usr", "lib"), installed_libpath=libdir(libfftw)) | ||
scratch = false | ||
elseif Sys.KERNEL === :FreeBSD | ||
provides(BSDPkg, "fftw3", [libfftw, libfftwf], os=:FreeBSD) | ||
scratch = false | ||
else | ||
info("No precompiled binaries found for your system. Building from scratch...") | ||
scratch = true | ||
end | ||
|
||
general_config = ["--prefix=" * abspath(builddir(libfftw)), | ||
"--libdir=" * abspath(libdir(libfftw)), | ||
"--bindir=" * abspath(bindir(libfftw))] | ||
|
||
fftw_config = ["--enable-shared", "--disable-fortran", "--disable-mpi", "--enable-threads"] | ||
fftw_enable_single = "--enable-single" | ||
|
||
if Sys.ARCH === :ppc | ||
append!(fftw_config, ["--enable-altivec", "--enable-fma"]) | ||
elseif Sys.ARCH === :x86_64 | ||
append!(fftw_config, ["--enable-sse2", "--enable-fma"]) | ||
end | ||
|
||
if Sys.iswindows() | ||
append!(fftw_config, ["--with-our-malloc", "--with-combined-threads"]) | ||
Sys.ARCH === :x86_64 || push!(fftw_config, "--with-incoming-stack-boundary=2") | ||
end | ||
|
||
# Make it harder to build from scratch | ||
if scratch | ||
provides(Sources, URI("http://www.fftw.org/fftw-$FFTW_VER.tar.gz"), [libfftw, libfftwf]) | ||
|
||
provides(BuildProcess, (@build_steps begin | ||
GetSources(libfftw) | ||
CreateDirectory(builddir(libfftw)) | ||
@build_steps begin | ||
ChangeDirectory(builddir(libfftw)) | ||
FileRule(joinpath(libdir(libfftw), libfftw_name * "." * Libdl.dlext), @build_steps begin | ||
CreateDirectory(libdir(libfftw)) | ||
`$(joinpath(srcdir(libfftw), "fftw-$FFTW_VER", "configure")) $general_config $fftw_config` | ||
`$MAKE_CMD` | ||
`$MAKE_CMD install` | ||
end) | ||
FileRule(joinpath(libdir(libfftw), libfftwf_name * "." * Libdl.dlext), @build_steps begin | ||
`$(joinpath(srcdir(libfftw), "fftw-$FFTW_VER", "configure")) $general_config $fftw_config $fftw_enable_single` | ||
`$MAKE_CMD` | ||
`$MAKE_CMD install` | ||
end) | ||
end | ||
end), [libfftw, libfftwf]) | ||
end | ||
|
||
if Sys.iswindows() | ||
BinDeps.@install Dict([:libfftw3 => :libfftw, :libfftw3f => :libfftwf]) | ||
else | ||
BinDeps.@install Dict([:libfftw3_threads => :libfftw, :libfftw3f_threads => :libfftwf]) | ||
end | ||
|
||
if modified_defaults | ||
popfirst!(BinDeps.defaults) | ||
end | ||
# Install unsatisfied or updated dependencies: | ||
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) | ||
if haskey(download_info, platform_key()) | ||
url, tarball_hash = download_info[platform_key()] | ||
if unsatisfied || !isinstalled(url, tarball_hash; prefix=prefix) | ||
# Download and install binaries | ||
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) | ||
end | ||
elseif unsatisfied | ||
# If we don't have a BinaryProvider-compatible .tar.gz to download, complain. | ||
# Alternatively, you could attempt to install from a separate provider, | ||
# build from source or something even more ambitious here. | ||
error("Your platform $(triplet(platform_key())) is not supported by this package!") | ||
end | ||
|
||
# Write out a deps.jl file that will contain mappings for our products | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.