Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flintqs builds as 32-bit despite SAGE64=yes on OpenSolaris x64 #9034

Closed
sagetrac-drkirkby mannequin opened this issue May 24, 2010 · 11 comments
Closed

flintqs builds as 32-bit despite SAGE64=yes on OpenSolaris x64 #9034

sagetrac-drkirkby mannequin opened this issue May 24, 2010 · 11 comments

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented May 24, 2010

Build environment

  • Sun Ultra 27 3.33 GHz Intel W3580 Xeon. Quad core. 8 threads. 12 GB RAM
  • OpenSolaris 2009.06 snv_134 X86
  • Sage 4.4.2
  • gcc 4.4.4

How gcc 4.4.4 was configured

Since the configuration of gcc is fairly critical on OpenSolaris, here's how it was built.

drkirkby@hawk:~/sage-4.4.2$ gcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc-4.4.4/configure --prefix=/usr/local/gcc-4.4.4 --with-as=/usr/local/binutils-2.20/bin/as --with-ld=/usr/ccs/bin/ld --with-gmp=/usr/local --with-mpfr=/usr/local
Thread model: posix
gcc version 4.4.4 (GCC) 

gcc 4.3.4 was failing to build iconv on OpenSolaris x64, suggesting it may be essential to have a very recent gcc in order to build Sage on OpenSolaris.

How the Sage build was attempted

The problem with flintqs

flintqs-20070817.p4/src/._TonelliShanks.h
flintqs-20070817.p4/src/TonelliShanks.h
Finished extraction
****************************************************
Host system
uname -a:
SunOS hawk 5.11 snv_134 i86pc i386 i86pc
****************************************************
****************************************************
CC Version
gcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc-4.4.4/configure --prefix=/usr/local/gcc-4.4.4 --with-as=/usr/local/binutils-2.20/bin/as --with-ld=/usr/ccs/bin/ld --with-gmp=/usr/local --with-mpfr=/usr/local
Thread model: posix
gcc version 4.4.4 (GCC) 
****************************************************
g++ -ansi -c lprels.c -o lprels.o -I/export/home/drkirkby/sage-4.4.2/local/include -Wall -Wno-sign-compare -fomit-frame-pointer -O3
lprels.c: In function ‘FILE* flint_fopen(char*, char*)’:
<snip>
Successfully installed flintqs-20070817.p4

So no '-m64' flag is added to the g++ command line, so not surprisingly 'flintqs' does not build as a 64-bit binary. The output from the 'file' command confirms this:

drkirkby@hawk:~/sage-4.4.2$ file  local/bin/QuadraticSieve
local/bin/QuadraticSieve:       ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, not stripped, no debugging information available

The likely reason for the flintqs problem

spkg-install has this bit of code:

if [ `uname -m` = "x86_64" ]; then
    $CP makefile.opteron makefile
else
    if [ `uname` = "Darwin" -a "$SAGE64" = "yes" ]; then
        $CP makefile.osx64 makefile
    else
        $CP makefile.sage makefile
    fi
fi

A cursory glance would suggest the 'makefile.osx64' would work for OpenSolaris, Solaris or most other Unix operating systems, though this has not been tested yet.

Upstream: None of the above - read trac for reasoning.

CC: @jaapspies

Component: porting: Solaris

Author: David Kirkby

Reviewer: Jaap Spies

Merged: sage-4.5.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/9034

@sagetrac-drkirkby sagetrac-drkirkby mannequin added this to the sage-4.5 milestone May 24, 2010
@sagetrac-drkirkby sagetrac-drkirkby mannequin self-assigned this May 24, 2010
@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented May 24, 2010

comment:1

Note that the Debian 'dist' subdirectory also exists on this package, and should be removed - see #5903

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented May 24, 2010

Attachment: flinqs.patch.gz

Mercurial patch to build 64-bit

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented May 24, 2010

comment:2

The attached patch resolves this issue. A new package can be found at:

http://boxen.math.washington.edu/home/kirkby/patches/flintqs-20070817.p5.spkg

Now the -m64 flag is added to the compiler

g++ -ansi -m64 lprels.o ModuloArith.o TonelliShanks.o F2matrix.o lanczos.o QS.o  -o "QuadraticSieve" -L/export/home/drkirkby/sage-4.4.2/local/lib -lgmp

real    0m0.952s
user    0m0.737s
sys     0m0.108s
Successfully installed flintqs-20070817.p5

and the binary is built as 64-bit.

drkirkby@hawk:~/sage-4.4.2$ file  local/bin/QuadraticSieve
local/bin/QuadraticSieve:       ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, not stripped, no debugging information available
drkirkby@hawk:~/sage-4.4.2$ 

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented May 24, 2010

Author: David Kirkby

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented May 24, 2010

comment:3

For other OpenSolaris issues, see #9026

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented May 24, 2010

comment:4

This is quite an old version of flintqs, so I'm not going to report this upstream as a bug. Someone who wants a later version and has the expertese to test it, is welcome to update the version of flintqs in Sage, but for now, I just want to get it working properly on OpenSolaris.

Dave

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented May 24, 2010

Changed upstream from Not yet reported upstream; Will do shortly. to None of the above - read trac for reasoning.

@sagetrac-drkirkby

This comment has been minimized.

@jaapspies
Copy link
Member

Reviewer: Jaap Spies

@jaapspies
Copy link
Member

comment:7

It is not strictly needed, but it works ok when SAGE64=yes. Looks ok.

Positive review.

Jaap

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 25, 2010

Merged: sage-4.5.alpha0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant