Skip to content

Commit 33b68b0

Browse files
minor fixes post #87
1 parent fad537b commit 33b68b0

File tree

3 files changed

+31
-50
lines changed

3 files changed

+31
-50
lines changed

.travis.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ matrix:
1414
- julia: nightly
1515
addons:
1616
apt:
17-
packages:
18-
- libquadmath0
19-
- libgomp1
20-
- libopenblas-dev
21-
- libfftw3-dev
22-
- libmpfr-dev
17+
packages: ['libquadmath0', 'libgomp1', 'libopenblas-dev', 'libfftw3-dev', 'libmpfr-dev']
2318
homebrew:
24-
packages:
25-
- gcc@8
26-
- fftw
27-
- mpfr
19+
packages: ['gcc@8', 'fftw', 'mpfr']
2820
update: true
2921

3022
notifications:

deps/build.jl

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,68 @@
11
using BinaryProvider
22
import Libdl
33

4-
version = "0.2.7"
4+
version = v"0.2.8"
55

66
if arch(platform_key_abi()) != :x86_64
77
@warn "FastTransforms has only been tested on x86_64 architectures."
88
end
9-
if !Sys.islinux() && !Sys.isapple()
10-
error("Sorry ... unsupported OS. Feel free to file a PR to add support.")
11-
end
129

13-
const extension = Sys.isapple() ? "dylib" : "so"
10+
const extension = Sys.isapple() ? "dylib" : Sys.islinux() ? "so" : Sys.iswindows() ? "dll" : ""
11+
1412
print_error() = error(
15-
"FastTransforms could not be properly installed.\nCheck you have all dependencies installed." *
16-
" To install the dependencies you can use:\n" *
17-
"On Ubuntu / Debian \n" *
18-
" sudo apt install gcc libblas-dev libopenblas-base libfftw3-dev libmpfr-dev\n" *
19-
"On MacOS \n" *
20-
" brew install gcc@8 fftw mpfr\n"
13+
"FastTransforms could not be properly installed.\n Please check that you have all dependencies installed. " *
14+
"Sample installation of dependencies:\n" *
15+
print_platform_error(platform_key_abi())
2116
)
2217

18+
print_platform_error(p::Platform) = "On $(BinaryProvider.platform_name(p)), please consider opening a pull request to add support.\n"
19+
print_platform_error(::MacOS) = "On MacOS\n\tbrew install gcc@8 fftw mpfr\n"
20+
print_plaftorm_error(::Linux) = "On Linux\n\tsudo apt-get install gcc-8 libblas-dev libopenblas-base libfftw3-dev libmpfr-dev\n"
21+
print_plaftorm_error(::Windows) = "On Windows\n\tvcpkg install openblas:x64-windows fftw3[core,threads]:x64-windows mpir:x64-windows mpfr:x64-windows\n"
22+
2323
# Rationale is as follows: The build is pretty fast, so on Linux it is typically easiest
2424
# to just use the gcc of the system to build the library and include it. On MacOS, however,
2525
# we need to actually install a gcc first, because Apple's OS comes only shipped with clang,
2626
# so here we download the binary.
2727
ft_build_from_source = get(ENV, "FT_BUILD_FROM_SOURCE", Sys.isapple() ? "false" : "true")
2828
if ft_build_from_source == "true"
29-
println("Building from source.")
30-
31-
extra = Sys.isapple() ? "FT_USE_APPLEBLAS=1" : ""
29+
extra = Sys.isapple() ? "FT_USE_APPLEBLAS=1" : Sys.iswindows() ? "FT_FFTW_WITH_COMBINED_THREADS=1" : ""
30+
compiler = Sys.isapple() ? "CC=gcc-8" : "CC=gcc"
3231
script = """
3332
set -e
3433
set -x
35-
3634
if [ -d "FastTransforms" ]; then
3735
cd FastTransforms
3836
git fetch
39-
git reset --hard
40-
git checkout -b v$version
37+
git checkout v$version
4138
cd ..
4239
else
4340
git clone -b v$version https://github.com/MikaelSlevinsky/FastTransforms.git FastTransforms
4441
fi
45-
ln -sf FastTransforms/libfasttransforms.$extension libfasttransforms.$extension
46-
47-
echo
48-
echo
49-
5042
cd FastTransforms
51-
make clean
52-
make lib $extra
43+
make lib $compiler $extra
44+
cd ..
45+
mv -f FastTransforms/libfasttransforms.$extension libfasttransforms.$extension
5346
"""
54-
5547
try
5648
run(`/bin/bash -c $(script)`)
57-
catch IOError
49+
catch
5850
print_error()
5951
end
52+
println("FastTransforms built from source.")
6053
else
61-
println("Installing by downloading binaries.")
62-
6354
const GCC = BinaryProvider.detect_compiler_abi().gcc_version
6455
namemap = Dict(:gcc4 => "gcc-4.9", :gcc5 => "gcc-5", :gcc6 => "gcc-6",
6556
:gcc7 => "gcc-7", :gcc8 => "gcc-8", :gcc9 => "gcc-9")
6657
if !(GCC in keys(namemap))
6758
error("Please ensure you have a version of gcc from gcc-4.9 to gcc-9.")
6859
end
69-
download("https://github.com/MikaelSlevinsky/FastTransforms/releases/download/" *
70-
"v$version/libfasttransforms.v$version.$(namemap[GCC]).$extension",
71-
joinpath(dirname(@__DIR__), "deps", "libfasttransforms.$extension"))
72-
end
73-
74-
const lft_directiory = joinpath(dirname(@__DIR__), "deps")
75-
const libfasttransforms = Libdl.find_library("libfasttransforms", [lft_directiory])
76-
if libfasttransforms === nothing || length(libfasttransforms) == 0
77-
print_error()
60+
try
61+
download("https://github.com/MikaelSlevinsky/FastTransforms/releases/download/" *
62+
"v$version/libfasttransforms.v$version.$(namemap[GCC]).$extension",
63+
joinpath(dirname(@__DIR__), "deps", "libfasttransforms.$extension"))
64+
catch
65+
print_error()
66+
end
67+
println("FastTransforms installed by downloading binaries.")
7868
end

src/libfasttransforms.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
const lft_directiory = joinpath(dirname(@__DIR__), "deps")
2-
const libfasttransforms = find_library("libfasttransforms", [lft_directiory])
1+
const libfasttransforms = find_library("libfasttransforms", [joinpath(dirname(@__DIR__), "deps")])
32

4-
if libfasttransforms === nothing || length(libfasttransforms) == 0
3+
if libfasttransforms nothing || length(libfasttransforms) == 0
54
error("FastTransforms is not properly installed. Please run Pkg.build(\"FastTransforms\") ",
65
"and restart Julia.")
76
end

0 commit comments

Comments
 (0)