sage 10.4beta9 and locally installed libntl

61 views
Skip to first unread message

Max Alekseyev

unread,
Jun 19, 2024, 1:28:24 PMJun 19
to sage-devel
Hello,

I had a locally installed NTL compiled from sources with default options. While being compiled from sources, Sage failed to link with libntl.a with a few complaints like

[spkg-install]     /usr/bin/ld: ///usr/local/lib/libntl.a(ZZX.o): relocation R_X86_64_TPOFF32 against `_ZZN3NTL8PlainSqrEPNS_2ZZEPKS0_lE36_ntl_hidden_variable_tls_local_ptr_t' can not be used when making a shared object; recompile with -fPIC

I had to go to NTL, manually add -fPIC compiler option to its makefile, recompile and reinstall libntl to let Sage installation proceed. However, I think this issue should have an automated solution - e.g., if Sage is not happy with the installed libntl.a, why cannot it compile its own version in the way it likes (and ignore the installed one)?

Do I miss anything here?

Regards,
Max

Max Alekseyev

unread,
Jun 19, 2024, 4:08:03 PMJun 19
to Dima Pasechnik, sage-...@googlegroups.com
Hi Dima,

I'm not sure what you mean by saying that the local install "was broken". It may be broken from the Sage perspective, but from the NTL perspective it is not. As I said, NTL was compiled and installed locally with default options, which do not include -fPIC. Apparently, Sage cannot link to libntl.a compiled without that option, but since this option is not a default one, Sage should not try to blindly link to libntl.a installed in the system. Perhaps, as you say, ./configure should figure that out and give a green or red light for such linking.
In either case, that error is unexpected and should not have happened.

Regards,
Max

On Wed, Jun 19, 2024 at 3:43 PM Dima Pasechnik <dim...@gmail.com> wrote:


On 19 June 2024 18:28:23 BST, Max Alekseyev <max...@gmail.com> wrote:
>Hello,
>
>I had a locally installed NTL compiled from sources with default options.
>While being compiled from sources, Sage failed to link with libntl.a with a
>few complaints like
>
>[spkg-install]     /usr/bin/ld: ///usr/local/lib/libntl.a(ZZX.o):
>relocation R_X86_64_TPOFF32 against
>`_ZZN3NTL8PlainSqrEPNS_2ZZEPKS0_lE36_ntl_hidden_variable_tls_local_ptr_t'
>can not be used when making a shared object; recompile with -fPIC
>
>I had to go to NTL, manually add -fPIC compiler option to its makefile,
>recompile and reinstall libntl to let Sage installation proceed.

I think your local install was probably broken in a way that we don't check for.



> However, I
>think this issue should have an automated solution - e.g., if Sage is not
>happy with the installed libntl.a, why cannot it compile its own version in
>the way it likes (and ignore the installed one)?

the test we have didn't pick up the issue with your library. Normally it would only use the dynamic library, libntl.a is a static one.

All this can be improved by adding more tests to
./configure


Dima

PS  Feel free to repost to sage-...@googlegroups.com,
Reply all
Reply to author
Forward
0 new messages