JuliaAstro / FITSIO.jl

Flexible Image Transport System (FITS) file support for Julia
http://juliaastro.org/FITSIO.jl/
MIT License
55 stars 29 forks source link

Enable travis and coveralls #17

Closed kbarbary closed 9 years ago

kbarbary commented 9 years ago

I just enabled travis and coveralls on the respective websites.

This adds the .travis.yml file and badges to the README.

kbarbary commented 9 years ago

The travis build is failing. Looks like the shared library is not being created in the build. I tried to reproduce this locally by removing the built library and running Pkg.build("FITSIO"). But, this is picking up my system-installed libcfitsio instead of building from the source in the deps directory.

Is there a way to force the build without uninstalling my system libcfitsio?

Would it be advisable to always build from source in FITSIO.jl to ensure that everyone has the same libcfitsio?

nolta commented 9 years ago

Strange, seems like the shared lib should exist: https://travis-ci.org/JuliaAstro/FITSIO.jl/jobs/40326257#L422

nolta commented 9 years ago

(that last link should have highlighted line 422, but i guess that doesn't work)

nolta commented 9 years ago

I tried running the travis script in an ubuntu1404 vm, and it worked. Don't understand why this is failing.

kbarbary commented 9 years ago

I was able to reproduce this, or something like it, once I uninstalled my system libcfitsio. After doing Pkg.build("FITSIO"), this is the contents of the generated deps/deps.jl file:

macro checked_lib(libname, path)
    (dlopen_e(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\n
Please re-run Pkg.build(package), and restart Julia.")
    quote const $(esc(libname)) = $path end
end
@checked_lib libcfitsio "./libcfitsio.so"

Then using FITSIO fails with the message

julia> using FITSIO
ERROR: Unable to load 

libcfitsio (./libcfitsio.so)

I don't fully understand what BinDeps is doing when it generates the deps.jl file, but it looks like it has the path to the shared library wrong. The Travis error is slightly different (libcfitsio.so instead of ./libcfitsio.so).

I'm on Ubuntu 14.04.

kbarbary commented 9 years ago

I should also note that I'm on Julia 0.3.2 and BinDeps 0.3.6.

nolta commented 9 years ago

What's in FITSIO/deps/usr/lib?

kbarbary commented 9 years ago

That looks good:

$ pwd
/home/kyle/.julia/v0.3/FITSIO/deps/usr/lib
$ ls
libcfitsio.a  libcfitsio.so  libcfitsio.so.2  libcfitsio.so.2.3.36  pkgconfig
nolta commented 9 years ago

I'm also on julia 0.3.2 and BinDeps 0.3.6.

nolta commented 9 years ago

What's

nolta commented 9 years ago

Stupid github buttons.

nolta commented 9 years ago

My guess is that BinDeps is getting confused because of FITSIO/deps/src/cfitsio/libcfitsio.so. Have you modified LD_LIBRARY_PATH?

kbarbary commented 9 years ago

That would be it... I had . in LD_LIBRARY_PATH for some other development! Sorry for the noise. Pkg.build("FITSIO") works for me locally with both clang and gcc.

kbarbary commented 9 years ago

The shared lib is definitely there in the travis build: https://travis-ci.org/JuliaAstro/FITSIO.jl/jobs/40511657 (see L453)

But the deps.jl file has it wrong (see L457).

nolta commented 9 years ago

Stab in the dark

--- a/deps/build.jl
+++ b/deps/build.jl
@@ -7,6 +7,7 @@ url = "ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio$version.tar.gz"
 libcfitsio = library_dependency("libcfitsio")
 provides(Sources, URI(url), libcfitsio, unpacked_dir="cfitsio")
 depsdir = BinDeps.depsdir(libcfitsio)
+pwddir = pwd()
 srcdir = joinpath(depsdir, "src", "cfitsio")
 prefix = joinpath(depsdir, "usr")
 @unix_only libfilename = "libcfitsio.so"
@@ -21,6 +22,7 @@ provides(BuildProcess,
                          `./configure --prefix=$prefix`
                          `make shared install`
                          end)
+                ChangeDirectory(pwddir)
             end
          end),
          libcfitsio)
kbarbary commented 9 years ago

Hmmm... should we ask some BinDeps experts? Or just give up and install libcfitsio via apt-get on Travis?

nolta commented 9 years ago

Let's just use the apt package.

coveralls commented 9 years ago

Coverage Status

Changes Unknown when pulling f37d5cb8e7c9e52744d07cdcf8efad12d398e642 on kbarbary:add-travis into \ on JuliaAstro:master**.

kbarbary commented 9 years ago

Note that I just corrected an error in a badge URL directly on master.