At some point I will resubmit -- I'm just too busy right now. I
don't know what invalidate means but I'd appreciate it if the ticket
(and the patch!) stayed in TRAC.
Nick
On OSX ppc the sage alpha1 build fails with this. Unfortunately, I
can't work on fixing this since
I have committee work to do right now. If we can't fix this, a
reasonable option is to just comment
out building the cremona code in setup.py for now, and put some
nodoctests in the top
of the pyx files in devel/sage/sage/libs/cremona/*.pyx. This would
be OK for now.
sage/plot/plot3d/shapes.pyx -->
/Users/was/sage-2.8.13.alpha1/local//lib/python/site-packages//sage/plot/plot3d/shapes.pyx
running install
running build
running build_py
running build_ext
building 'sage.libs.cremona.homspace' extension
g++ -bundle -undefined dynamic_lookup
build/temp.macosx-10.3-ppc-2.5/sage/libs/cremona/homspace.o
-L/Users/was/sage-2.8.13.alpha1/local//lib -lcsage -lg0nntl -ljcntl
-lgmpxx -lntl -lgmp -lm -lstdc++ -lstdc++ -lntl -o
build/lib.macosx-10.3-ppc-2.5/sage/libs/cremona/homspace.so
/usr/bin/ld: warning can't open dynamic library: libpari-gmp.dylib
referenced from:
/Users/was/sage-2.8.13.alpha1/local//lib/libcsage.dylib (checking for
undefined
symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: libcurvesntl.dylib
referenced from:
/Users/was/sage-2.8.13.alpha1/local//lib/libg0nntl.dylib (checking for
undefine
d symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: Undefined symbols:
_GENtostr referenced from libjcntl expected to be defined in libpari-gmp.dylib
_Z_factor referenced from libjcntl expected to be defined in libpari-gmp.dylib
_avma referenced from libjcntl expected to be defined in libpari-gmp.dylib
_bot referenced from libjcntl expected to be defined in libpari-gmp.dylib
_isprime referenced from libjcntl expected to be defined in libpari-gmp.dylib
_pari_init referenced from libjcntl expected to be defined in libpari-gmp.dylib
_strtoi referenced from libjcntl expected to be defined in libpari-gmp.dylib
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
sage: There was an error installing modified sage library code.
real 0m21.464s
user 0m9.699s
sys 0m11.626s
ERROR installing SAGE
real 21m33.408s
user 19m45.068s
sys 1m44.815s
sage: An error occurred while installing sage-2.8.13.alpha1
Please email sage-devel http://groups.google.com/group/sage-devel
explaining the problem and send the relevant part of
of /Users/was/sage-2.8.13.alpha1/install.log. Describe your computer,
operating system, etc.
If you want to try to fix the problem, yourself *don't* just cd to
/Users/was/sage-2.8.13.alpha1/spkg/build/sage-2.8.13.alpha1 and type 'make'.
In the current alpha 1 the *build* of flint fails:
ops -fexpensive-optimizations -fPIC -funroll-loops -O3
ZmodF_poly-test.o test-support.o -o ZmodF_poly-test mpn_extras.o
mpz_extras.o memory-manager.o ZmodF.o Zmo
dF_mul.o ZmodF_mul-tuning.o fmpz.o fmpz_poly.o mpz_poly-tuning.o
mpz_poly.o ZmodF_poly.o long_extras.o
-L/Users/was/sage-2.8.13.alpha1/local/lib/ -L/Users/was/sage
-2.8.13.alpha1/local/lib/
-L/Users/was/sage-2.8.13.alpha1/local/include -lgmp -lpthread -lm
-lntl
gcc -std=c99 -I/Users/was/sage-2.8.13.alpha1/local/include/
-I/Users/was/sage-2.8.13.alpha1/local/include
-I/Users/was/sage-2.8.13.alpha1/local/include -funroll-lo
ops -fexpensive-optimizations -fPIC -funroll-loops -O3 -c
ZmodF_mul-test.c -o ZmodF_mul-test.o
ZmodF_mul.h:169: warning: inline function
â~@~X_ZmodF_mul_threeway_reduce2â~@~Y declared but never defined
ZmodF_mul.h:166: warning: inline function
â~@~X_ZmodF_mul_threeway_reduce1â~@~Y declared but never defined
ZmodF_mul.h:169: warning: inline function
â~@~X_ZmodF_mul_threeway_reduce2â~@~Y declared but never defined
ZmodF_mul.h:166: warning: inline function
â~@~X_ZmodF_mul_threeway_reduce1â~@~Y declared but never defined
gcc -std=c99 -I/Users/was/sage-2.8.13.alpha1/local/include/
-I/Users/was/sage-2.8.13.alpha1/local/include
-I/Users/was/sage-2.8.13.alpha1/local/include -funroll-lo
ops -fexpensive-optimizations -fPIC -funroll-loops -O3
ZmodF_mul-test.o test-support.o -o ZmodF_mul-test mpn_extras.o
mpz_extras.o memory-manager.o ZmodF.o ZmodF
_mul.o ZmodF_mul-tuning.o fmpz.o fmpz_poly.o mpz_poly-tuning.o
mpz_poly.o ZmodF_poly.o long_extras.o
-L/Users/was/sage-2.8.13.alpha1/local/lib/ -L/Users/was/sage-2
.8.13.alpha1/local/lib/ -L/Users/was/sage-2.8.13.alpha1/local/include
-lgmp -lpthread -lm -lntl
Undefined symbols:
"__ZmodF_mul_threeway_reduce1", referenced from:
_test__ZmodF_mul_threeway_reduce in ZmodF_mul-test.o
"__ZmodF_mul_threeway_reduce2", referenced from:
_test__ZmodF_mul_threeway_reduce in ZmodF_mul-test.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [ZmodF_mul-test] Error 1
Failed to build FLINT dylib.
real 0m28.796s
user 0m16.183s
sys 0m1.335s
sage: An error occurred while installing flint-0.9.p0
-----
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
The build failure below is on a Xeon quad-core Mac Pro running OS X
10.5, i.e., bsd.math.washington.edu.
If you want to try building and testing FLINT on it, let me know off
list and I'll create an account for you.
In python // means "floor divisions". It's the same semantics as \ in
PARI. It means divide and
forget the remainder. E.g.,
5 // 3 == 1
> Typing:
>
> ??f.__div__
// is not "__div__". You should just look at the relevant source file
anyways, which is in
SAGE_ROOT/devel/sage/sage/libs/flint/
> When I found a function which did return source code, much of it was
> black text on black background, so it just looked like gibberish. For
> the longest time I thought this was actually python, so I had vowed
> never to learn the language.
Didn't anybody mention to you that Python is a language where only
whitespace is significant?
For example, here is a Python program to factor integers in polynomial time:
> Working over ZZ['x'] if I accidentally type:
>
> mul(f,f)
>
> it amusingly multiplies f by 6.
Which is completely correct if you read the docs for mul, which
multiplies together the
elements of a list or list-like object. What it is doing is
multiplying together the
entries of f, but starting the product with f itself:
sage: R.<x> = ZZ[]
sage: f = R([3,4,5])
sage: mul(f,f)
300*x^2 + 240*x + 180
sage: 3*4*5 * f
300*x^2 + 240*x + 180
You can't just type random things you make up into a computer algebra
system and expect
them to behave like you want at the moment.
> If I use FLINT polynomials and type the same thing, it sits there
> forever and there is no way to stop it. Of course the semantically
> correct f.__mul__(f) works fine.
That's because it is trying to turn your FLINT poly into a list, and getting
an infinite list (since the default implementation for making a list
for something
hasn't been overridden yet for FLINT polys).
If you want to use functional notation for arithmetic use the operator module:
sage: operator.[tab]
sage: operator.mul(f, f)
25*x^4 + 40*x^3 + 46*x^2 + 24*x + 9
sage: operator.floordiv(f,f)
1
>
> In answer to your question, I think // is divrem, which FLINT
> implements.
No, it's floor division.
sage: operator.floordiv?
floordiv(a, b) -- Same as a // b.
> FLINT also implements div in ZZ['x'], which is not the same thing as
> div in SAGE. For example 3/4 returns 3/4, but 6/3 returns 2. At
> present there is no function in FLINT which returns the quotient if
> division is exact and nothing at all if it is not (in which case SAGE
> seems to return a symbolic expression f/g).
Sage doesn't return a symbolic expression from elements of ZZ['x']. It returns
an element of the fraction field, Frac(ZZ['x']). Maybe I'm being
confused though,
since there is a SymbolicExpression class in the calculus module, and that's
probably not what you're thinking of.
> NTL has such a function,
> but it isn't implemented in FLINT yet.
>
> Instead polynomial division always returns something in ZZ['x'] in
> FLINT. Basically it returns the same thing as what Magma returns when
> you type f div g. It's a kind of normalised division, which just
> happens to be the quotient when the division is exact.
That's like integer division in python, where:
>>> 2/3
0
This is definitely the *wrong* semantics for Sage, since it is not
mathematically correct.
That I think completely answers Michael Abshoff's question that
started this thread.
William
>
> Bill.
Whatever you did in rev 1072, it *DOES* fix the problem (I just tested it).
Great work!
William
Nick