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/d5d34af5-e8ae-4a94-8a98-c5da30ff1550%40googlegroups.com.