Skip to content

Commit 0732c9b

Browse files
Switch to FastTransforms_jll (#92)
* try using FastTransforms_jll * preserve option to build from source, but default is false remove the option to grab binaries from releases because they're built with -march=native, which is technically unsafe * Create .cirrus.yml * Update README.md * add Cirrus badge * Update hermitetests.jl * maintain the right to build from source but this is not tested * minor release 0.8
1 parent 1be949b commit 0732c9b

File tree

9 files changed

+43
-59
lines changed

9 files changed

+43
-59
lines changed

.appveyor.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
# Documentation: http://www.appveyor.com/docs/appveyor-yml/
2-
image: Visual Studio 2017
3-
4-
cache: c:\tools\vcpkg\installed\
5-
6-
platform: x64
7-
81
environment:
92
matrix:
10-
- julia_version: 1.0
11-
- julia_version: 1.1
12-
- julia_version: 1.2
133
- julia_version: 1.3
144
- julia_version: nightly
155

6+
platform:
7+
- x86 # 32-bit
8+
- x64 # 64-bit
9+
1610
# # Uncomment the following lines to allow failures on nightly julia
1711
# # (tests will run but not make your overall status red)
1812
matrix:
@@ -32,10 +26,6 @@ notifications:
3226

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

4030
build_script:
4131
- echo "%JL_BUILD_SCRIPT%"

.cirrus.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
freebsd_instance:
2+
image: freebsd-12-0-release-amd64
3+
task:
4+
name: FreeBSD
5+
env:
6+
matrix:
7+
- JULIA_VERSION: 1.3
8+
- JULIA_VERSION: nightly
9+
install_script:
10+
- sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)"
11+
build_script:
12+
- cirrusjl build
13+
test_script:
14+
- cirrusjl test
15+
coverage_script:
16+
- cirrusjl coverage codecov coveralls

.travis.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,11 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 1.0
8-
- 1.1
9-
- 1.2
107
- 1.3
118
- nightly
129
matrix:
1310
allow_failures:
1411
- julia: nightly
15-
addons:
16-
apt:
17-
packages: ['libquadmath0', 'libgomp1', 'libopenblas-dev', 'libfftw3-dev', 'libmpfr-dev']
18-
homebrew:
19-
packages: ['gcc@8', 'fftw', 'mpfr']
20-
update: true
21-
2212
notifications:
2313
email: false
2414
after_success:

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
name = "FastTransforms"
22
uuid = "057dd010-8810-581a-b7be-e3fc3b93f78c"
3-
version = "0.7.0"
3+
version = "0.8.0"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
77
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
88
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
99
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
1010
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
11+
FastTransforms_jll = "34b6f7d7-08f9-5794-9e10-3819e4c7e49a"
1112
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1213
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1314
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
@@ -24,4 +25,4 @@ FastGaussQuadrature = "0.4"
2425
Reexport = "0.2"
2526
SpecialFunctions = "0.8"
2627
ToeplitzMatrices = "0.6"
27-
julia = "1"
28+
julia = "≥ 1.3"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# FastTransforms.jl
22

3-
[![Travis](https://travis-ci.org/JuliaApproximation/FastTransforms.jl.svg?branch=master)](https://travis-ci.org/JuliaApproximation/FastTransforms.jl) [![AppVeyor](https://ci.appveyor.com/api/projects/status/oba9qush15q3x8pb/branch/master?svg=true)](https://ci.appveyor.com/project/MikaelSlevinsky/fasttransforms-jl/branch/master) [![codecov](https://codecov.io/gh/JuliaApproximation/FastTransforms.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaApproximation/FastTransforms.jl) [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaApproximation.github.io/FastTransforms.jl/stable) [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaApproximation.github.io/FastTransforms.jl/latest)
3+
[![Travis](https://travis-ci.org/JuliaApproximation/FastTransforms.jl.svg?branch=master)](https://travis-ci.org/JuliaApproximation/FastTransforms.jl) [![AppVeyor](https://ci.appveyor.com/api/projects/status/oba9qush15q3x8pb/branch/master?svg=true)](https://ci.appveyor.com/project/MikaelSlevinsky/fasttransforms-jl/branch/master) [![Cirrus](https://api.cirrus-ci.com/github/JuliaApproximation/FastTransforms.jl.svg)](https://cirrus-ci.com/github/JuliaApproximation/FastTransforms.jl) [![codecov](https://codecov.io/gh/JuliaApproximation/FastTransforms.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaApproximation/FastTransforms.jl) [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaApproximation.github.io/FastTransforms.jl/stable) [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaApproximation.github.io/FastTransforms.jl/latest)
44

55
`FastTransforms.jl` allows the user to conveniently work with orthogonal polynomials with degrees well into the millions.
66

77
This package provides a Julia wrapper for the [C library](https://github.com/MikaelSlevinsky/FastTransforms) of the same name. Additionally, all three types of nonuniform fast Fourier transforms are available, as well as the Padua transform.
88

99
## Installation
1010

11-
The build script, which works on macOS, Linux, and Windows systems, downloads precompiled binaries of the latest version of [FastTransforms](https://github.com/MikaelSlevinsky/FastTransforms) or builds them from source, as governed by the environment variable `FT_BUILD_FROM_SOURCE=true/false`. This library depends on `FFTW`, `MPFR`, and `OpenBLAS` (on Linux and Windows), which must be present for a successful build. With dependencies, installation may be as straightforward as:
11+
Installation, which uses [BinaryBuilder](https://github.com/JuliaPackaging/BinaryBuilder.jl) for Intel processors (Sandybridge and beyond), may be as straightforward as:
1212

1313
```julia
1414
pkg> add FastTransforms

deps/build.jl

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using BinaryProvider
22
import Libdl
33

4-
version = v"0.2.9"
4+
version = v"0.2.12"
55

66
if arch(platform_key_abi()) != :x86_64
77
@warn "FastTransforms has only been tested on x86_64 architectures."
@@ -20,11 +20,7 @@ print_platform_error(p::MacOS) = "On MacOS\n\tbrew install gcc@8 fftw mpfr\n"
2020
print_platform_error(p::Linux) = "On Linux\n\tsudo apt-get install gcc-8 libblas-dev libopenblas-base libfftw3-dev libmpfr-dev\n"
2121
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"
2222

23-
# Rationale is as follows: The build is pretty fast, so on Linux it is typically easiest
24-
# to just use the gcc of the system to build the library and include it. On MacOS, however,
25-
# we need to actually install a gcc first, because Apple's OS comes only shipped with clang,
26-
# so here we download the binary.
27-
ft_build_from_source = get(ENV, "FT_BUILD_FROM_SOURCE", Sys.isapple() ? "false" : "true")
23+
ft_build_from_source = get(ENV, "FT_BUILD_FROM_SOURCE", "false")
2824
if ft_build_from_source == "true"
2925
make = Sys.iswindows() ? "mingw32-make" : "make"
3026
compiler = Sys.isapple() ? "CC=gcc-8" : "CC=gcc"
@@ -51,19 +47,4 @@ if ft_build_from_source == "true"
5147
print_error()
5248
end
5349
println("FastTransforms built from source.")
54-
else
55-
const GCC = BinaryProvider.detect_compiler_abi().gcc_version
56-
namemap = Dict(:gcc4 => "gcc-4.9", :gcc5 => "gcc-5", :gcc6 => "gcc-6",
57-
:gcc7 => "gcc-7", :gcc8 => "gcc-8", :gcc9 => "gcc-9")
58-
if !(GCC in keys(namemap))
59-
error("Please ensure you have a version of gcc from gcc-4.9 to gcc-9.")
60-
end
61-
try
62-
download("https://github.com/MikaelSlevinsky/FastTransforms/releases/download/" *
63-
"v$version/libfasttransforms.v$version.$(namemap[GCC]).$extension",
64-
joinpath(dirname(@__DIR__), "deps", "libfasttransforms.$extension"))
65-
catch
66-
print_error()
67-
end
68-
println("FastTransforms installed by downloading binaries.")
6950
end

src/FastTransforms.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module FastTransforms
22

3-
using DSP, FastGaussQuadrature, Libdl, LinearAlgebra, SpecialFunctions, ToeplitzMatrices
4-
using Reexport
3+
using DSP, FastGaussQuadrature, LinearAlgebra
4+
using Reexport, SpecialFunctions, ToeplitzMatrices
5+
56
@reexport using AbstractFFTs
67
@reexport using FFTW
78

@@ -19,11 +20,11 @@ import AbstractFFTs: Plan, ScaledPlan,
1920
rfft_output_size, brfft_output_size,
2021
plan_inv, normalization
2122

23+
import DSP: conv
24+
2225
import FFTW: dct, dct!, idct, idct!, plan_dct!, plan_idct!,
2326
plan_dct, plan_idct, fftwNumber
2427

25-
import DSP: conv
26-
2728
import FastGaussQuadrature: unweightedgausshermite
2829

2930
import LinearAlgebra: mul!, lmul!, ldiv!

src/libfasttransforms.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
const libfasttransforms = find_library("libfasttransforms", [joinpath(dirname(@__DIR__), "deps")])
2-
3-
if libfasttransforms nothing || length(libfasttransforms) == 0
4-
error("FastTransforms is not properly installed. Please run Pkg.build(\"FastTransforms\") ",
5-
"and restart Julia.")
1+
ft_build_from_source = get(ENV, "FT_BUILD_FROM_SOURCE", "false")
2+
if ft_build_from_source == "true"
3+
using Libdl
4+
const libfasttransforms = find_library("libfasttransforms", [joinpath(dirname(@__DIR__), "deps")])
5+
if libfasttransforms nothing || length(libfasttransforms) == 0
6+
error("FastTransforms is not properly installed. Please run Pkg.build(\"FastTransforms\") ",
7+
"and restart Julia.")
8+
end
9+
else
10+
using FastTransforms_jll
611
end
712

813
function ft_fftw_plan_with_nthreads(n::Integer)

test/hermitetests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ hermitepoints(n) = FastGaussQuadrature.unweightedgausshermite( n )[1]
77
@test hermitepoints(100_000)[end] 446.9720305443094
88

99
@test weightedhermitetransform([1.0]) == [1.0]
10-
@test weightedhermitetransform(exp.(-hermitepoints(2).^2/2)) == [1.0,0.0]
10+
@test weightedhermitetransform(exp.(-hermitepoints(2).^2/2)) [1.0,0.0]
1111
@test weightedhermitetransform(exp.(-hermitepoints(3).^2/2)) [1.0,0.0,0.0]
1212
@test weightedhermitetransform(exp.(-hermitepoints(1000).^2/2)) [1.0; zeros(999)]
1313
@test weightedhermitetransform(exp.(-hermitepoints(3000).^2/2)) [1.0; zeros(2999)]

0 commit comments

Comments
 (0)