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. Someday, I will make NTL's build system more conventional...maybe I can find a student who can help me out. 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 >> <https://www.google.com/url?q=https%3A%2F%2Ftrac.sagemath.org%2Fticket%2F28406&sa=D&sntz=1&usg=AFQjCNGrwfVRTUQ4wc8gDByCwBimhxvMtA>, >> >> 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.