Bug#780251: python-cvxopt: Doesn't work anymore

2015-03-15 Thread Sébastien Villemot
Control: tags -1 + pending

I have uploaded to DELAYED/5 a NMU prepared by Jean-Michel Vourgère. The
debdiff is attached.

Cheers,

-- 
 .''`.Sébastien Villemot
: :' :Debian Developer
`. `' http://sebastien.villemot.name
  `-  GPG Key: 4096R/381A7594


diff -Nru cvxopt-1.1.4/debian/changelog cvxopt-1.1.4/debian/changelog
--- cvxopt-1.1.4/debian/changelog	2013-12-06 17:38:32.0 +0100
+++ cvxopt-1.1.4/debian/changelog	2015-03-15 11:54:07.0 +0100
@@ -1,3 +1,11 @@
+cvxopt (1.1.4-1.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix glpk-4.49.diff: Link the lpx emulation file, fix the #if activation
+test. This fixes undefined symbol: lpx_create_prob bugs. (Closes: #780251)
+
+ -- Jean-Michel Nirgal Vourgère jmv_...@nirgal.com  Wed, 11 Mar 2015 23:00:40 +0100
+
 cvxopt (1.1.4-1.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru cvxopt-1.1.4/debian/patches/glpk-4.49.diff cvxopt-1.1.4/debian/patches/glpk-4.49.diff
--- cvxopt-1.1.4/debian/patches/glpk-4.49.diff	2013-12-06 17:39:16.0 +0100
+++ cvxopt-1.1.4/debian/patches/glpk-4.49.diff	2015-03-14 21:15:54.0 +0100
@@ -3,13 +3,16 @@
  patch adds compatibility routines that were provided by the upstream author of
  GLPK.
 Author: Sébastien Villemot sebast...@debian.org
+Author: Jean-Michel Nirgal Vourgère jmv_...@nirgal.com
 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714368
-Forwarded: no
-Last-Update: 2013-08-15
+Forwarded: not-needed
+Last-Update: 2015-03-11
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 a/src/C/glpk.c
-+++ b/src/C/glpk.c
+Index: cvxopt-1.1.4/src/C/glpk.c
+===
+--- cvxopt-1.1.4.orig/src/C/glpk.c
 cvxopt-1.1.4/src/C/glpk.c
 @@ -20,7 +20,7 @@
  
  #include cvxopt.h
@@ -19,8 +22,10 @@
  
  PyDoc_STRVAR(glpk__doc__,
  Interface to the simplex and mixed integer LP algorithms in GLPK.\n\n
+Index: cvxopt-1.1.4/src/C/lpx.c
+===
 --- /dev/null
-+++ b/src/C/lpx.c
 cvxopt-1.1.4/src/C/lpx.c
 @@ -0,0 +1,1516 @@
 +/* lpx.c (old GLPK API) */
 +
@@ -35,12 +40,12 @@
 +*  Please note that you may mix calls to old and new GLPK API routines
 +*  (except calls to glp_create_prob and glp_delete_prob). */
 +
-+#if (GLP_VERSION_MAJOR == 4  GLP_MINOR_VERSION = 49) || GLP_VERSION_MAJOR  4
-+
 +#include float.h
 +#include limits.h
 +#include lpx.h
 +
++#if (GLP_MAJOR_VERSION == 4  GLP_MINOR_VERSION = 49) || GLP_MAJOR_VERSION  4
++
 +#define xassert glp_assert
 +#define xerror  glp_error
 +
@@ -1538,8 +1543,10 @@
 +
 +/* eof */
 +
+Index: cvxopt-1.1.4/src/C/lpx.h
+===
 --- /dev/null
-+++ b/src/C/lpx.h
 cvxopt-1.1.4/src/C/lpx.h
 @@ -0,0 +1,568 @@
 +/* lpx.h (old GLPK API) */
 +
@@ -2109,3 +2116,16 @@
 +
 +#endif
 +/* eof */
+Index: cvxopt-1.1.4/src/setup.py
+===
+--- cvxopt-1.1.4.orig/src/setup.py
 cvxopt-1.1.4/src/setup.py
+@@ -63,7 +63,7 @@ if BUILD_GLPK:
+ glpk = Extension('glpk', libraries = ['glpk'],
+ include_dirs = [ GLPK_INC_DIR ],
+ library_dirs = [ GLPK_LIB_DIR ],
+-sources = ['C/glpk.c'] )
++sources = ['C/glpk.c', 'C/lpx.c'] )
+ extmods += [glpk];
+ 
+ if BUILD_DSDP:


signature.asc
Description: This is a digitally signed message part


Bug#780251: python-cvxopt: Doesn't work anymore

2015-03-11 Thread Julien Puydt

Hi,

Le 11/03/2015 17:59, Jean-Michel Nirgal Vourgère a écrit :

Control: tags -1 moreinfo
Control: severity -1 normal

Hello Julien

I ran all the tutorial examples from
http://cvxopt.org/examples/index.html. Everything works fine here.

Can you give us a test case?


One line is enough to trigger the problem :

jpuydt@cauchy:~$ python
Python 2.7.9 (default, Mar  1 2015, 12:57:24)
[GCC 4.9.2] on linux2
Type help, copyright, credits or license for more information.
 from cvxopt import glpk
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: /usr/lib/python2.7/dist-packages/cvxopt/glpk.so: undefined 
symbol: lpx_create_prob




I am downgrading the severity since it doesn't look unusable for all users.

Also, can you give us the bottom the mail generated by reportbug
python-cvxopt, so we can double check which version of dependencies you
are using?


Yes, I can :

Versions of packages python-cvxopt depends on:
ii  libatlas3-base [liblapack.so.3]  3.10.2-7
ii  libblas3 [libblas.so.3]  1.2.20110419-10
ii  libc62.19-15
ii  libdsdp-5.8gf5.8-9.1
ii  libfftw3-double3 3.3.4-2
ii  libglpk364.55-1
ii  libgsl0ldbl  1.16+dfsg-2
ii  liblapack3 [liblapack.so.3]  3.5.0-4
ii  python   2.7.8-4

I hope that helps,

Snark on #debian-science


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#780251: python-cvxopt: Doesn't work anymore

2015-03-11 Thread Julien Puydt

Hi,

Le 11/03/2015 20:46, Jean-Michel Nirgal Vourgère a écrit :

Control: retitle python-cvxopt: glpk component doesn't work anymore
Control: severity -1 important
Control: tags -1 -moreinfo +confirmed +fixed-upstream +patch

I traced back the problem to release 4.53 of glpk [1], in February 2014.
According to policy 8.6.2, there should have been a SONAME bump to 37 in
order to have a smooth transition.


Quite a few upstreams don't know the rules of soname numbering...


Anyway, looking at the upstream source, references to lpx_create_prob
have been changed to glp_create_prob in version 1.1.7 [2], but the
commit is not atomic and in fact huge.

Attached is a patch that replaces glpk-4.49.diff. It upgrades
src/C/glpk.c and only that from version 1.1.4 to version 1.1.7, from
upstream.

It sure resolves the import, but I don't know how to properly test it.

Julien: Can you provide a small test?


I'm not sure it counts as a proper test, but the following works here 
with the cvxopt 1.1.7 package I made :


import cvxopt.glpk
import cvxopt
c=cvxopt.matrix([1,1,0,0,0,0])
G=cvxopt.matrix([[1.0,0,0,0,0,0], [0,1,0,0,0,0]])
h=cvxopt.matrix([0.0,0.0])
A=cvxopt.matrix([[0.0,1,0,0,0,6], [1,1,0,0,1,0], [1,0,0,1,0,0]])
b=cvxopt.matrix([2.0, 2, 2])
(status, c)=cvxopt.glpk.ilp(-c,-(G.T),-h,A.T,b,I=set([0,1,2,3,4,5]))
print(status, c)

I hope that helps,

Snark on #debian-science


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#780251: python-cvxopt: Doesn't work anymore

2015-03-11 Thread Sébastien Villemot
Le mercredi 11 mars 2015 à 19:46 +, Jean-Michel Nirgal Vourgère a
écrit :

 Anyway, looking at the upstream source, references to lpx_create_prob
 have been changed to glp_create_prob in version 1.1.7 [2], but the
 commit is not atomic and in fact huge.

I am pretty sure that ABI tracking has been done correctly in glpk. I
maintain a symbols file and would have noticed a symbol removal.
Concerning the lpx_create_prob symbol, I think it was removed precisely
at the moment of the bump from libglpk0 to libglpk36.

So my intuition is that the problem in cvxopt comes from somewhere else.
Looking at the patch glpk-4.49.diff that I have added in the package in
order to provide a compatibility layer, it looks like I forgot to link
lpx.c into glpk.so (which also means that I did not test the package
before NMUing, shame on me).

-- 
 .''`.Sébastien Villemot
: :' :Debian Developer
`. `' http://sebastien.villemot.name
  `-  GPG Key: 4096R/381A7594




signature.asc
Description: This is a digitally signed message part


Bug#780251: python-cvxopt: Doesn't work anymore

2015-03-11 Thread Jean-Michel Nirgal Vourgère
Control: retitle python-cvxopt: glpk component doesn't work anymore
Control: severity -1 important
Control: tags -1 -moreinfo +confirmed +fixed-upstream +patch

I traced back the problem to release 4.53 of glpk [1], in February 2014.
According to policy 8.6.2, there should have been a SONAME bump to 37 in
order to have a smooth transition.

Anyway, looking at the upstream source, references to lpx_create_prob
have been changed to glp_create_prob in version 1.1.7 [2], but the
commit is not atomic and in fact huge.

Attached is a patch that replaces glpk-4.49.diff. It upgrades
src/C/glpk.c and only that from version 1.1.4 to version 1.1.7, from
upstream.

It sure resolves the import, but I don't know how to properly test it.

Julien: Can you provide a small test?


[1]
https://anonscm.debian.org/cgit/debian-science/packages/glpk.git/commit/?id=3f635b63468815873c9c33dd497dea8240d607fa

[2] commit f3ca94fb997979a54b913f95b816132f7fd44820 on
https://github.com/cvxopt/cvxopt/

-- 
Nirgal
Description: Bring glpk component to version 1.1.7
 glpk ABI has changed and some symbols are no longer available.
 .
 That patch is the complete diff between version 1.1.4 and 1.1.7, but limited to the src/C/glpk.c file.
Author: Martin Andersen martin.skovgaard.ander...@gmail.com
Origin: upstream
Bug-Debian: https://bugs.debian.org/780251
Forwarded: not-needed
Reviewed-By: Jean-Michel Nirgal Vourgère jmv_...@nirgal.com
Last-Update: 2015-03-11

Index: cvxopt-1.1.4/src/C/glpk.c
===
--- cvxopt-1.1.4.orig/src/C/glpk.c
+++ cvxopt-1.1.4/src/C/glpk.c
@@ -1,8 +1,9 @@
 /*
+ * Copyright 2012-2014 M. Andersen and L. Vandenberghe.
  * Copyright 2010-2011 L. Vandenberghe.
  * Copyright 2004-2009 J. Dahl and L. Vandenberghe.
  *
- * This file is part of CVXOPT version 1.1.4.
+ * This file is part of CVXOPT version 1.1.7.
  *
  * CVXOPT is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,76 +21,36 @@
 
 #include cvxopt.h
 #include misc.h
-#include glpk.h
+#include glpk.h
+#include float.h
+#include limits.h
 
 PyDoc_STRVAR(glpk__doc__,
 Interface to the simplex and mixed integer LP algorithms in GLPK.\n\n
 The GLPK control parameters have the default values listed in \n
-the GLPK documentation, except for 'LPX_K_PRESOL', which is set\n
-to 1 and cannot be modified.  The other parameters can be\n
-modified by making an entry in the dictionary glpk.options.\n
-For example, the command glpk.options['LPX_K_MSGLEV'] = 0 turns\n
-off the printed output during execution of glpk.simplex().\n
-See the documentation at www.gnu.org/software/glpk/glpk.html for\n
-the list of GLPK control parameters and their default values.);
+the GLPK documentation (section 2.8.1 for the simplex solver and \n
+section 2.10.5 for the MILP solver).  The control  parameters can \n
+be modified by making an entry in the dictionary glpk.options.\n
+For example, glpk.options['msg_lev'] = 'GLP_MSG_OFF' turns off the \n
+printed output will be turned off during execution of glpk.lp().\n  
+Setting glpk.options['it_lim'] = 10 sets the simplex iteration \n
+limit to 10.  Unrecognized entries in glpk.options are ignored.);
 
 static PyObject *glpk_module;
 
-typedef struct {
-char  name[20];
-int   idx;
-char  type;
-}   param_tuple;
-
-static const param_tuple GLPK_PARAM_LIST[] = {
-{LPX_K_MSGLEV,LPX_K_MSGLEV,   'i'}, 
-{LPX_K_SCALE, LPX_K_SCALE,'i'},
-{LPX_K_DUAL,  LPX_K_DUAL, 'i'},
-{LPX_K_PRICE, LPX_K_PRICE,'i'},
-{LPX_K_RELAX, LPX_K_RELAX,'f'},
-{LPX_K_TOLBND,LPX_K_TOLBND,   'f'},
-{LPX_K_TOLDJ, LPX_K_TOLDJ,'f'},
-{LPX_K_TOLPIV,LPX_K_TOLPIV,   'f'},
-{LPX_K_ROUND, LPX_K_ROUND,'i'},
-{LPX_K_OBJLL, LPX_K_OBJLL,'f'},
-{LPX_K_OBJUL, LPX_K_OBJUL,'f'},
-{LPX_K_ITLIM, LPX_K_ITLIM,'i'},
-{LPX_K_ITCNT, LPX_K_ITCNT,'i'}, 
-{LPX_K_TMLIM, LPX_K_TMLIM,'f'},
-{LPX_K_OUTFRQ,LPX_K_OUTFRQ,   'i'},
-{LPX_K_OUTDLY,LPX_K_OUTDLY,   'f'},
-{LPX_K_BRANCH,LPX_K_BRANCH,   'i'},
-{LPX_K_BTRACK,LPX_K_BTRACK,   'i'},
-{LPX_K_TOLINT,LPX_K_TOLINT,   'f'},
-{LPX_K_TOLOBJ,LPX_K_TOLOBJ,   'f'},
-{LPX_K_MPSINFO,   LPX_K_MPSINFO,  'i'},
-{LPX_K_MPSOBJ,LPX_K_MPSOBJ,   'i'},
-{LPX_K_MPSORIG,   LPX_K_MPSORIG,  'i'},
-{LPX_K_MPSWIDE,   LPX_K_MPSWIDE,  'i'},
-{LPX_K_MPSFREE,   LPX_K_MPSFREE,  'i'},
-{LPX_K_MPSSKIP,   LPX_K_MPSSKIP,  'i'},
-{LPX_K_LPTORIG,   LPX_K_LPTORIG,  'i'},
-{LPX_K_PRESOL,LPX_K_PRESOL,   'i'},
-}; /* 28 paramaters */
-
-
 #if PY_MAJOR_VERSION = 3
-static int get_param_idx(const char *str, int *idx, char *type)
-#else
-static int get_param_idx(char *str, int *idx, char *type)
+#define PYINT_CHECK(value) PyLong_Check(value)
+#define 

Bug#780251: python-cvxopt: Doesn't work anymore

2015-03-11 Thread Jean-Michel Nirgal Vourgère
Sébastien Villemot wrote:
 Looking at the patch glpk-4.49.diff that I have added in the package in
 order to provide a compatibility layer, it looks like I forgot to link
 lpx.c into glpk.so (which also means that I did not test the package
 before NMUing, shame on me).

Lol. Good catch. ^^

Attached is much smaller fix, suitable for an p-u.

-- 
Nirgal
Description: Fix undefined symbol: lpx_create_prob bugs in glpk
 .
 Actually link the lpx compatibility file
 .
 Fix the conditionnal wrapper position and arguments in lpx.c
Author: Jean-Michel Nirgal Vourgère jmv_...@nirgal.com
Bug-Debian: https://bugs.debian.org/780251
Forwarded: not-needed
Last-Update: 2015-03-11

Index: cvxopt-1.1.4/src/setup.py
===
--- cvxopt-1.1.4.orig/src/setup.py
+++ cvxopt-1.1.4/src/setup.py
@@ -63,7 +63,7 @@ if BUILD_GLPK:
 glpk = Extension('glpk', libraries = ['glpk'],
 include_dirs = [ GLPK_INC_DIR ],
 library_dirs = [ GLPK_LIB_DIR ],
-sources = ['C/glpk.c'] )
+sources = ['C/glpk.c', 'C/lpx.c'] )
 extmods += [glpk];
 
 if BUILD_DSDP:
Index: cvxopt-1.1.4/src/C/lpx.c
===
--- cvxopt-1.1.4.orig/src/C/lpx.c
+++ cvxopt-1.1.4/src/C/lpx.c
@@ -11,12 +11,12 @@
 *  Please note that you may mix calls to old and new GLPK API routines
 *  (except calls to glp_create_prob and glp_delete_prob). */
 
-#if (GLP_VERSION_MAJOR == 4  GLP_MINOR_VERSION = 49) || GLP_VERSION_MAJOR  4
-
 #include float.h
 #include limits.h
 #include lpx.h
 
+#if (GLP_MAJOR_VERSION == 4  GLP_MINOR_VERSION = 49) || GLP_MAJOR_VERSION  4
+
 #define xassert glp_assert
 #define xerror  glp_error
 


signature.asc
Description: OpenPGP digital signature