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
Get libs.mwrank to compile on OS X 10.4 #16017
Comments
comment:1
Leif's idea seems to have been right, though I don't know that setting the DYLD_ whatever path or rpath is any easier that what seemed to do it for me - just adding an explicit dependency in src/module_list.py, as we often do for Cygwin, which is more finicky. From the thread: But the problem is that somehow the linking isn't happening properly in sage/libs/mwrank, and indeed -lflint isn't in the line g++ -bundle -undefined dynamic_lookup -L/Users/student/Desktop/sage-6.2.beta4/local/lib build/temp.macosx-10.4-ppc-2.7/sage/libs/mwrank/mwrank.o build/temp.macosx-10.4-ppc-2.7/sage/libs/mwrank/wrap.o -L/Users/student/Desktop/sage-6.2.beta4/local/lib -lcsage -lec -lntl -lpari -lgmp -lgmpxx -lstdc++ -lm -lstdc++ -lntl -o build/lib.macosx-10.4-ppc-2.7/sage/libs/mwrank/mwrank.so Maybe could I add something to src/module_list.py or whatever the appropriate file is now to force -lflint as well? On Cygwin we often had to be more explicit because of something analogous, if I recall that correctly. I'm going to try this just to see... It seems to work! At least, things continue compiling. On Cygwin that was always the sign of victory, though :) So Leif's idea was probably the right one. I'll see if things finish up first and then run tests - John, any files I should run tests on first to make sure this did indeed compile and link correctly? However, I don't know the right fix. I don't mind including extra things in module_list.py since probably Cygwin likes them too, but perhaps there is a better fix, or maybe there's a reason that's a bad fix, or something. |
comment:2
Also required for sage.libs.cremona extensions. Given that on Cygwin we will probably need this too, I'm suggesting that this is the right solution now. |
comment:3
I'm pretty curious whether -- with the "superfluous"
The addition is IMHO just a work-around (on Darwin 8; still probably necessary on Cygwin); it doesn't address the root of the problem (provided we can trust the linker messages). (Cf. my recent comment on the Sage 6.2.beta4 thread on sage-release.) |
comment:4
... in other words: Where the heck does the linker try to find the Could Apple's |
comment:5
No, no warnings if I use that. I really think it just doesn't know where to find it. This happened on Cygwin all the time, like I said. Yes, it's certainly just a workaround, but one that I can't really see a downside to. I have no idea where it is looking, and I have pretty much run out of energy on this now that I found what I think it is an acceptable solution. Not that I don't want a better one, but my sense is there may not be one that doesn't involve special casing a |
comment:6
Try using https://github.com/cschwan/sage-on-gentoo/blob/master/sci-mathematics/flint/files/flint-2.4-makefile.patch in the patches folder for flint. Then in spkg-install
before $MAKE |
comment:7
Thanks, that sounds fine too if it works, but I won't be able to try this until Monday. Since we have several workarounds now, and since (for now) this is still a supported platform, I'm making this a blocker for 6.2. |
comment:8
leif@bsd:~/Sage/sage-6.2.beta5$ otool -DL local/lib/libec.dylib
local/lib/libec.dylib:
/Users/leif/Sage/sage-6.2.beta5/local/lib/libec.0.dylib (compatibility version 1.0.0, current version 1.0.0)
libflint.dylib (compatibility version 0.0.0, current version 0.0.0)
/Users/leif/Sage/sage-6.2.beta5/local/lib/libntl.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/Users/leif/Sage/sage-6.2.beta5/local/var/tmp/sage/build/pari-2.5.5b.p1/src/Odarwin-i386/libpari-gmp.dylib (compatibility version 2.5.0, current version 2.5.5)
/Users/leif/Sage/sage-6.2.beta5/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.17.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/Users/leif/Sage/sage-6.2.beta5/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) Interesting... (Note the recorded path to the PARI library!) But we (also) already have
And FWIW, in the build on bsd.math, |
comment:9
For completeness, this is how
So indeed the (missing or weird) |
comment:10
Replying to @nexttime:
And if I remove
I guess doing so would trigger another "no such file or directory" warning on Karl-Dieter's machine. MacOS X 10.6's linker is simply "smarter"... |
comment:11
So we may also want to look at pari because it put the build time location rather than final location in install name. Not a problem if you tell sage to keep the build stuff I guess. |
comment:12
I actually have a patch for pari's installname that I made for pari 2.5.0 and it is still in the gentoo and sage-on-gentoo trees, I guess I should try to it merged in pari proper.
We can alter libflint.dylib and libec.dylib with the appropriate values and see if sage compile. |
comment:13
Replying to @kiwifb:
Yep, but he'd have to rebuild eclib (after changing libflint's [and perhaps libpari's] Any idea why |
comment:14
First yes you can.
About libtool, not sure. I always felt rpath was redundant with the install_name mechanism but that's not really an answer to your question. |
comment:15
Replying to @kiwifb:
Cool. \o/
Well, by default |
comment:16
Yikes! As long as I have a specific thing to try out on Monday I'll be happy - if you guys can agree on what I should try, I don't have infinite time with that machine ;-) |
comment:17
Try the equivalent for your machine of:
in $SAGE_LOCAL/lib. Don't forget to replace the path for SAGE_LOCAL with what's correct for you. |
comment:18
Replying to @kcrisman:
There are plenty of things you could try... :-) But I think kiwifb and me agree on that you could first try to:
$ cd $SAGE_ROOT
$ otool -D local/lib/libflint.dylib
local/lib/libflint.dylib:
libflint.dylib
$ install_name_tool -id `pwd`/local/lib/libflint.dylib local/lib/libflint.dylib
$ otool -L local/lib/libec.0.dylib # just to check libflint's name there
local/lib/libec.0.dylib:
<path to>/sage-6.2.beta5/local/lib/libec.0.dylib (compatibility version 1.0.0, current version 1.0.0)
libflint.dylib (compatibility version 0.0.0, current version 0.0.0)
...
$ install_name_tool -change libflint.dylib `pwd`/local/lib/libflint.dylib local/lib/libec.0.dylib # now really change the name
$ otool -L local/lib/libec.0.dylib # just to verify it changed
local/lib/libec.0.dylib:
<path to>/sage-6.2.beta5/local/lib/libec.0.dylib (compatibility version 1.0.0, current version 1.0.0)
<path to>/sage-6.2.beta5/local/lib/libflint.dylib (compatibility version 0.0.0, current version 0.0.0)
...
$ touch src/sage/libs/mwrank/mwrank.pyx # and more if you like
$ ./sage -b # and now rebuild The linker should now be able to locate Optionally, repeat the steps analogously for $ otool -D local/lib/libpari-gmp.dylib
local/lib/libpari-gmp.dylib:
<path to>/sage-6.2.beta5/local/var/tmp/sage/build/pari-2.5.5b.p1/src/Odarwin-i386/libpari-gmp.dylib ( When you change the name (again in $ install_name_tool -change /Users/leif/Sage/sage-6.2.beta5/local/var/tmp/sage/build/pari-2.5.5b.p1/src/Odarwin-i386/libpari-gmp.dylib `pwd`/local/lib/libpari-gmp.dylib local/lib/libec.0.dylib (Just as an example -- note that the invalid path will differ on a PowerPC, and of course your |
comment:19
Just for the record: I started writing before François replied... 8) But we (still) agree on what you could try. |
comment:20
Yes we do. Just using install_name_tool means that we can test that theory without rebuilding flint and eclib, which would take some time on that machine. |
comment:21
Replying to @kiwifb:
Note that the second line wouldn't work (it's a no-op). If you want to change the |
comment:22
Well spotted. I was a bit too eager there and I had completely forgotten about that important detail. |
comment:23
For the record, |
comment:24
Ok, I'm trying this. Thank you leif for the VERY explicit steps, which start to help me understand even what these files even are. The |
This comment has been minimized.
This comment has been minimized.
comment:45
Replying to @kiwifb:
And apparently the R dylibs as well - see #16044, and of course fbissey and leif discovered these too :) |
Branch: u/fbissey/flint2.4.3 |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Author: François Bissey |
Reviewer: Karl-Dieter Crisman |
comment:49
From my point of view this is fine - upstream does seem to have a couple other changes since the previous release so it seems good to test this on a few other machines just in case there is some problem. But presumably those problems would also be problems elsewhere. |
comment:50
Right. I haven't run doctests against it yet so I will. I am putting this back to "need work" because I forgot to generate the checksum :( |
comment:51
So... will this fix be non-movable? (I.e., on any platform, on this one...) See leif's comment on #16044. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:53
Replying to @kcrisman:
Basically yes, unless we find variables that overrides the install_names effectively. Note that once your install is moved, if we find variables overrides to make it work, you'll probably be screwed if you try to upgrade in the new location. On linux LD_LIBRARY_PATH is a very effective override to anything you put in an elf, so regardless of Volker's comment about dangling rpath they are screened by LD_LIBRARY_PATH. Even on linux upgrading in the new location is probably leaving a mess behind, but LD_LIBRARY_PATH is a good safety blanket most of the time. Putting this for review now that I have put the checksums. |
comment:54
Hmm, I don't know if I like that. I'd at least want to see what happened here. How will relocation issues be a problem with people downloading binaries? (I assume this change in flint would cause problems for all Mac platforms, not just ours, since the extra flag and hence full name comes in on all Darwin, not just this Darwin 8, based on the patch.) |
comment:55
Replying to @kcrisman:
For FLINT and w.r.t. relocating Sage, the patch would only (effectively) make a difference on MacOS X 10.4. If relocation is (at least partially) broken on Darwin anyway, the change doesn't make a difference to the others, i.e., it doesn't really worsen the situation. On Darwin, we have absolute paths in (most of) all other libraries already; fixing that is subject of another ticket I'd say. Disclaimer: I don't know at all what the Mac app currently does; but if it behaves differently, I'd rather expect it to be smarter w.r.t. "relocation". |
comment:56
According to http://wiki.sagemath.org/SupportedPlatforms the Mac App doesn't work at all on OSX 10.4 |
comment:57
Replying to @nexttime:
Ways to go (not excluding each other):
*Ads by G!*gle Buy the compiler wrapper NOW!!! |
comment:58
Huh, that surprises me. There is one built, anyway, and distributed via the mirrors for 5.13. I can check that later - it should still work okay. |
Changed reviewer from Karl-Dieter Crisman to Karl-Dieter Crisman, Volker Braun |
Changed branch from u/fbissey/flint2.4.3 to |
See lots of discussion at this sage-release thread. Best guesses are either this Flint bug and leif's idea that there is a missing linker flag on Darwin (see the sage-release thread).
This is not eclib's fault, but due to incomplete / wrong "
install_name
s" (meant to be absolute paths) in libflint.dylib (and also libpari-gmp.dylib).On Darwin 10 (MacOS X 10.6) and later, apparently the linker is smarter (or more tolerant), and does find the indirectly used libraries in
$SAGE_LOCAL/lib/
, despite their wronginstall_name
s.We can solve this by upgrading flint to 2.4.3 which includes the necessary fix.
New sources:
CC: @nexttime @vbraun @jpflori
Component: packages: standard
Keywords: Darwin 8 linker error install_name libflint.dylib
Author: François Bissey
Branch/Commit:
6c25897
Reviewer: Karl-Dieter Crisman, Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/16017
The text was updated successfully, but these errors were encountered: