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

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

Closed
jpflori opened this issue Jan 14, 2013 · 22 comments
Closed

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

jpflori opened this issue Jan 14, 2013 · 22 comments

Comments

@jpflori
Copy link

jpflori commented Jan 14, 2013

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

CC: @kcrisman @dimpase

Component: packages: standard

Keywords: spkg gap cygwin

Author: Jean-Pierre Flori

Reviewer: Dmitrii Pasechnik

Merged: sage-5.7.beta2

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

@jpflori jpflori added this to the sage-5.7 milestone Jan 14, 2013
@jpflori
Copy link
Author

jpflori commented Jan 14, 2013

comment:1

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

@kcrisman
Copy link
Member

comment:2

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

@jpflori
Copy link
Author

jpflori commented Jan 14, 2013

comment:3

Yes that's it.

@jpflori
Copy link
Author

jpflori commented Jan 15, 2013

comment:4

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

@jpflori
Copy link
Author

jpflori commented Jan 15, 2013

comment:5

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

@kcrisman
Copy link
Member

comment:6

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!?

@kcrisman
Copy link
Member

comment:7

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.

@jpflori
Copy link
Author

jpflori commented Jan 15, 2013

comment:8

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

@vbraun
Copy link
Member

vbraun commented Jan 15, 2013

comment:9

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.

@kcrisman
Copy link
Member

comment:10
diff --git a/spkg-install b/spkg-install
--- a/spkg-install
+++ b/spkg-install
@@ -86,34 +86,6 @@
     exit 1
 fi
 
-# On Cygwin installations the GAP build creates a file 'gap.exe',
-# and then tries to strip the file 'gap'.
-# This broke the build on old Cygwin installations.
-# On newer Cygwins, 'gap' is automatically "translated" to 'gap.exe'.
-if [[ "$UNAME" = CYGWIN ]]; then
-    echo "Creating a dummy 'gap.exe' in 'bin/i686-pc-cygwin-gcc'..."
-    cd "$SPKG_ROOT/src"
-    mkdir -p bin/i686-pc-cygwin-gcc &&
-    cd bin/i686-pc-cygwin-gcc &&
-    touch gap.exe
-    if [[ $? -ne 0 ]]; then
-        # Something really went wrong.
-        echo >&2 "Error creating a dummy gap.exe file."
-        exit 1
-    fi
-    # Check if 'gap' is automatically "translated" to 'gap.exe'.
-    # If not, create a symbolic link from 'gap' to 'gap.exe'.
-    if [[ ! -f gap ]]; then
-        echo "Creating a symbolic link from 'gap' to 'gap.exe'..."
-        ln -s gap.exe gap
-        if [[ $? -ne 0 ]]; then
-            # Something really went wrong.
-            echo >&2 "Error creating the symbolic link."
-            exit 1
-        fi
-    fi
-fi
-
 echo "Building GAP..."
 cd "$SPKG_ROOT/src"
 $MAKE -j1
@@ -144,11 +116,7 @@
 echo "Copying GAP startup script..."
 rm -f "$SAGE_LOCAL/bin/gap"
 cd "$SPKG_ROOT"
-if [[ "$UNAME" = CYGWIN ]]; then
-    cp patches/gap_cygwin "$SAGE_LOCAL/bin/gap"
-else
-    cp src/bin/gap.sh "$SAGE_LOCAL/bin/gap"
-fi
+cp src/bin/gap.sh "$SAGE_LOCAL/bin/gap"
 if [[ $? -ne 0 ]]; then
     echo >&2 "Error copying customized GAP startup script."
     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.

@jpflori
Copy link
Author

jpflori commented Jan 15, 2013

comment:11

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.

@jpflori
Copy link
Author

jpflori commented Jan 15, 2013

Author: Jean-Pierre Flori

@kcrisman
Copy link
Member

comment:13

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.

@kcrisman
Copy link
Member

comment:14

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.

@jpflori
Copy link
Author

jpflori commented Jan 16, 2013

comment:15

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.

@dimpase
Copy link
Member

dimpase commented Jan 26, 2013

comment:16

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

@dimpase
Copy link
Member

dimpase commented Jan 26, 2013

comment:17

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.

@jpflori

This comment has been minimized.

@jpflori
Copy link
Author

jpflori commented Jan 26, 2013

comment:18

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.

@jpflori
Copy link
Author

jpflori commented Jan 26, 2013

Attachment: gap-4.5.7.p3.diff.gz

Spkg diff, for review only.

@jdemeyer
Copy link

Reviewer: Dmitrii Pasechnik

@jdemeyer
Copy link

Merged: sage-5.7.beta2

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

5 participants