problem building maxima

34 views
Skip to first unread message

John Cremona

unread,
May 14, 2021, 5:19:16 AM5/14/21
to SAGE devel
I have been installing sage-9.3 from the tarball on a few ubuntu
machines, just doing ./configure and then make. On one machine
running ubuntu 20.04.02 LTS maxima fails to build. I have attached
the log files.

This is a machine on which I tried a few weeks ago to help the build
process by installing as many of the dependencies as possible. My
experience so far has been that this has caused so many things to go
wrong that I prefer the old way -- build everything -- since that just
takes more computer time, while the new way (so far) uses a lot more
of my time.

John
config.log
maxima-5.44.0.log

François Bissey

unread,
May 14, 2021, 5:26:15 AM5/14/21
to sage-...@googlegroups.com
It looks like maxima.fas has not been built. Last time I saw that happen
in sage-on-gentoo was because the patch to build it was missing.
Not sure how it could happen on your setup, the log needs further inspection.
> --
> 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/CAD0p0K7VWKz7ActzBjT9FZdW_yo3bkK99bSDEWd0n-zWkQsyNw%40mail.gmail.com.
> <config.log><maxima-5.44.0.log>

Dima Pasechnik

unread,
May 14, 2021, 6:16:33 AM5/14/21
to sage-devel
On Fri, May 14, 2021 at 10:19 AM John Cremona <john.c...@gmail.com> wrote:
>
> I have been installing sage-9.3 from the tarball on a few ubuntu
> machines, just doing ./configure and then make. On one machine
> running ubuntu 20.04.02 LTS maxima fails to build. I have attached
> the log files.
>
> This is a machine on which I tried a few weeks ago to help the build
> process by installing as many of the dependencies as possible. My
> experience so far has been that this has caused so many things to go
> wrong that I prefer the old way -- build everything -- since that just

without your feedback one cannot improve things going wrong...

> takes more computer time, while the new way (so far) uses a lot more
> of my time.

Do you have a system-wide install of ecl?
This is something that potentially might interfere.

Jan Groenewald

unread,
May 14, 2021, 6:21:41 AM5/14/21
to sage-devel
Hi

On Fri, 14 May 2021 at 11:26, François Bissey <frp.b...@gmail.com> wrote:
It looks like maxima.fas has not been built. Last time I saw that happen
in sage-on-gentoo was because the patch to build it was missing.
Not sure how it could happen on your setup, the log needs further inspection.

> On 14/05/2021, at 21:18, John Cremona <john.c...@gmail.com> wrote:
>
> I have been installing sage-9.3 from the tarball on a few ubuntu
> machines, just doing ./configure and then make.  On one machine
> running ubuntu 20.04.02 LTS maxima fails to build.  I have attached
> the log files.
>
> This is a machine on which I tried a few weeks ago to help the build
> process by installing as many of the dependencies as possible.  My
> experience so far has been that this has caused so many things to go
> wrong that I prefer the old way -- build everything -- since that just
> takes more computer time, while the new way (so far) uses a lot more
> of my time.

config.log:
## Checking whether SageMath should install SPKG libffi... ##
## ------------------------------------------------------- ##
configure:24887: checking for LIBFFI
configure:24894: $PKG_CONFIG --exists --print-errors "libffi"
configure:24897: $? = 0
configure:24911: $PKG_CONFIG --exists --print-errors "libffi"
configure:24914: $? = 0
configure:25100: result: yes
configure:25108: will use system package and not install SPKG libffi
 
maxima log:
Condition of type: SIMPLE-ERROR
Error code 1 when executing
(EXT:RUN-PROGRAM "gcc" ("-o" "binary-ecl/maxima-package.fas" "-L/usr/local/sage/sage-9.3/local/lib/" "/tmp/eclinit8GQbdq.o" "binary-ecl/maxima-package.o" "-Wl,--rpath,/usr/local/sage/sage-9.3/local/lib/" "-shared" "-Wl,-rpath-link,/usr/local/sage/sage-9.3/local/lib" "-L/usr/local/sage/sage-9.3/local/lib" "-Wl,-rpath,/usr/local/sage/sage-9.3/local/lib" "-Wl,-rpath-link,/usr/local/sage/sage-9.3/local/lib" "-L/usr/local/sage/sage-9.3/local/lib" "-Wl,-rpath,/usr/local/sage/sage-9.3/local/lib" "-lecl" "-lgmp" "-lgc" ...)):
/usr/bin/ld: cannot find -lffi
collect2: error: ld returned 1 exit status
Available restarts:

1. (CONTINUE) Continues anyway.
2. (RESTART-TOPLEVEL) Go back to Top-Level REPL.

Broken at DO-COMPILE-ECL.
 File: #P"/usr/local/sage/sage-9.3/local/var/tmp/sage/build/maxima-5.44.0/src/src/maxima.system" (Position #1601)



Do you perhaps need to sudo apt install libffi-dev?


Regards,
Jan

--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^ 

Dima Pasechnik

unread,
May 14, 2021, 6:53:34 AM5/14/21
to sage-devel
One way I can explain this is a broken system-wide install of libffi-dev
I don't know how this can be achieved, other than having multiple
system-wide copies of libffi,
or stuff manually removed.

The other possibility is that the linker is told not to look for
system-wide libffi - can this be achieved with -L and -Wl,-rpath ?

On the other hand, it's a bug in maxima, which does not try to check
for presense of libffi, just assumes it's there.


> It is listed as a dependency here: https://doc.sagemath.org/html/en/installation/source.html
>
> (also see https://bugzilla.redhat.com/show_bug.cgi?id=837102 from 2012)
>
> Regards,
> Jan
>
> --
> .~.
> /V\ Jan Groenewald
> /( )\ www.aims.ac.za
> ^^-^^
>
> --
> 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/CAAg%3Dp_33NMuyuZ_zQn8%2B3oQjDhR%3DCAMAcausjD7TYoi_x9EoXQ%40mail.gmail.com.

Dima Pasechnik

unread,
May 14, 2021, 7:12:42 AM5/14/21
to sage-devel
oops, I meant to say, it's a bug in ECL, as this failing call to gcc
is emitted by ECL.

Jan Groenewald

unread,
May 14, 2021, 7:17:38 AM5/14/21
to sage-devel
Hi

Why did SageMath say this? Was it checking for runtime libffi or headers?

config.log:
## Checking whether SageMath should install SPKG libffi... ##
## ------------------------------------------------------- ##
configure:24887: checking for LIBFFI
configure:24894: $PKG_CONFIG --exists --print-errors "libffi"
configure:24897: $? = 0
configure:24911: $PKG_CONFIG --exists --print-errors "libffi"
configure:24914: $? = 0
configure:25100: result: yes
configure:25108: will use system package and not install SPKG libffi

Dima Pasechnik

unread,
May 14, 2021, 7:30:21 AM5/14/21
to sage-devel
it's checking with pkg-config first of all.
see build/pkgs/libffi/spkg-configure.m4

If this test succeeds, it's assumed everything is fine.
Note that libffi is a pre-req for ECL, and ECL is built just fine,
as far as one can see.

I gather it must be a bug in ECL, which struggles to create a correct
incantation of C compiler calls
from a unique (Copyright JEC 2021 :-)) concostion of gmp built by Sage
and libffi provided by the system.

ECL checks for libffi carefully in its configure, as far as I know.


John, can you post logs/pkgs/ecl-21.2.1.log ?





>
> config.log:
> ## Checking whether SageMath should install SPKG libffi... ##
> ## ------------------------------------------------------- ##
> configure:24887: checking for LIBFFI
> configure:24894: $PKG_CONFIG --exists --print-errors "libffi"
> configure:24897: $? = 0
> configure:24911: $PKG_CONFIG --exists --print-errors "libffi"
> configure:24914: $? = 0
> configure:25100: result: yes
> configure:25108: will use system package and not install SPKG libffi
>
> Regards,
> Jan
> --
> .~.
> /V\ Jan Groenewald
> /( )\ www.aims.ac.za
> ^^-^^
>
> --
> 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/CAAg%3Dp_3J7QyF7yTjYY3ecPz5U5uA6E2bw_iBiHYcXw4b0siBEA%40mail.gmail.com.

Michael Orlitzky

unread,
May 14, 2021, 8:20:06 AM5/14/21
to sage-...@googlegroups.com
On Fri, 2021-05-14 at 12:12 +0100, Dima Pasechnik wrote:
> >
> > The other possibility is that the linker is told not to look for
> > system-wide libffi - can this be achieved with -L and -Wl,-rpath ?
> >
> > On the other hand, it's a bug in maxima, which does not try to check
> > for presense of libffi, just assumes it's there.
>
> oops, I meant to say, it's a bug in ECL, as this failing call to gcc
> is emitted by ECL.
>

I ran into a problem recently that sounds relevant:

https://sourceforge.net/p/maxima/bugs/3759/

I wonder how hard it would be at this point to teach Sage to use the
system copy of Maxima. That will be the long-term solution anyway.


Dima Pasechnik

unread,
May 14, 2021, 8:45:54 AM5/14/21
to sage-devel
On Fri, May 14, 2021 at 1:20 PM Michael Orlitzky <mic...@orlitzky.com> wrote:
>
> On Fri, 2021-05-14 at 12:12 +0100, Dima Pasechnik wrote:
> > >
> > > The other possibility is that the linker is told not to look for
> > > system-wide libffi - can this be achieved with -L and -Wl,-rpath ?
> > >
> > > On the other hand, it's a bug in maxima, which does not try to check
> > > for presense of libffi, just assumes it's there.
> >
> > oops, I meant to say, it's a bug in ECL, as this failing call to gcc
> > is emitted by ECL.
> >
>
> I ran into a problem recently that sounds relevant:
>
> https://sourceforge.net/p/maxima/bugs/3759/
>
the ECL issue mentioned there sounds relevant:
https://gitlab.com/embeddable-common-lisp/ecl/-/issues/636 - I've left
a comment there.


> I wonder how hard it would be at this point to teach Sage to use the
> system copy of Maxima. That will be the long-term solution anyway.

Well, we know from the system ECL trac ticket that it's not going to
be very easy.

>
>
> --
> 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/e53fd6c259f8bd2284938c2627f8902c07af455e.camel%40orlitzky.com.

John Cremona

unread,
May 14, 2021, 8:46:11 AM5/14/21
to SAGE devel
Here is the ECL log.

John
> --
> 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/e53fd6c259f8bd2284938c2627f8902c07af455e.camel%40orlitzky.com.
ecl-21.2.1.log

Dima Pasechnik

unread,
May 14, 2021, 9:05:33 AM5/14/21
to sage-devel
Thanks. Indeed, libffi is alive and well:

...
checking for ffi_closure_alloc in -lffi... yes
checking ffi/ffi.h usability... no
checking ffi/ffi.h presence... no
checking for ffi/ffi.h... no
checking ffi.h usability... yes
checking ffi.h presence... yes
checking for ffi.h... yes
checking whether we can use the existing libffi library ... yes
...

;;; gcc -o libecl.so
-L/usr/local/sage/sage-9.3/local/var/tmp/sage/build/ecl-21.2.1/src/build/
c/main.o c/all_symbols2.o liblsp.a libeclmin.a
-Wl,--rpath,/usr/local/sage/sage-9.3/local/lib/ -shared
-Wl,-rpath-link,/usr/local/sage/sage-9.3/local/lib
-L/usr/local/sage/sage-9.3/local/lib
-Wl,-rpath,/usr/local/sage/sage-9.3/local/lib
-Wl,-rpath-link,/usr/local/sage/sage-9.3/local/lib
-L/usr/local/sage/sage-9.3/local/lib
-Wl,-rpath,/usr/local/sage/sage-9.3/local/lib
-Wl,-soname,libecl.so.21.2 -lgmp -lgc -lffi -lgc -ldl -lm

Comparing with the failed call

Error code 1 when executing
(EXT:RUN-PROGRAM "gcc" ("-o" "binary-ecl/maxima-package.fas"
"-L/usr/local/sage/sage-9.3/local/lib/" "/tmp/eclinit0kBo2G.o"
"binary-ecl/maxima-package.o"
"-Wl,--rpath,/usr/local/sage/sage-9.3/local/lib/" "-shared"
"-Wl,-rpath-link,/usr/local/sage/sage-9.3/local/lib" "-L/usr
/local/sage/sage-9.3/local/lib"
"-Wl,-rpath,/usr/local/sage/sage-9.3/local/lib"
"-Wl,-rpath-link,/usr/local/sage/sage-9.3/local/lib"
"-L/usr/local/sage/sage-9.3/local/lib"
"-Wl,-rpath,/usr/local/sage/sage-9.3/local/lib" "-lecl" "-lgmp" "-lgc"
...)):
/usr/bin/ld: cannot find -lffi

does not seem to reveal anything interesting.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAD0p0K5B2t%3DLiwJ0j%2Bm_RtrTyy%2BNvpD414ACYkOrNr3dxk7qww%40mail.gmail.com.

Jan Groenewald

unread,
May 15, 2021, 8:33:10 AM5/15/21
to sage-devel
Hi

On Fri, 14 May 2021 at 15:05, Dima Pasechnik <dim...@gmail.com> wrote:
Thanks. Indeed, libffi is alive and well:

...
checking for ffi_closure_alloc in -lffi... yes
checking ffi/ffi.h usability... no
checking ffi/ffi.h presence... no
checking for ffi/ffi.h... no
checking ffi.h usability... yes
checking ffi.h presence... yes
checking for ffi.h... yes
checking whether we can use the existing libffi library ... yes

Something else is also going on:

0 jan@debian:/tmp$nl ecl-21.2.1.log |grep ffi|grep "checking whet"
   102 checking whether we can use the existing libffi library ... yes
  4732 checking whether we can use the existing libffi library ... no
0 jan@debian:/tmp$nl ecl-21.2.1.log |grep onfiguring
    36 Configuring ecl-21.2.1
  4666 Configuring ecl-21.2.1
  4733 configure: Configuring included libffi library:
0 jan@debian:/tmp$nl ecl-21.2.1.log |grep Apr
    12 Linux fermat 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  4642 Linux fermat 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
0 jan@debian:/tmp$

Why does it look like it was building it twice, with different results?
Reply all
Reply to author
Forward
0 new messages