hard-coded libgmp path in two spkg-install

64 views
Skip to first unread message

Vincent Delecroix

unread,
Oct 1, 2024, 3:48:02 AM10/1/24
to sage-devel
Dear all,

This is a configure script question related to sage environment.In
many situations, system libraries are used for GMP. However, both
cocoalib and polylib spkg-install.in files use hardcoded path to
libgmp

cocoalib/spkg-install.in:
--with-libgmp="${SAGE_LOCAL}/lib/libgmp.a"

polylib/spkg-install.in:
sdh_configure --with-libgmp=${SAGE_LOCAL}/lib

What is the proper way to tell the configure script to use libgmp? Can
we safely omit the paramater and use `--with-libgmp`?

Best
Vincent

Vincent Delecroix

unread,
Oct 1, 2024, 9:13:01 AM10/1/24
to Dima Pasechnik, sage-...@googlegroups.com
Thanks Dima. I will play around with your suggestion and will cc you
in the issues/PR on github.

Vincent

On Tue, 1 Oct 2024 at 11:06, Dima Pasechnik <dim...@gmail.com> wrote:
>
> Hi Vincent,
> That's a bug, indeed.
>
> These `--with-libgmp=` are parameters of ./configure scripts of cocoalib
> and polylib. We do have SAGE_GMP_PREFIX which is set to an empty string
> on systems where GMP comes from the system.
> So probably on such systems these --with-libgmp= are not even needed,
> and one can add a little shell computation in spkg-install.in files
> to not pass anything if it's empty.
>
> Something like
>
> cocoalib/spkg-install.in:
>
> export SAGE_CONFIGURE_LIBGMP=""
> if [ -n "$SAGE_GMP_PREFIX" ]; then
> export SAGE_CONFIGURE_LIBGMP="--with-libgmp=$SAGE_GMP_PREFIX/lib/libgmp.a"
>
> ./configure --prefix="${SAGE_LOCAL}" $SAGE_CONFIGURE_LIBGMP
>
> and similarly for the polylib.
>
> Anyhow, if you rather like me to fix this, just open an issue on GH,
> cc me, and I'll do it by tomorrow or so.
>
> Cheers
> Dima
>
>
>
> On Tue, Oct 1, 2024 at 8:48 AM Vincent Delecroix
> > --
> > 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+...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAGEwAAkZGnf%2BFDgZLPMjXFLhN0wkeiDp_0-gNx4DsqnA7qZuiQ%40mail.gmail.com.

Dima Pasechnik

unread,
Oct 1, 2024, 10:58:40 AM10/1/24
to sage-...@googlegroups.com, Vincent Delecroix
Hi Vincent,
That's a bug, indeed.

These `--with-libgmp=` are parameters of ./configure scripts of cocoalib
and polylib. We do have SAGE_GMP_PREFIX which is set to an empty string
on systems where GMP comes from the system.
So probably on such systems these --with-libgmp= are not even needed,
and one can add a little shell computation in spkg-install.in files
to not pass anything if it's empty.

Something like

cocoalib/spkg-install.in:

export SAGE_CONFIGURE_LIBGMP=""
if [ -n "$SAGE_GMP_PREFIX" ]; then
export SAGE_CONFIGURE_LIBGMP="--with-libgmp=$SAGE_GMP_PREFIX/lib/libgmp.a"

./configure --prefix="${SAGE_LOCAL}" $SAGE_CONFIGURE_LIBGMP

and similarly for the polylib.

Anyhow, if you rather like me to fix this, just open an issue on GH,
cc me, and I'll do it by tomorrow or so.

Cheers
Dima



On Tue, Oct 1, 2024 at 8:48 AM Vincent Delecroix
<20100.d...@gmail.com> wrote:
>
Reply all
Reply to author
Forward
0 new messages