Skip to content

Commit

Permalink
Merge 95b7766 into 9fabc17
Browse files Browse the repository at this point in the history
  • Loading branch information
ludvigak committed Oct 19, 2018
2 parents 9fabc17 + 95b7766 commit d2ad9aa
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 49 deletions.
45 changes: 20 additions & 25 deletions .travis.yml
@@ -1,37 +1,32 @@
## Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
- linux
julia:
- 0.6
- 1.0
- nightly

notifications:
email: false
git:
depth: 99999999

## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
matrix:
allow_failures:
- julia: nightly

## uncomment and modify the following lines to manually install system packages
addons:
apt: # apt-get for linux
packages:
- gcc
- gfortran
- make
- build-essential
include:
- os: linux
julia: 0.6
- os: linux
julia: 1.0
- os: linux
julia: 0.6
osx_image: xcode9.2
- os: linux
julia: 1.0
osx_image: xcode9.2

before_install: |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update
brew install gcc@8
fi
## uncomment the following lines to override the default test script
#script:
# - julia -e 'Pkg.clone(pwd()); Pkg.build("FINUFFT"); Pkg.test("FINUFFT"; coverage=true)'
after_success:
# push coverage results to Coveralls
- julia -e 'cd(Pkg.dir("FINUFFT")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
#- julia -e 'cd(Pkg.dir("FINUFFT")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
- julia -e 'VERSION >= v"0.7.0-DEV.5183" && using Pkg; cd(Pkg.dir("FINUFFT")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'


3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -20,7 +20,7 @@ Pkg.test("FINUFFT")

This should download, build and test FINUFFT v1.0, as long as you have `gcc` and `curl` installed. The FFTW library is downloaded locally by the build script, using [Conda.jl](https://github.com/JuliaPy/Conda.jl)

Currently only tested on Linux.
Developed and tested on Linux. Also works on Max OS X, but build script is hardwired to use GCC 8 (`g++-8` and `gcc-8`).

## Usage

Expand Down Expand Up @@ -65,4 +65,3 @@ See [test/runtests.jl](test/runtests.jl)

## TODO
* Implement advanced interface
* Test on Max OS X
52 changes: 30 additions & 22 deletions deps/build.jl
Expand Up @@ -4,7 +4,7 @@ using Conda

@BinDeps.setup

# First install fftw
## First install fftw
fftw = library_dependency("libfftw3")
fftw_threads = library_dependency("libfftw3_threads")

Expand All @@ -28,7 +28,12 @@ provides(BuildProcess,
#provides(Binaries, "usr", fftw)
#provides(Binaries, "usr", fftw_threads)

# Then download and build finufft
@BinDeps.install Dict(
:libfftw3 => :fftw,
:libfftw3_threads => :fftw_threads
)

## Now fftw is in place, download and build finufft
libfinufft = library_dependency("libfinufft")

provides(Sources,
Expand All @@ -39,29 +44,32 @@ provides(Sources,
rootdir = joinpath(BinDeps.srcdir(libfinufft), "finufft-1.0")
libname = "libfinufft." * Libdl.dlext
libfile = joinpath(BinDeps.libdir(libfinufft),libname)
buildfile = joinpath(rootdir, "lib", libname)
buildfile = joinpath(rootdir, "lib", "libfinufft.so")

@show lib = BinDeps.libdir(fftw)
@show inc = BinDeps.includedir(fftw)

buildcmd = `make lib LIBRARY_PATH=$lib CPATH=$inc`
if Sys.KERNEL == :Darwin
buildcmd = `make lib/libfinufft.so LIBRARY_PATH=$lib CPATH=$inc CXX=g++-8 CC=gcc-8`
else
buildcmd = `make lib/libfinufft.so LIBRARY_PATH=$lib CPATH=$inc`
end

provides(BuildProcess,
(@build_steps begin
GetSources(libfinufft)
@build_steps begin
ChangeDirectory(rootdir)
FileRule(libfile, @build_steps begin
buildcmd
CreateDirectory(libdir(libfinufft))
`cp $buildfile $libfile`
end)
end
end),
libfinufft)
finufftbuild =
@build_steps begin
GetSources(libfinufft)
@build_steps begin
ChangeDirectory(rootdir)
buildcmd
CreateDirectory(libdir(libfinufft))
`cp $buildfile $libfile`
end
end
run(finufftbuild)

# Just add to deps.jl to bypass BinDeps checking
depsfile_location = joinpath(splitdir(Base.source_path())[1],"deps.jl")
fh = open(depsfile_location, "a")
write(fh, "\n@checked_lib libfinufft \"$libfile\"\n")
close(fh)

@BinDeps.install Dict(
:libfinufft => :libfinufft,
:libfftw3 => :fftw,
:libfftw3_threads => :fftw_threads
)

0 comments on commit d2ad9aa

Please sign in to comment.