diff --git a/.travis.yml b/.travis.yml index a43f45b..34cbb45 100644 --- a/.travis.yml +++ b/.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())' + diff --git a/README.md b/README.md index 9ee5339..00dafba 100644 --- a/README.md +++ b/README.md @@ -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 @@ -65,4 +65,3 @@ See [test/runtests.jl](test/runtests.jl) ## TODO * Implement advanced interface -* Test on Max OS X diff --git a/deps/build.jl b/deps/build.jl index f1c0c8d..3db8c4e 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -4,7 +4,7 @@ using Conda @BinDeps.setup -# First install fftw +## First install fftw fftw = library_dependency("libfftw3") fftw_threads = library_dependency("libfftw3_threads") @@ -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, @@ -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 -)