-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BinDeps integration #12
Conversation
Very nice! Seems to work for me on OSX & Julia 0.3-pre ... I will test it tomorrow on Linux. Do you know if there is some "standard" regarding binaries on Mac? Using a Homebrew formula sounds good though. Another question concerns the |
Thanks for checking, and catching my typo on the mailing list (I should take a nap). Regarding standard for binaries on Mac, see https://github.com/JuliaLang/Homebrew.jl#why-package-authors-should-use-homebrewjl - basically a Homebrew formula serves as a recipe for building binary bottles, which Elliot Saba has been nice enough to create and host. So BinDeps doesn't use the system-wide Homebrew installation, rather it uses the Julia-specific Homebrew package which is designed to primarily download binaries. That way users can get working Mac binaries without needing compilers installed, once it's all set up (unlike standard Homebrew which relies on Xcode command line tools). I think with more sophisticated use of BinDeps I could get away without pushing to LOAD_PATH. If the |
Not very surprisingly it also works on my Linux box (RHEL). I looked a bit into the INSTALL_NOTES and noticed two options Regarding Homebrew.jl, I think this would be nice to have for Sundials as well, but it could probably also be added later? A problem with explicitly pushing to LOAD_PATH in the package might arise when someone wants to use his/her own installation of the libraries? I guess that BinDeps can handle this and puts the right paths in |
Re: Lapack and Blas, I'm not familiar enough with Sundials internals to say for sure. I believe the configure script searches for The majority of code I've seen that uses Blas and Lapack expects integers to always be 32 bit (LP64 on 64 bit systems), however 64-bit Julia builds its Blas and Lapack libraries with 64 bit integers (ILP64) by default. This can cause segfaults or unexpected behavior if you try to use a library built for one with code that expects the other. There's an issue open in Julia about this and it's shown up in a few packages so far, no great solution yet. I'm not so sure what happens if you already have your own installation of the library in a system path, which I guess would've been the only way to use this package prior to this PR. Would the package get rebuilt redundantly? It looks like there are Ubuntu and Debian packages for Sundials here http://packages.ubuntu.com/precise/libsundials-serial, we can add a few lines here to let BinDeps know that apt-get (and maybe yum on Fedora?) is a possible binary provider. |
I guess that the package is not (re)built if BinDeps can find it in a system path, anything else would be strange. The problem is that you do not take that possibility into account when pushing to DL_LOAD_PATH. BinDeps probably does that when it is creating |
Yeah, I think the created |
Pass a Dictionary to https://github.com/JuliaLang/Cairo.jl/blob/master/deps/build.jl#L129-L131 (I don't remember why only four of them are specified here) https://github.com/staticfloat/Nettle.jl/blob/master/deps/build.jl |
Seems you have to do it like that
which gives in
Do we have to do this for each library (nvecserial, cvode, cvodes, ida, idas, kinsol)? |
Aha, was missing this |
I guess
would also work with your previous call to |
Awesome! Thanks for working on this. I'm surprised how short the code is. |
BinDeps can be mystifying, but it's also really powerful once you get the hang of it. |
Okay, here's a version using the deps.jl file instead of DL_LOAD_PATH. Seems to work on Linux (RHEL) and on 64 bit Windows. How's it work on Mac or on a system where Sundials is already there from the package manager? Edit: there is some trouble with the 32 bit Windows binary (access violation in |
Also works on my Mac and seems to do the right thing when Sundials was already installed (at least it creates |
32-bit Windows may need some more serious debugging. Here's what I'm seeing when I use a debug build of Sundials. Haven't gotten much useful info out of gdb yet. The C examples from Sundials run fine. Need to download a newer 32-bit Julia nightly and check if the same thing happens.
|
:-( What happens if you do the call to
|
Same crash. I have a theory, most or all instances of |
Thanks for pinning this down. But it is really weird, as you say one would have expected that it doesn't work on Win64 in the first place!? Could this depend on the compilers used for building Julia and Sundials, respectively? |
Might depend on compilers, might also be something to do with bit alignment. I was just making sure a simple test case ran without erroring or crashing, so it may have been giving incorrect results on Win64 - I should've cross-checked the numbers more carefully. |
* add BinDeps to require * first cut at linux deps/build.jl * use SimpleBuild (make install wasn't running with the Autotools BuildProcess) * add windows binary download * use deps.jl file instead of DL_LOAD_PATH
Squashed and rebased (to test incorporating the changes from #13) - this now runs without crashing on Linux 64, Windows 32, and Windows 64. Any other platforms where The numerical results from |
Bitalignment sounds plausible. Would be interesting to know if it ever worked on 32bit Linux. But this shouldn't prevent us merging your PR given the overall benefits. Anyways, it still works on the Mac. Just for reference,
How big is the difference on Win32? |
Not very
|
If you happen to have them compiled, you can compare to the output of the example ( If there are no objections (and no one else beats me to it), I am going to merge it ... |
Slight differences, but neither matches the results from Julia exactly, or the
|
The difference to Julia is probably due to the different choice of tolerances. In |
Makes sense about the tolerances. The non-simplified examples look to have tolerances that match the C versions, but also not exactly the same results. Anyway, great to get more packages easy to install. Next is making a |
Within the tolerances the results should agree. I modified I agree that we should add some tests. I am not entirely sure how to start. We could have some "simple" ODEs for which we know the solution (like in ODE.jl) or we could use the simplified examples as you say. |
Added installation "instructions" reflecting the BinDeps integration in #12.
Builds from source on Unix, downloads binaries on Windows, basic functionality appears to work.
Haven't tested this on Mac, could eventually use a Homebrew formula and supply bottles for users who don't have compilers installed.
Fixes part of #6, would be a good idea to turn the examples into tests, set up Travis, etc.
The Windows binaries were built from Cygwin as follows
for 32 bit, or replacing
i686
withx86_64
for 64 bit.