Skip to content

Regain Windows support #88

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

Merged
merged 9 commits into from
Nov 6, 2019
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
15 changes: 11 additions & 4 deletions appveyor.yml → .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Documentation: http://www.appveyor.com/docs/appveyor-yml/
image: Visual Studio 2017

cache: c:\tools\vcpkg\installed\

platform: x64

environment:
matrix:
- julia_version: 1.0
Expand All @@ -6,10 +13,6 @@ environment:
- julia_version: 1.3
- julia_version: nightly

platform:
- x86 # 32-bit
- x64 # 64-bit

# # Uncomment the following lines to allow failures on nightly julia
# # (tests will run but not make your overall status red)
matrix:
Expand All @@ -29,6 +32,10 @@ notifications:

install:
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
- set PATH=%PATH%;c:\tools\vcpkg
- set PATH=%PATH%;C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\
- vcpkg install openblas:x64-windows fftw3[core,threads]:x64-windows mpfr:x64-windows mpir:x64-windows --recurse
- set PATH=c:\tools\vcpkg\installed\x64-windows\bin;%PATH%

build_script:
- echo "%JL_BUILD_SCRIPT%"
Expand Down
15 changes: 8 additions & 7 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using BinaryProvider
import Libdl

version = v"0.2.8"
version = v"0.2.9"

if arch(platform_key_abi()) != :x86_64
@warn "FastTransforms has only been tested on x86_64 architectures."
Expand All @@ -16,18 +16,19 @@ print_error() = error(
)

print_platform_error(p::Platform) = "On $(BinaryProvider.platform_name(p)), please consider opening a pull request to add support.\n"
print_platform_error(::MacOS) = "On MacOS\n\tbrew install gcc@8 fftw mpfr\n"
print_plaftorm_error(::Linux) = "On Linux\n\tsudo apt-get install gcc-8 libblas-dev libopenblas-base libfftw3-dev libmpfr-dev\n"
print_plaftorm_error(::Windows) = "On Windows\n\tvcpkg install openblas:x64-windows fftw3[core,threads]:x64-windows mpir:x64-windows mpfr:x64-windows\n"
print_platform_error(p::MacOS) = "On MacOS\n\tbrew install gcc@8 fftw mpfr\n"
print_platform_error(p::Linux) = "On Linux\n\tsudo apt-get install gcc-8 libblas-dev libopenblas-base libfftw3-dev libmpfr-dev\n"
print_platform_error(p::Windows) = "On Windows\n\tvcpkg install openblas:x64-windows fftw3[core,threads]:x64-windows mpir:x64-windows mpfr:x64-windows\n"

# Rationale is as follows: The build is pretty fast, so on Linux it is typically easiest
# to just use the gcc of the system to build the library and include it. On MacOS, however,
# we need to actually install a gcc first, because Apple's OS comes only shipped with clang,
# so here we download the binary.
ft_build_from_source = get(ENV, "FT_BUILD_FROM_SOURCE", Sys.isapple() ? "false" : "true")
if ft_build_from_source == "true"
extra = Sys.isapple() ? "FT_USE_APPLEBLAS=1" : Sys.iswindows() ? "FT_FFTW_WITH_COMBINED_THREADS=1" : ""
make = Sys.iswindows() ? "mingw32-make" : "make"
compiler = Sys.isapple() ? "CC=gcc-8" : "CC=gcc"
flags = Sys.isapple() ? "FT_USE_APPLEBLAS=1" : Sys.iswindows() ? "FT_FFTW_WITH_COMBINED_THREADS=1" : ""
script = """
set -e
set -x
Expand All @@ -40,12 +41,12 @@ if ft_build_from_source == "true"
git clone -b v$version https://github.com/MikaelSlevinsky/FastTransforms.git FastTransforms
fi
cd FastTransforms
make lib $compiler $extra
$make lib $compiler $flags
cd ..
mv -f FastTransforms/libfasttransforms.$extension libfasttransforms.$extension
"""
try
run(`/bin/bash -c $(script)`)
run(`bash -c $(script)`)
catch
print_error()
end
Expand Down