Open maxale opened 4 months ago
PR welcome.
Also, while Sage says
configure:23219: will use system package and not install SPKG ntl
, it uses not the system-provided package (which would be/usr/lib/x86_64-linux-gnu/libntl.a
) but a locally-installed one (/usr/local/lib/libntl.a
) instead.
that's what we understand by "system". Something that is found by the compiler/linker's default settings. In particular /usr/local is a legitimate location in this sense. It's also pretty much standard on macOS (with Homebrew) and various *BSD systems. As well, Conda's packages are supported by this mechanism (one can't really mix Conda and non-Conda, though).
We do run a test program using NTL in ./configure
, but it does even link NTLs library, it only uses its headers.
It's easy to add a test which does something like shown in the beginning of https://libntl.org/doc/tour-ex1.html
I'll do a PR to add this.
The problem with the existing autoconf macros for link and run testing is that they do NOT enforce use of shared libraries. So these link and run tests will pass even when only static (non-reloc) libs are present. But in our use of the libraries, we do enforce the use of shared libraries.
There may be another issue caused by linking Sage to libntl.a
installed in the system. Please see my comment at https://github.com/sagemath/sage/issues/38376#issuecomment-2332448665
Environment
Steps To Reproduce
I had a locally installed NTL compiled from sources with default options. While Sage tries to link libntl.a, it fails with a few complaints like
Config log
Relevant part from
config.log
:Package logs
No response
Additional Information
To overcome the issue I had to go to NTL sources, manually add
-fPIC
compiler option to itsmakefile
, recompile and reinstall my locallibntl.a
. However, I think this issue should have an automated solution - e.g., better testing of possibility for linking.Also, while Sage says
configure:23219: will use system package and not install SPKG ntl
, it uses not the system-provided package (which would be/usr/lib/x86_64-linux-gnu/libntl.a
) but a locally-installed one (/usr/local/lib/libntl.a
) instead.Checklist