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

upgrade cvxopt to version 1.1.8 #19687

Closed
dimpase opened this issue Dec 9, 2015 · 36 comments
Closed

upgrade cvxopt to version 1.1.8 #19687

dimpase opened this issue Dec 9, 2015 · 36 comments

Comments

@dimpase
Copy link
Member

dimpase commented Dec 9, 2015

this is the current stable version

The tarball is here: http://users.ox.ac.uk/~coml0531/sage/cvxopt-1.1.8.tar.gz

I removed html docs from the source (https://github.com/cvxopt/cvxopt/archive/1.1.8.tar.gz) to make it smaller.

Upstream: Fixed upstream, but not in a stable release.

CC: @jdemeyer @nathanncohen

Component: packages: standard

Author: Dima Pasechnik

Branch/Commit: 79784f3

Reviewer: François Bissey

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

@dimpase dimpase added this to the sage-6.10 milestone Dec 9, 2015
@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Dec 9, 2015

Branch: u/dimpase/19687

@dimpase
Copy link
Member Author

dimpase commented Dec 9, 2015

New commits:

c040534update to 1.1.8

@dimpase
Copy link
Member Author

dimpase commented Dec 9, 2015

Commit: c040534

@kiwifb
Copy link
Member

kiwifb commented Dec 11, 2015

Reviewer: François Bissey

@kiwifb
Copy link
Member

kiwifb commented Dec 11, 2015

comment:2

Looks good to me. No doctest broken on linux x86_64.

@vbraun
Copy link
Member

vbraun commented Dec 21, 2015

comment:3

On older linux (Ubuntu 12.04) I get

ImportError: /mnt/highperf/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/cvxopt/amd.so: undefined symbol: clock_gettime

according to man page, needs to "link with -lrt (only for glibc versions before 2.17)" but does not.

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:5

Upstream probably doesn't build on older machines. Should be trivial to fix.

@dimpase
Copy link
Member Author

dimpase commented Dec 21, 2015

comment:6

Replying to @vbraun:

On older linux (Ubuntu 12.04) I get

ImportError: /mnt/highperf/buildbot/slave/sage_git/build/local/lib/python2.7/site-packages/cvxopt/amd.so: undefined symbol: clock_gettime

according to man page, needs to "link with -lrt (only for glibc versions before 2.17)" but does not.

It does not seem that testing glibc version tells you the right thing. Indeed, on Ubuntu 14.04, where this all works, I see

>>> import platform
>>> platform.libc_ver() 
('glibc', '2.4')

And I don't even have librt. I will just add it unconditionally, for every Linux...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Changed commit from c040534 to 6390e86

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8c1e90dupdate to 1.1.8
6390e86add 'rt' to libs on linux

@dimpase
Copy link
Member Author

dimpase commented Dec 21, 2015

Upstream: Not yet reported upstream; Will do shortly.

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:9

Wrong solution

if SUITESPARSE_EXT_LIB:
    amd = Extension('amd',
        libraries = ['amd','suitesparseconfig'],
        include_dirs = [SUITESPARSE_INC_DIR],
        library_dirs = [SUITESPARSE_LIB_DIR],
        sources = ['src/C/amd.c'])
else:
    amd = Extension('amd', 
        include_dirs = [ 'src/C/SuiteSparse/AMD/Include', 
            'src/C/SuiteSparse/SuiteSparse_config' ],
        define_macros = MACROS,
        sources = [ 'src/C/amd.c', 'src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c'] +
        glob('src/C/SuiteSparse/AMD/Source/*.c') )

The amd extension doesn't use libraries so I would be surprised if it worked by adding it to BLAS_LIBS.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

fdaeefaadd libs='rt' to amd ext.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Changed commit from 6390e86 to fdaeefa

@dimpase
Copy link
Member Author

dimpase commented Dec 21, 2015

comment:11

right, it should have gone to the amd Extension chunk, sorry.
The patch is longer, as I fixed all the fizz, by cloning https://github.com/cvxopt/cvxopt
and making a new patch using the old one.
Then I just added libraries=['rt'] unconditionally there -- should this be done for Linux only?

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:12

No librt on OS X as far as I can tell, I don't know about cygwin. I would restrict it.

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:13

clock_gettime is not in the AMD code it is in the SuiteSparse_config I am checking the implications.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Changed commit from fdaeefa to 4b91b98

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

4b91b98add libs='rt' to amd ext (on linux only)

@dimpase
Copy link
Member Author

dimpase commented Dec 21, 2015

comment:15

Replying to @kiwifb:

clock_gettime is not in the AMD code it is in the SuiteSparse_config I am checking the implications.

well, the import error is in amd.so, and src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c
gets complied into the amd extension. So this looks right what I do now...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Changed commit from 4b91b98 to e8c1e0a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 21, 2015

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

e8c1e0aadd libs='rt' to amd ext (on linux only)

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:17

Volker reported one failure, there may be other hidden behind the first one. That file is also included in cholmod and umfpack so they are potentially affected too. However the code should only be enabled if SUITESPARSE_TIMER_ENABLED is defined, in turn it depends on whether NTIMER is defined (which it is for cholmod and umfpack so in the end they won't be affected). A better solution in my opinion is to add [('NTIMER', '1')] to the line define_macros for the amd section.


New commits:

e8c1e0aadd libs='rt' to amd ext (on linux only)

@dimpase
Copy link
Member Author

dimpase commented Dec 21, 2015

comment:18

adding things like [('NTIMER', '1')] looks like going too far, as you're changing the behaviour of upstream code this way...

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:19

I don't think cvxopt cares about timing of the code, in fact SuiteSparse_{tic,toc,time} are used nowhere in AMD's code. It is only enabled as part of SuiteSparse_config.c by accident I would argue. In contrast cholmod and umfpack have code that can use SuiteSparse_time and it is disabled on purpose in those. Those function are only used to measure performance, I don't think cvxopt would be doing it that way, if it was interested in measuring the performance of the SuiteSparse code.

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:20

I would further argue that we should point to upstream that unless they want to use those timing functions in the future, NTIMER should be in the default macros variable that is currently empty.

@dimpase
Copy link
Member Author

dimpase commented Dec 21, 2015

comment:21

I just asked upstream here on this.

@dimpase
Copy link
Member Author

dimpase commented Dec 21, 2015

Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.

@kiwifb
Copy link
Member

kiwifb commented Dec 21, 2015

comment:22

OK, I'll add an argument:
SuiteSparse_config.c is not part of amd's sources. If you were using an external suitesparse install, you would have a suitesparse_config library and amd would get the functions from this library as needed. But here we have a custom system that makes SuiteSparse_config.c a part of the used amd source code and including all the function of SuiteSparse_config.c instead of just the one needed by amd. That include the timing functions.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 22, 2015

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

79784f3fix building amd ext

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 22, 2015

Changed commit from e8c1e0a to 79784f3

@dimpase
Copy link
Member Author

dimpase commented Dec 22, 2015

Changed upstream from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.

@dimpase
Copy link
Member Author

dimpase commented Dec 22, 2015

comment:24

indeed, that was the right suggestion for the fix. The upstream fixed this in dev here 3 weeks ago...

please see the latest commit update.


New commits:

79784f3fix building amd ext

@kiwifb
Copy link
Member

kiwifb commented Dec 22, 2015

comment:25

I am happy with that resolution. Back to positive review.

@vbraun
Copy link
Member

vbraun commented Dec 23, 2015

Changed branch from u/dimpase/19687 to 79784f3

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