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

4ti2 spkg fails to find gmp #18198

Closed
mkoeppe opened this issue Apr 14, 2015 · 20 comments
Closed

4ti2 spkg fails to find gmp #18198

mkoeppe opened this issue Apr 14, 2015 · 20 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Apr 14, 2015

I installed the packages gmp and then 4ti2 in my copy of Sage 6.5.

When building 4ti2, it does not detect GMP and consequently only builds the fixed-precision version of the code, not the GMP version of the code.
However, the GMP version is unconditionally used by sage.interfaces.four_ti_2

Depends on #18240

CC: @dimpase

Component: packages: optional

Keywords: 4ti2

Author: Matthias Koeppe

Reviewer: Dima Pasechnik

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

@dimpase
Copy link
Member

dimpase commented Apr 15, 2015

comment:1

This is most probably not a big issue, unless you must use GMP interface provided by GMP rather than GMP interface provided by MPIR. The latter is standard in Sage, and does not need to be installed (and cannot be removed).
(although this is certainly confusing)

I will have a look.

@dimpase
Copy link
Member

dimpase commented Apr 15, 2015

comment:2

here are more details; without optional GMP package installed, one still gets 4ti2gmp built by doing sage -i 4ti2; its linkage is as follows:

$ ldd local/bin/4ti2gmp 
	linux-vdso.so.1 =>  (0x00007fffd2179000)
	lib4ti2gmp.so.0 => /home/dima/software/sage.6.6/sage/local/lib/lib4ti2gmp.so.0 (0x00007f5ff4cc7000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5ff49a8000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5ff4791000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5ff43cc000)
	libglpk.so.36 => /home/dima/software/sage.6.6/sage/local/lib/libglpk.so.36 (0x00007f5ff40f4000)
	libgmpxx.so.8 => /home/dima/software/sage.6.6/sage/local/lib/libgmpxx.so.8 (0x00007f5ff3eee000)
	libgmp.so.16 => /home/dima/software/sage.6.6/sage/local/lib/libgmp.so.16 (0x00007f5ff3c7a000)t
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5ff3974000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f5ff4f4e000)
	libz.so.1 => /home/dima/software/sage.6.6/sage/local/lib/libz.so.1 (0x00007f5ff3759000)

it looks as it is linked against GMP, but this is just a differently named copy of MPIR.

@dimpase
Copy link
Member

dimpase commented Apr 15, 2015

comment:3

and after sage -i gmp followed by sage -f 4ti2 (i.e. re-installing 4ti2 with GMP from GMP) I still get 4ti2gmp built, with the following weird linkage:

$ ldd local/bin/4ti2gmp 
	linux-vdso.so.1 =>  (0x00007fff89be3000)
	lib4ti2gmp.so.0 => /home/dima/software/sage.6.6/sage/local/lib/lib4ti2gmp.so.0 (0x00007f237844b000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f237812c000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2377f15000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2377b50000)
	libglpk.so.36 => /home/dima/software/sage.6.6/sage/local/lib/libglpk.so.36 (0x00007f2377878000)
	libgmpxx.so.4 => /home/dima/software/sage.6.6/sage/local/lib/libgmpxx.so.4 (0x00007f2377671000)
	libgmp.so.10 => /home/dima/software/sage.6.6/sage/local/lib/libgmp.so.10 (0x00007f23773fb000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f23770f5000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f23786d2000)
	libz.so.1 => /home/dima/software/sage.6.6/sage/local/lib/libz.so.1 (0x00007f2376eda000)
	libgmp.so.16 => /home/dima/software/sage.6.6/sage/local/lib/libgmp.so.16 (0x00007f2376c66000)

here we see that it picked up both GMP from GMP, i.e. libmp.so.10 and GMP from MPIR, i.e. libgmp.so.16.

Is this what you are getting, as well?

@dimpase
Copy link
Member

dimpase commented Apr 15, 2015

comment:4

I suggest we move over to using the just released Sage 6.6. (I also presume you talk about Sage compiled from source).

@mkoeppe
Copy link
Member Author

mkoeppe commented Apr 16, 2015

comment:5

Replying to @dimpase:

I suggest we move over to using the just released Sage 6.6. (I also presume you talk about Sage compiled from source).

Thanks for looking into this, Dima.

I was using the Sage 6.5 binaries for Mac OS X (I should have said that).
Now I updated to Sage 6.6, again using the binaries.

This is what I get if I do NOT install the gmp package first.

egret-2:~/s/sage/sage-6.6 (develop)$ sage -i 4ti2
/Users/mkoeppe/s/sage/sage-6.6/src/bin/sage-spkg: line 312: cd: /Users/mkoeppe/s/sage/sage-6.6/upstream: No such file or directory
Attempting to download package 4ti2
>>> Checking online list of optional packages.
[.]
>>> Found 4ti2-1.6.2
>>> Trying to download http://www.sagemath.org/spkg/optional/4ti2-1.6.2.spkg
[............................................................]
4ti2-1.6.2
====================================================
Extracting package /Users/mkoeppe/s/sage/sage-6.6/upstream/4ti2-1.6.2.spkg
-rw-r--r--  1 mkoeppe  staff  4658185 Apr 16 09:03 /Users/mkoeppe/s/sage/sage-6.6/upstream/4ti2-1.6.2.spkg
Finished extraction
****************************************************
Host system:
Darwin egret-2.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=/Users/mkoeppe/s/sage/sage-6.6/local/bin/gcc
COLLECT_LTO_WRAPPER=/Users/mkoeppe/s/sage/sage-6.6/local/bin/../libexec/gcc/x86_64-apple-darwin11.4.2/4.9.2/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ../src/configure --prefix=/Users/karl.crisman/Downloads/sage-6.6/local --with-local-prefix=/Users/karl.crisman/Downloads/sage-6.6/local --with-gmp=/Users/karl.crisman/Downloads/sage-6.6/local --with-mpfr=/Users/karl.crisman/Downloads/sage-6.6/local --with-mpc=/Users/karl.crisman/Downloads/sage-6.6/local --with-system-zlib --disable-multilib --disable-nls --enable-languages=c,c++,fortran --disable-libitm --without-isl --without-cloog  
Thread model: posix
gcc version 4.9.2 (GCC)
[----8<-----] 
checking how to hardcode library paths into programs... immediate
checking for GMP >= 3.1.1... configure: WARNING: GNU MP not found.
4ti2 will be built without support for arbitrary-precision computations.
configure: WARNING: Unable to use the GNU MP C++ library.
Please make sure that GNU MP was configured with "--enable-cxx".
4ti2 will be built without support for arbitrary-precision computations.
[----8<-----] 

If I do install gmp first, it looks the same.

Later I can try a Sage compiled from source; but in any case it seems there needs to be more testing in place to catch this build error on this platform.

@dimpase
Copy link
Member

dimpase commented Apr 16, 2015

comment:6

Replying to @mkoeppe:

Replying to @dimpase:

I suggest we move over to using the just released Sage 6.6. (I also presume you talk about Sage compiled from source).

Thanks for looking into this, Dima.

I was using the Sage 6.5 binaries for Mac OS X (I should have said that).
Now I updated to Sage 6.6, again using the binaries.

It perhaps should be said clearly in the docs that the binary distributions of Sage cannot do all the building right; it can deal with Python and Cython, but installing optional packages that build libraries might not work.

Be warned that the latest XCode (6.3) for OSX 10.10 is quite broken and cannot build Sage at the moment, IIRC. One has to have 6.2 instead.

@dimpase
Copy link
Member

dimpase commented Apr 16, 2015

comment:7

Replying to @dimpase:

It perhaps should be said clearly in the docs that the binary distributions of Sage cannot do all the building right; it can deal with Python and Cython, but installing optional packages that build libraries might not work.

Be warned that the latest XCode (6.3) for OSX 10.10 is quite broken and cannot build Sage at the moment, IIRC. One has to have 6.2 instead.

I've just posted this: https://groups.google.com/d/msg/sage-devel/fEoDWZdkdUo/8kmpi5pkLW4J

@mkoeppe
Copy link
Member Author

mkoeppe commented Apr 16, 2015

comment:8

Replying to @dimpase:

Replying to @dimpase:

It perhaps should be said clearly in the docs that the binary distributions of Sage cannot do all the building right; it can deal with Python and Cython, but installing optional packages that build libraries might not work.

Be warned that the latest XCode (6.3) for OSX 10.10 is quite broken and cannot build Sage at the moment, IIRC. One has to have 6.2 instead.

Thanks a lot. I managed to build from source from git off 6.7.beta0 after downgrading to XCode 6.2.
The problem persists.

@dimpase
Copy link
Member

dimpase commented Apr 17, 2015

comment:9

Replying to @mkoeppe:

Replying to @dimpase:

Replying to @dimpase:

It perhaps should be said clearly in the docs that the binary distributions of Sage cannot do all the building right; it can deal with Python and Cython, but installing optional packages that build libraries might not work.

Be warned that the latest XCode (6.3) for OSX 10.10 is quite broken and cannot build Sage at the moment, IIRC. One has to have 6.2 instead.

Thanks a lot. I managed to build from source from git off 6.7.beta0 after downgrading to XCode 6.2.
The problem persists

please provide the full log of the 4ti2 build; it is in SAGEROOT/logs/pkgs/4ti2.log; (you can upload it as an attachment on this ticket).

Usual causes for such a thing is that you have another installation of GMP that gets into the picture, the one that comes from macports/homebrew, or that you have something funny in your PATH. But perhaps it's something more profound, platform (OSX) specific.

@dimpase
Copy link
Member

dimpase commented Apr 17, 2015

comment:10

Regarding 4ti2 spkg on OSX, last time I checked on OSX10.9.5 with Sage 6.6.beta1, and it worked just fine, making 4ti2gmp etc etc. I'll check the latest Sage beta later today.

@dimpase
Copy link
Member

dimpase commented Apr 17, 2015

comment:11

Replying to @dimpase:

Regarding 4ti2 spkg on OSX, last time I checked on OSX10.9.5 with Sage 6.6.beta1, and it worked just fine, making 4ti2gmp etc etc. I'll check the latest Sage beta later today.

I can also confirm that things work with 6.7.beta1. I suppose I should upgrade OS.

@dimpase
Copy link
Member

dimpase commented Apr 17, 2015

comment:12

I am able to reproduce this with a binary release of Sage 6.7.beta1 on Linux. Thus it is not OSX-specific. But the binary releases are definitely broken in this sense.

@dimpase
Copy link
Member

dimpase commented Apr 17, 2015

comment:13

oops, this is a bug in MPIR; reported here, https://groups.google.com/d/msg/sage-devel/Tu-egDn-zLw/0S5ouau2J1AJ
but not yet fixed (basically, can be worked around by editing mpir.h and gmp.h).

This happens after we went to gcc 4.9, where this shows up.

Nothing to do with binary vs source distributions, either, mea culpa.

@dimpase
Copy link
Member

dimpase commented Apr 17, 2015

comment:14

Please try the patch at #18240, and sorry for asking you to do unnecessary checks etc...

@mkoeppe
Copy link
Member Author

mkoeppe commented Apr 19, 2015

comment:15

Replying to @dimpase:

Please try the patch at #18240, and sorry for asking you to do unnecessary checks etc...

Thanks a lot, #18240 fixes it for me.

@dimpase
Copy link
Member

dimpase commented Apr 19, 2015

Author: Matthias Koeppe

@dimpase
Copy link
Member

dimpase commented Apr 19, 2015

Dependencies: 18240

@dimpase
Copy link
Member

dimpase commented Apr 19, 2015

Reviewer: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Apr 19, 2015

comment:17

it will be fixed by #18240, which needs review.

@vbraun
Copy link
Member

vbraun commented Apr 21, 2015

Changed dependencies from 18240 to #18240

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

3 participants