Error building Sage 4.4.3 under vanilla Debian lenny amd64: Error while installing flint

17 views
Skip to first unread message

orca

unread,
Jun 12, 2010, 5:30:56 PM6/12/10
to sage-devel
Dear Sirs,

I have a palin vanilla Debian lenny amd64 machine, which I use for
quite some time now; I am reasonably conversant (but not much) with
some installation commands for programs in general.

I have just tried to compile Sage 4.4.3 from source under that
machine. I had to circumvent some "small" issues:

1) I had to change the make command to

make CC=gcc-4.2 FC=gfortran-4.2

since the default vanilla C compiler, gcc, is version 4.3.2 and the
default vanilla Fortran compiler, gfortran, is version 4.3.2 as well,
whereas the default vanilla C++ compiler, g++, is version 4.2.4. So I
had to install these "downgraded" versions, which were available from
the official Debian lenny repos, without any ado...

2) after issuing the above command, under the extracted Sage root
directory, the following error shows up, after some minutes:

.........

flint-1.5.0.p4/.hgtags
Finished extraction
****************************************************
Host system
uname -a:
Linux andromeda 2.6.24-1-amd64 #1 SMP Sat May 10 09:28:10 UTC 2008
x86_64 GNU/Linux
****************************************************
****************************************************
CC Version
gcc-4.2 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c+
+,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-
zlib --libexecdir=/usr/lib --without-included-gettext --enable-
threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2
--program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --
enable-objc-gc --enable-mpfr --with-tune=generic --enable-
checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --
target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Debian 4.2.4-6)
****************************************************
Found gcc 4 or later
make[2]: Entering directory `/home/orca/sage/sage-4.4.3/spkg/build/
flint-1.5.0.p4/src'
gcc-4.2 -I/home/orca/sage/sage-4.4.3/local/include/ -I/home/orca/sage/
sage-4.4.3/local/include -fPIC -funroll-loops -O2 -DNDEBUG -o
zn_mod.o -c zn_poly/src/zn_mod.c
In file included from zn_poly/src/zn_poly_internal.h:50,
from zn_poly/src/zn_mod.c:23:
zn_poly/src/../../mpn_extras.h: In function ‘F_mpn_negate’:
zn_poly/src/../../mpn_extras.h:75: error: ‘for’ loop initial
declaration used outside C99 mode
zn_poly/src/../../mpn_extras.h: In function ‘F_mpn_copy’:
zn_poly/src/../../mpn_extras.h:96: error: ‘for’ loop initial
declaration used outside C99 mode
zn_poly/src/../../mpn_extras.h: In function ‘F_mpn_copy_forward’:
zn_poly/src/../../mpn_extras.h:104: error: ‘for’ loop initial
declaration used outside C99 mode
zn_poly/src/../../mpn_extras.h: In function ‘F_mpn_clear’:
zn_poly/src/../../mpn_extras.h:118: error: ‘for’ loop initial
declaration used outside C99 mode
zn_poly/src/../../mpn_extras.h: In function ‘F_mpn_set’:
zn_poly/src/../../mpn_extras.h:129: error: ‘for’ loop initial
declaration used outside C99 mode
zn_poly/src/../../mpn_extras.h: In function ‘F_mpn_printx’:
zn_poly/src/../../mpn_extras.h:145: error: ‘for’ loop initial
declaration used outside C99 mode
make[2]: *** [zn_mod.o] Error 1
make[2]: Leaving directory `/home/orca/sage/sage-4.4.3/spkg/build/
flint-1.5.0.p4/src'
Error building flint shared library.

real 0m0.082s
user 0m0.072s
sys 0m0.008s
sage: An error occurred while installing flint-1.5.0.p4
Please email sage-devel http://groups.google.com/group/sage-devel
explaining the problem and send the relevant part of
of /home/orca/sage/sage-4.4.3/install.log. Describe your computer,
operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/orca/sage/sage-4.4.3/spkg/build/flint-1.5.0.p4 and type 'make
check' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
(cd '/home/orca/sage/sage-4.4.3/spkg/build/flint-1.5.0.p4' && '/home/
orca/sage/sage-4.4.3/sage' -sh)
When you are done debugging, you can type "exit" to leave the
subshell.
make[1]: *** [installed/flint-1.5.0.p4] Error 1
make[1]: Leaving directory `/home/orca/sage/sage-4.4.3/spkg'

real 0m1.035s
user 0m0.644s
sys 0m0.080s
Error building Sage.
./sage -docbuild all html 2>&1 | tee -a dochtml.log
python: can't open file '/home/orca/sage/sage-4.4.3/devel/sage/doc/
common/builder.py': [Errno 2] No such file or directory


Could you provide any help??

Thanks in advance!

ma...@mendelu.cz

unread,
Jun 12, 2010, 5:51:09 PM6/12/10
to sage-devel


On 12 čvn, 23:30, orca <mocal...@gmail.com> wrote:
> Dear Sirs,
>
> I have a palin vanilla Debian lenny amd64 machine, which I use for
> quite some time now; I am reasonably conversant (but not much) with
> some installation commands for programs in general.
>
> I have just tried to compile Sage 4.4.3 from source under that
> machine. I had to circumvent some "small" issues:
>
> 1) I had to change the make command to
>
> make CC=gcc-4.2 FC=gfortran-4.2
>
> since the default vanilla C compiler, gcc, is version 4.3.2 and the
> default vanilla Fortran compiler, gfortran,  is version 4.3.2 as well,
> whereas the default vanilla C++ compiler, g++, is version 4.2.4. So I
> had to install these "downgraded" versions, which were available from
> the official Debian lenny repos, without any ado...
>

Hi

As I wrote in sage-support, the default g++ is also version 4.3.2 ,
see http://packages.debian.org/lenny/g++

Robert

orca

unread,
Jun 12, 2010, 6:46:57 PM6/12/10
to sage-devel
Ok Marik

I checked that the default g++ under lenny is said to be 4.3.2,
despite the fact that in mine it is 4.2.4 and I'm sure I did not
change this myself...
At any rate, I do not think this has any relationship to the failure
of installation of flint, which is my current problem now; do you??

Bill Hart

unread,
Jun 12, 2010, 8:10:15 PM6/12/10
to sage-devel
FLINT needs to compile with the -std=c99 flag. I presume someone
overrode it somehow, which breaks the build.

Bill.

orca

unread,
Jun 12, 2010, 8:44:21 PM6/12/10
to sage-devel
Ok Hart

I have now changed the make command to:

make CC=c99 FC=gfortran-4.2

and a new error emerges:

libtool: link: `/home/orca/sage/sage-4.4.3/spkg/build/
freetype-2.3.5.p2/src/objs/ftsystem.lo' is not a valid libtool object
make[2]: *** [/home/orca/sage/sage-4.4.3/spkg/build/freetype-2.3.5.p2/
src/objs/libfreetype.la] Error 1
make[2]: Leaving directory `/home/orca/sage/sage-4.4.3/spkg/build/
freetype-2.3.5.p2/src'

real 0m29.418s
user 0m22.877s
sys 0m4.668s
sage: An error occurred while installing freetype-2.3.5.p2
Please email sage-devel http://groups.google.com/group/sage-devel
explaining the problem and send the relevant part of
of /home/orca/sage/sage-4.4.3/install.log. Describe your computer,
operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/orca/sage/sage-4.4.3/spkg/build/freetype-2.3.5.p2 and type 'make
check' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
(cd '/home/orca/sage/sage-4.4.3/spkg/build/freetype-2.3.5.p2' && '/
home/orca/sage/sage-4.4.3/sage' -sh)
When you are done debugging, you can type "exit" to leave the
subshell.
make[1]: *** [installed/freetype-2.3.5.p2] Error 1
make[1]: Leaving directory `/home/orca/sage/sage-4.4.3/spkg'

real 1m4.089s
user 0m54.599s
sys 0m6.140s
Error building Sage.
./sage -docbuild all html 2>&1 | tee -a dochtml.log
python: can't open file '/home/orca/sage/sage-4.4.3/devel/sage/doc/
common/builder.py': [Errno 2] No such file or directory


Any new directions please???

Dr. David Kirkby

unread,
Jun 12, 2010, 8:51:24 PM6/12/10
to sage-...@googlegroups.com
On 06/12/10 10:30 PM, orca wrote:
> Dear Sirs,
>
> I have a palin vanilla Debian lenny amd64 machine, which I use for
> quite some time now; I am reasonably conversant (but not much) with
> some installation commands for programs in general.
>
> I have just tried to compile Sage 4.4.3 from source under that
> machine. I had to circumvent some "small" issues:
>
> 1) I had to change the make command to
>
> make CC=gcc-4.2 FC=gfortran-4.2
>
> since the default vanilla C compiler, gcc, is version 4.3.2 and the
> default vanilla Fortran compiler, gfortran, is version 4.3.2 as well,
> whereas the default vanilla C++ compiler, g++, is version 4.2.4. So I
> had to install these "downgraded" versions, which were available from
> the official Debian lenny repos, without any ado...

That might cause you problems. The variables CC and FC are not fully supported
by Sage, so setting CC to gcc-4.2 will mean sometimes you compile with that
compiler, and other times you compile with whatever is the first version of gcc
in your path. You might get away with it, but I would not want to be using
different versions of compilers to build some bits of Sage. I'd try to keep it
consistent. I can assure you CC will not be respected fully.

> sage: An error occurred while installing flint-1.5.0.p4

At one time the flint package in Sage did not respect CC and/or CXX, but that
may no longer be true. Either way, you setting CC will most likely cause you
problems.

> Could you provide any help??

I'd personaly try to get a consistent set of compilers in one directory. Failing
that, create a directory and put links in there to the real compilers.


$ mkdir compilers
$ cd compiler
$ ln -s /path/to/the/right/gcc .
$ ln -s /path/to/the/correct/g++ .
$ ln -s /path/to/the/same/version/of/gfortran .

Then just make sure 'compilers' is the first directory in your path.

But really, if you have a mix of compilers, and I believe Robert has pointed out
that you do, then I'd sort out what is wrong with my system and download a
consistent set.

> Thanks in advance!
>

Dr. David Kirkby

unread,
Jun 12, 2010, 9:05:11 PM6/12/10
to sage-...@googlegroups.com
On 06/13/10 01:44 AM, orca wrote:
> Ok Hart
>
> I have now changed the make command to:
>
> make CC=c99 FC=gfortran-4.2
>
> and a new error emerges:

I've told you. You are wasting your time trying to set CC. I've set CC to be the
Sun Studio compiler, but gcc still gets called many times. Some parts of Sage
ignore CC, others follow it fully. Other parts have a mixture.

You should get yourself a setup so that typing

gcc, g++ or gfortran gives you identical versions.

Forget trying to set CC - it might work for some bits of Sage, but it will not
be consistent.

Dave

Dima Pasechnik

unread,
Jun 13, 2010, 7:03:46 AM6/13/10
to sage-devel
Hi,
is your Debian installation up to date?
It could be that an older gcc you have by default is due to this,
and if so, there is no telling as to what goes wrong.

Just in case you wonder what I mean, you ought to run
aptitude update
and then
aptitude safe-upgrade

and see if there are no "held back" packages left...

Best,
Dima
> Please email sage-develhttp://groups.google.com/group/sage-devel

Dima Pasechnik

unread,
Jun 13, 2010, 7:07:08 AM6/13/10
to sage-devel
Is your Debian installation up to date?
Your old compiler etc might be due to this.
If not, please do the usual thing (aptitude update; aptitude safe-
upgrade)
and see if this helps..

Just in case,
Dima

orca

unread,
Jun 13, 2010, 9:59:24 AM6/13/10
to sage-devel
Dear Kirby and Pasechnik,

Sorry for the waste of time: I have now upgraded my Debian lenny
system and, as Marik above has stated, it now does have matched 4.3.2
versions of all three compilers (gcc, g++ and gfortran). I am now
building Sage from scratch and everything seems to be going fine. I
will report as soon as the process is over (for whatever reason :-)).

Thank you all again!

orca

unread,
Jun 13, 2010, 12:55:00 PM6/13/10
to sage-devel
Hi there,

The build process completed SUCCESSFULLY! Everything seems to be
working fine!

Thank you all again!!
Reply all
Reply to author
Forward
0 new messages