Enable fixup-libgfortran on Linux#8442
Conversation
|
Looks good, afaict it worked. Though libjulia also depends on libstdc++, which so far you haven't done anything with here. There's also libz, libtinfo, libdl, librt, libpthread, libm, and libc, but hopefully those are more likely to always be present without having to deal with as many binary incompatibilities? Not sure. |
|
I have a pretty restrictive system that I will eventually be hoping to get a |
|
Rarity isn't the only concern. It's not just whether the destination machine has a copy of the library, it's whether they have a copy of the library that is binary compatible with what was used on the build machine. I've had lots of headaches before from |
|
With |
|
Yeah, that looks familiar in a bad way (don't remember the exact details though, last time I did this kind of thing was a while ago). Is "target[ting] an old enough ABI" something that we're currently doing in Julia and I just missed it? I know there are C++ standards body proposals floating around for introducing standard platform C++ ABI's that you could force via something like |
|
I don't know of any way to target a specific ABI other than just installing on a release old enough that the target ABI is the latest. ;D It'd be really really cool if there were a way, I just stack overflowed it. |
|
@staticfloat I've built julia with llvm-svn from this PR and can confirm that 1) libraries are there 2) running on Centos 6.5 LiveCD no longer produces openblas error message. |
|
@staticfloat For targeting older glibc ABI - I suppose you can install Centos 5 chroot on Ubuntu and build Julia inside it? I think this is the easiest solution. But you must build with newer tools called devtoolset, RedHat provides them for RHEL 5 too. Scientific Linux rebuilt that devtoolset so I use it on Centos 5. |
|
Why not merge? |
Enable fixup-libgfortran on Linux
|
@ivarne if you agree, I think this is a candidate for backporting. |
|
Why not just link libgcc, libquadmath and libgfortran statically on all platforms? |
|
@staticfloat please backport anything you see fit. I have only the slightest clue about what this patch does, so no opinion from me. |
Please don't. It's painfully difficult to actually do this, it can interfere with exception handling across shared library boundaries, you need a specially-compiled GCC for it to be possible on Linux, it increases duplication and binary sizes, etc etc. Matlab on Linux (and Mac too I think) has to bundle its own copies of libgcc, libstdc++, and libgfortran. I don't think Octave, SciPy, or R have Linux binary installers that aren't through package managers, but if they do I suspect they're bundling libgfortran etc rather than statically linking. |
|
Crap, this broke packages with compiled Fortran dependencies: @staticfloat, are the buildbots using a modern version of gfortran? Bundling libgfortran like this has put us into Matlab-like territory of causing incompatibility between our binaries (which always have the bundled gcc libs dlopen'ed) and any libraries built by system compilers. |
|
Sigh. It looks like the devtoolset distributed by CERN doesn't ship dynamic libraries of I'll spin up a CentOS 6 machine so that I can install |
|
Thanks for checking.
Oh, so even more like Matlab then, but not intentionally :-P
That will depend on whether or not it was compiled with |
|
Bump. @staticfloat any additional info here? |
|
I have confirmed |
|
Thanks! But crap, so what do we do about this? Is the devtoolset capable of statically linking libgfortran into a shared library? This requires that it was compiled with |
|
Or could the devtoolset people be convinced to ship a shared libgfortran? I wonder how often they release new versions... @nalimilan any suggestions? |
|
I have no idea, except that AFAIK the devtoolset is a repackaged version of the one RedHat releases, and they will likely be very conservative about what they ship given that they offer long-term support to their customers. |
|
|
|
Yeah, that flag doesn't work on Linux with GCC > 4.5 due to libquadmath. I don't think any of the libraries we use actually do any quad-precision operations though. So if we explicitly link against the full path of |
|
Fired up a docker container of CentOS 5 and tried out devtoolset-2 on it. There is a |
|
I have an idea that might allow us to fix this without needing to build our own GCC. @staticfloat can you try the following on the Centos 5 buildbot? Then if you rebuild openspecfun, openblas, and arpack, the devtoolset linker script should result in a shared-library dependency on this We'll need to test the resulting tarballs, but I think this might give us the newer libgfortran ABI's. |
|
Unfortunately, I don't think this works quiiiiiite right: So we're still not getting |
|
I'd be surprised if development tooling for a PHP VM went to extra lengths to include Fortran support... If we can't find something pre-packaged that will work, GCC isn't all that hard to compile ourselves. Just a bit time consuming. |
|
BUMP! We need to fix this. Like, before our next release. Which should be in about a week. |
|
I'm currently trying to build GCC manually. We'll see where this takes us. |
|
Fantastic, thank you. Be sure to specify |
|
Alright, I compiled GCC 4.8 on the buildbots, then built |
|
403 forbidden |
|
Whoopsies. Fixed. |
|
Your intuition was right. In a docker container of centos 5: We're already bundling libgfortran, I don't think adding libstdc++ to that would be so bad. The alternative would be to try hacking things to link statically, which would require a different compilation of GCC using |
|
Yes, I had tried to generate a "static compiler", but ran into some issues. Those issues later turned out to be because I wasn't including |
|
Have to save it to |
|
Oh right, the spawn test fails if you don't have I'll try using these binaries for the problematic package with Fortran dependencies on Travis and see how it looks. |
|
Worked perfectly!!! Didn't need to worry about libstdc++ on Travis, Ubuntu 12.04 is apparently good enough. https://api.travis-ci.org/jobs/49236855/log.txt?deansi=true So do we add libstdc++.so.6 to this script, switch the buildbots to use your new compiler, and call this fixed? |
|
To demystify the |
|
12.04 ships with 4.6. They don't break the ABI on every minor version, just some of them. |
|
Furthermore, I believe the ABI is set on a per-function basis. |
See #8397 for more detail.
@crayxt @tkelman Could you try this out and make sure it works for you?