Opened 10 years ago

Closed 10 years ago

#13954 closed defect (fixed)

New Gap spkg (>=4.5) does not build with shared only GMP/MPIR

Reported by: Jean-Pierre Flori Owned by: tbd
Priority: major Milestone: sage-5.7
Component: packages: standard Keywords: spkg gap cygwin
Cc: Karl-Dieter Crisman, Dima Pasechnik Merged in: sage-5.7.beta2
Authors: Jean-Pierre Flori Reviewers: Dmitrii Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jean-Pierre Flori)

And we only build a shared one on Cygwin because we cannot build both static and shared (although this limitation is not clearly still needed).

Try spkg at http://boxen.math.washington.edu/home/jpflori/gap-4.5.7.p3.spkg

Attachments (1)

gap-4.5.7.p3.diff (6.5 KB) - added by Jean-Pierre Flori 10 years ago.
Spkg diff, for review only.

Download all attachments as: .zip

Change History (23)

comment:1 Changed 10 years ago by Jean-Pierre Flori

The configure script tests for libgmp.a if --with-gmp=... is passed.

comment:2 Changed 10 years ago by Karl-Dieter Crisman

Would this explain my current problem that GAP doesn't build on XP? Configure fails with

configure: error: Could not locate GMP in the specified location

comment:3 Changed 10 years ago by Jean-Pierre Flori

Yes that's it.

comment:4 Changed 10 years ago by Jean-Pierre Flori

Ok, I got GAP to build but the script gap_cygwin is completely broken as well.

comment:5 Changed 10 years ago by Jean-Pierre Flori

Ok we basically have to remove all Cygwin specific things from spkg-install.

comment:6 Changed 10 years ago by Karl-Dieter Crisman

Great, provide something and I can still try it today!

Nice that the folks at #13211 managed to do this

if [ "x$GAP_DIR" = "x" ];  then
    GAP_DIR="$SAGE_ROOT/local/lib/gap-4.5.5" 
fi

but then somehow not update it to 4.5.7!?

comment:7 Changed 10 years ago by Karl-Dieter Crisman

By the way, WHY do we need to start GAP to start Sage? I know that sage-location or some similar script does this upon the first start... but it does seem a bit much.

comment:8 Changed 10 years ago by Jean-Pierre Flori

Anyway even the SAGE_ROOT part is wrong.

Try a dirty spkg at http://boxen.math.washington.edu/home/jpflori/gap-4.5.7.p2.spkg

comment:9 Changed 10 years ago by Volker Braun

Looks good to me.

Not sure what you mean by needing to start GAP for Sage. Sage startup doesn't start a GAP session. The GAP workspace cache needs to be rebuilt once, though.

comment:10 Changed 10 years ago by Karl-Dieter Crisman

  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    8686    exit 1
    8787fi
    8888
    89 # On Cygwin installations the GAP build creates a file 'gap.exe',
    90 # and then tries to strip the file 'gap'.
    91 # This broke the build on old Cygwin installations.
    92 # On newer Cygwins, 'gap' is automatically "translated" to 'gap.exe'.
    93 if [[ "$UNAME" = CYGWIN ]]; then
    94     echo "Creating a dummy 'gap.exe' in 'bin/i686-pc-cygwin-gcc'..."
    95     cd "$SPKG_ROOT/src"
    96     mkdir -p bin/i686-pc-cygwin-gcc &&
    97     cd bin/i686-pc-cygwin-gcc &&
    98     touch gap.exe
    99     if [[ $? -ne 0 ]]; then
    100         # Something really went wrong.
    101         echo >&2 "Error creating a dummy gap.exe file."
    102         exit 1
    103     fi
    104     # Check if 'gap' is automatically "translated" to 'gap.exe'.
    105     # If not, create a symbolic link from 'gap' to 'gap.exe'.
    106     if [[ ! -f gap ]]; then
    107         echo "Creating a symbolic link from 'gap' to 'gap.exe'..."
    108         ln -s gap.exe gap
    109         if [[ $? -ne 0 ]]; then
    110             # Something really went wrong.
    111             echo >&2 "Error creating the symbolic link."
    112             exit 1
    113         fi
    114     fi
    115 fi
    116 
    11789echo "Building GAP..."
    11890cd "$SPKG_ROOT/src"
    11991$MAKE -j1
     
    144116echo "Copying GAP startup script..."
    145117rm -f "$SAGE_LOCAL/bin/gap"
    146118cd "$SPKG_ROOT"
    147 if [[ "$UNAME" = CYGWIN ]]; then
    148     cp patches/gap_cygwin "$SAGE_LOCAL/bin/gap"
    149 else
    150     cp src/bin/gap.sh "$SAGE_LOCAL/bin/gap"
    151 fi
     119cp src/bin/gap.sh "$SAGE_LOCAL/bin/gap"
    152120if [[ $? -ne 0 ]]; then
    153121    echo >&2 "Error copying customized GAP startup script."
    154122    exit 1

Yeah, if it works, then we are set. It just finished building for me... sage -b now... that worked... Trying to start, sage-location is being run... it works!!!

Commit and make the spkg, this is ready to go.

Not sure what you mean by needing to start GAP for Sage. Sage startup doesn't start a GAP session. The GAP workspace cache needs to be rebuilt once, though.

Well, there is a GAP command that is run (and fails here, gap -r -b -p -T -o 251m .../gap/sage.g), so that sounds like GAP to me. Also, upon a first start (or relocation), Sage always says something about stopping a GAP session. But if it's not technically a session, that's fine; my point was that it does something, which e.g. Singular and Maxima don't.

comment:11 Changed 10 years ago by Jean-Pierre Flori

Ok, here you go, the spkg is updated and diff posted here. I directly patch configure and leave configure.in as is. This is dirty but what GAP does is so it's fair.

comment:12 Changed 10 years ago by Jean-Pierre Flori

Authors: Jean-Pierre Flori
Status: newneeds_review

comment:13 Changed 10 years ago by Karl-Dieter Crisman

Thanks. Do we need to provide a dylib check for Mac, or is that not relevant (apparently not, since we never encountered trouble looking for the .a file)? I really need to read configure files more - the solution was just sitting there waiting to be found. Too bad you can't take a class on configure files...

Anyway, although the change in the config shouldn't make a difference on other platforms, it would be nice to test this on Mac and Linux. JP, I assume you developed on Linux.

comment:14 Changed 10 years ago by Karl-Dieter Crisman

Also, another data point is #13588, which just (finally!) got positive review. I have no idea if that will make things tougher for us here, but I think that, given all the many months of work that went into that ticket, we should probably rebase this to that ticket.

comment:15 Changed 10 years ago by Jean-Pierre Flori

Of course, it somehow got out of my head.

I'll take this chance to provide a slightly cleaner patch, maybe using -lgmp to let the linker chose, not sure though, because if we really check for the existence of a shared *gmp*.* we can as well pass its full path to the linker.

comment:16 Changed 10 years ago by Dima Pasechnik

Status: needs_reviewneeds_work

doesn't work for me. I get

$ ./sage -f gap-4.5.7.p2.spkg
gap-4.5.7.p2
====================================================
Extracting package /usr/local/src/sage/sage-5.7.beta0/gap-4.5.7.p2.spkg
-rw-r--r-- 1 dima Domain Users 8274155 Jan 15 23:18 /usr/local/src/sage/sage-5.7.beta0/gap-4.5.7.p2.spkg
Finished extraction
****************************************************
Host system:
CYGWIN_NT-6.1-WOW64 SPMS-DIMA-W7-64 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.5.3/lto-wrapper.exe
Target: i686-pc-cygwin
[...]
gcc version 4.5.3 (GCC)
****************************************************
spkg-install is using
VERSION = 4.5.7
GAP_DIR = gap-4.5.7
INSTALL_DIR = /usr/local/src/sage/sage-5.7.beta0/local/gap/gap-4.5.7
Applying patches...
patching file cnf/aclocal.m4
patching file cnf/configure.out
Hunk #1 succeeded at 4428 (offset 26 lines).
patching file configure
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file configure.rej
Error applying '../patches/configure.patch'

real    0m1.047s
user    0m0.120s
sys     0m0.521s
************************************************************************
Error installing package gap-4.5.7.p2

comment:17 in reply to:  16 Changed 10 years ago by Dima Pasechnik

Replying to dimpase:

doesn't work for me.

however, I took the diff above and applied it in the gap spkg directory as follows:

patch -p1 <gap-4.5.7.p2.diff

the resulting spkg installed just fine on cygwin.

comment:18 Changed 10 years ago by Jean-Pierre Flori

Cc: dimapase added
Description: modified (diff)
Status: needs_workneeds_review

Ive uploaded a new spkg based on #13963.

After a quick look it does not seem that libgap which uses better checks for GMP will need any action from here, but I've not actually tried to build it yet. As I've finally found where my Cygwin memleak came from, I might test 5.7.beta1 quickly though.

comment:19 Changed 10 years ago by Jean-Pierre Flori

Cc: Dima Pasechnik added; dimapase removed

Changed 10 years ago by Jean-Pierre Flori

Attachment: gap-4.5.7.p3.diff added

Spkg diff, for review only.

comment:20 Changed 10 years ago by Dima Pasechnik

Status: needs_reviewpositive_review

comment:21 Changed 10 years ago by Jeroen Demeyer

Reviewers: Dmitrii Pasechnik

comment:22 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.7.beta2
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.