On Thu, Sep 5, 2019 at 9:48 PM Victor Shoup <sh...@cs.nyu.edu> wrote: > > Sigh. > "...a textbook case of underlinking..." > I guess I never read that textbook. > I guess I just didn't know there was a whole community of people and projects > who don't > like putting -pthread in their makefiles. > > I feel like this is becoming a religious war. > If it will keep the peace, I will patch my libbtool based on Dima's > suggestion.
yes, please - this would save many people a lot of time and hassle if it's done... > > Someday, I will make NTL's build system more conventional...maybe I can > find a student who can help me out. one might try to use Google Summer of Code for this purpose. (this was already pointed out in https://www.shoup.net/forum/viewtopic.php?f=1&t=14) one might make this a part of SageMath organisation proposal for the next round, if you don't feel adventurous enough to apply for GSoC funding directly. Dima > > On Thursday, September 5, 2019 at 10:35:42 AM UTC-4, Antonio Rojas wrote: >> >> >> >> El jueves, 5 de septiembre de 2019, 15:51:34 (UTC+2), Victor Shoup escribió: >>> >>> We seem to be talking past each other. >> >> >> Unfortunately it seems so. >> >>> It is also true that when I run ldd on libntl.so, I do not see anything >>> related to pthread. >>> From the comments I'm reading in https://trac.sagemath.org/ticket/28406, >>> that seems >>> to be what is "wrong". >> >> >> Do you seriously not see why this is wrong? This is a textbook case of >> underlinking. Your library is calling functions from the libpthread library, >> so it *must* link to it. This is not a matter of "conventions" or "choices", >> this is how dynamic linking works. If you refuse to acknowledge that this is >> a problem then there's certainly nothing else to discuss. >> >>> When I actually build a program, either in the build directory using NTL's >>> makefile with libtool, >>> or in another directory using a different makefile that uses g++, it works >>> fine. >> >> >> And we already have two programs that don't work: latte-integrale (al least >> the old version which I reported to you a year ago) and barvinok. And no, >> building those programs with -pthread is definitely not the solution: If a >> library A uses a function from library B and a program C uses a function >> from library A but nothing from library B then C does not have to and should >> not link to B: it's A's job to link to B. >> >>> So my understanding is that whenever you compile a multi-threaded program >>> you should pass -pthread to gcc. >> >> >> Correct. But you should *not* have to pass -pthread when you compile a >> single-threaded program and happens to use a multi-threaded library, which >> is the case here. > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-devel/4c15db12-02a6-4ee3-ad39-8bf9245812f3%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq30X-R0aZ6HEBP5-k4LdQwbPYTj6m%3DE3MfzX%3DHs60Bx8Q%40mail.gmail.com.