#6456: Upgrade cvxopt in sage from 0.9 to 1.1.2
--------------------------------+-------------------------------------------
Reporter: was | Owner: mabshoff
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.5.2
Component: packages | Keywords:
Author: schilly, dimpase | Upstream: Reported upstream. Little or no
feedback.
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Changes (by dimpase):
* upstream: N/A => Reported upstream. Little or no feedback.
Comment:
Replying to [comment:50 pjeremy]:
> 6456-freebsd-spkg-install.patch adds support for FreeBSD (this is a port
of the patch in #9601). I have compile-tested this but not yet tried to
use the resultant module.
>
> Note that further changes are necessary for cvxopt-1.1.2.p1.spkg to work
on most 64-bit OSs.
> Compiling in FreeBSD/amd64 (with or without the above patch) gives:
> {{{
> gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I/mnt/sage-4.5/local/include -fPIC -DDLONG=
-I/mnt/sage-4.5/local/include/python2.6 -c C/misc_solvers.c -o
build/temp.freebsd-8.1-PRERELEASE-amd64-2.6/C/misc_solvers.o
> C/misc_solvers.c: In function 'scale':
> C/misc_solvers.c:152:13: warning: passing argument 1 of 'dscal_' from
incompatible pointer type
> C/misc_solvers.c:32:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:152:13: warning: passing argument 4 of 'dscal_' from
incompatible pointer type
> C/misc_solvers.c:32:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:155:13: warning: passing argument 3 of 'dgemv_' from
incompatible pointer type
> C/misc_solvers.c:39:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:156:9: warning: passing argument 1 of 'dscal_' from
incompatible pointer type
> C/misc_solvers.c:32:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:156:9: warning: passing argument 4 of 'dscal_' from
incompatible pointer type
> C/misc_solvers.c:32:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:158:13: warning: passing argument 2 of 'dger_' from
incompatible pointer type
> C/misc_solvers.c:41:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:160:13: warning: passing argument 1 of 'dscal_' from
incompatible pointer type
> C/misc_solvers.c:32:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:160:13: warning: passing argument 4 of 'dscal_' from
incompatible pointer type
> C/misc_solvers.c:32:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c: In function 'pack2':
> C/misc_solvers.c:459:17: warning: passing argument 3 of 'dlacpy_' from
incompatible pointer type
> C/misc_solvers.c:49:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:459:17: warning: passing argument 5 of 'dlacpy_' from
incompatible pointer type
> C/misc_solvers.c:49:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:461:17: warning: passing argument 1 of 'dscal_' from
incompatible pointer type
> C/misc_solvers.c:32:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:463:17: warning: passing argument 3 of 'dlacpy_' from
incompatible pointer type
> C/misc_solvers.c:49:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> C/misc_solvers.c:463:17: warning: passing argument 7 of 'dlacpy_' from
incompatible pointer type
> C/misc_solvers.c:49:13: note: expected 'int *' but argument is of type
'Py_ssize_t *'
> }}}
the following 2-byte change appears to cure the problem. Semantically,
this
restricts the dense matrices that are dealt with to the sizes 2^31 by
2^31, but this
is OK for all the practical purposes.
Hopefully CVXOPT people will come up with a better fix, but for the time
being
this should suffice and cure this particular headache.
{{{
--- a/patches/cvxopt.h Mon Jul 26 18:45:42 2010 +0300
+++ b/patches/cvxopt.h Thu Jul 29 09:12:21 2010 -0700
@@ -61,7 +61,7 @@
typedef struct {
PyObject_HEAD
void *buffer; /* in column-major-mode array of type 'id' */
- int_t nrows, ncols; /* number of rows and columns */
+ int nrows, ncols; /* number of rows and columns -- was int_t */
int id; /* DOUBLE, INT, COMPLEX */
} matrix;
}}}
>
> `Py_ssize_t` is typedef'd from `ssize_t`, which is `long` on at least
FreeBSD, Linux and Solaris. I believe this is a blocking issue.
It remains to sort out the complex.h stuff on Solaris...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6456#comment:80>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.