Opened 11 years ago

Closed 6 months ago

#7851 closed defect (invalid)

libz igoresSAGE64 other than on OS X

Reported by: drkirkby Owned by: drkirkby
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: porting Keywords:
Cc: jsp Merged in:
Authors: David Kirkby Reviewers: Dima Pasechnik
Report Upstream: Reported upstream. No feedback yet. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The spkg-install of libz zlib-1.2.3.p5 has this:

if [ `uname` = "Darwin" -a "$SAGE64" = "yes" ]; then
   CFLAGS=" -m64 $CFLAGS -fPIC -g -I\"$SAGE_LOCAL/include\""
   cp ../patches/configure-OSX-64 configure
else
   CFLAGS="$CFLAGS -fPIC -g -I\"$SAGE_LOCAL/include\""
fi
export CFLAGS

so is almost doomed to a 64-bit build unless one sets CFLAGS externally.

Attachments (1)

add-64-bit-support-to-zlib.patch (2.2 KB) - added by drkirkby 11 years ago.

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by drkirkby

comment:1 Changed 11 years ago by drkirkby

  • Authors set to David Kirkby
  • Cc jsp added
  • Status changed from new to needs_review

With the recent updates to sage-env, this will actually build in 64-bit mode, as that will set CFLAGS appropriately. But there were some other issues with this package, so the following have been addressed.

  • Move -I $SAGE_LOCAL/include to CPPFLAGS, not CFLAGS There's no reason it should go there.
  • Removed most of the SAGE64 related stuff. The only bit remaining is to apply a patch on OS X in 64-bit mode.
  • Removed -Wall and -g from CFLAGS - the new sage-eve will add these automatically for gcc. Since they are GNU specific flags, they would break with other compilers.
  • Substituted -fPIC for $FPIC_FLAG as -fPIC is a GNU specfic option and sage-env defines FPIC_FLAG to be -fPIC for gcc, but other things for Sun Studio and other compilers from HP and IBM.

An updated spkg can be found at

http://boxen.math.washington.edu/home/kirkby/portability/zlib-1.2.3.p6/zlib-1.2.3.p6.spkg

other relevant files in http://boxen.math.washington.edu/home/kirkby/portability/zlib-1.2.3.p6/

Dave

comment:2 Changed 11 years ago by drkirkby

  • Status changed from needs_review to needs_work

I'm not 100% happy with this. I'm returning it to 'needs work.'

comment:3 Changed 11 years ago by drkirkby

  • Report Upstream changed from N/A to Reported upstream. Little or no feedback.
  • Status changed from needs_work to needs_info

This problem is not as simple as I first thought. Using the zlib source code, without any CFLAGS, but with the --shared option, we get the message the shared library is built.

drkirkby@swan:[~/sage-4.3.1.alpha1/spkg/standard/zlib-1.2.3.p5/src] $  ./configure --shared
Checking for shared library support...
Building shared library libz.so.1.2.3 with /usr/local/gcc-4.4.1-sun-linker/bin/gcc.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.

Trying to build in 64-bit mode, the shared library is not built.

drkirkby@swan:[~/sage-4.3.1.alpha1/spkg/standard/zlib-1.2.3.p5/src] $ CFLAGS=-m64  ./configure --shared
Checking for shared library support...
No shared library support; try without defining CC and CFLAGS
Building static library libz.a version 1.2.3 with /usr/local/gcc-4.4.1-sun-linker/bin/gcc.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.

I've reported this issue to the email address zlib at gzip.org and are awaiting feedback. I don't think it will be easy to progress on this until that point.

Dave

comment:4 Changed 11 years ago by jsp

  • Status changed from needs_info to needs_work

I found out the problem is in src/configure. This file is very old! Has entries for QNX os, remember those days.

This file needs a patch!!!

Jaap

comment:5 Changed 9 years ago by roed

  • Report Upstream changed from Reported upstream. Little or no feedback. to Reported upstream. No feedback yet.

comment:6 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:7 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:8 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:9 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:10 Changed 6 months ago by dimpase

  • Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
  • Reviewers set to Dima Pasechnik
  • Status changed from needs_work to positive_review

this is obsolete.

comment:11 Changed 6 months ago by chapoton

  • Resolution set to invalid
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.