Opened 11 years ago
Closed 10 years ago
#8278 closed defect (duplicate)
cygwin: cvxopt doesn't build on cygwin/windows due to missing complex.h
Reported by: | was | Owned by: | tbd |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | porting: Cygwin | Keywords: | |
Cc: | pjeremy | Merged in: | |
Authors: | Reviewers: | Karl-Dieter Crisman | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Using either cvxopt-0.9.p8 (in sage-4.3.3) or cvxopt-1.1.2.p2, which is at http://boxen.math.washington.edu/home/schilly/sage/spkg/, we get this huge error very quickly upon trying to build:
building 'base' extension creating build/temp.cygwin-1.7.1-i686-2.6 creating build/temp.cygwin-1.7.1-i686-2.6/C gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/home/wstein/build/sage-4.3.3.alpha0/local/include/python2.6 -c C/base.c -o build/temp.cygwin-1.7.1-i686-2.6/C/base.o In file included from C/base.c:23: C/cvxopt.h:29:21: error: complex.h: No such file or directory In file included from C/base.c:24: C/misc.h:29: error: expected specifier-qualifier-list before ‘complex’ C/base.c:58: error: ‘complex’ undeclared here (not in a function) C/base.c: In function ‘write_znum’:
IDEAS:
- Look for complex.h on this page: http://www.cygwin.com/ml/cygwin/2006-07/threads.html#00763 That has some ideas.
- I think Mike Hansen said that he recently released (then unreleased!?) numpy-1.4 had a drop-in complex.h?
Attachments (2)
Change History (13)
comment:1 Changed 11 years ago by
- Description modified (diff)
- Summary changed from cygwin: cvxopt doesn't work at all to cygwin: cvxopt doesn't build on cygwin/windows due to missing complex.h
comment:2 Changed 11 years ago by
- Description modified (diff)
Changed 11 years ago by
hacked setup.py that allowed me to build and install cvxopt (though i had to make a fake complex.h)
Changed 11 years ago by
comment:3 Changed 11 years ago by
I would like to merge this with cvxopt-1.1.2.p2 (well, p3) that I just finished porting to Solaris, and cleaning up. For the latter, e.g. there is no random stuff in cvxopt any more, they can hook up to GSL (and we can enable this, as GSL is a standard Sage package).
Can I use winxp2.math.washington.edu ? I suppose I need a login, and I don't seem to have one (I tried logging in from boxen...)
Dima
comment:4 Changed 11 years ago by
This is fixed by #8780 which provides a working complex.h
comment:5 Changed 11 years ago by
This is actually not fixed by #8780.
comment:6 follow-up: ↓ 7 Changed 11 years ago by
- Cc pjeremy added
complex.h is the header file that you need, but you almost certainly need the C99 libraries too. So it's not as simple as just adding a complex.h file.
I'm cc'ing Peter on this, as I know he has (or at least did have), C99 issues on FreeBSD. I got similar issues when trying to build Sage on HP-UX, though that is of course not a high priority port.
Dave
comment:7 in reply to: ↑ 6 Changed 11 years ago by
Replying to drkirkby:
complex.h is the header file that you need, but you almost certainly need the C99 libraries too. So it's not as simple as just adding a complex.h file.
And the complex.h needs to match the C99 libraries.
I'm cc'ing Peter on this, as I know he has (or at least did have), C99 issues on FreeBSD.
cephes was introduced to provide C99 functions for Cygwin. FreeBSD does not provide a complete C99 library and I've written a number of tickets to use cephes to provide the missing functionality. See trac tickets #9543 and #9601 (both of which include patches, though they haven't been converted to new SPKG files yet). numpy also needs the same patch as #9601 but I haven't updated the relevant trac ticket for that yet.
Note that the patch in #9543 relies on some ELF shared library magic (and installs a $SAGE_LOCAL/libm.so that includes the cephes functions and automatically falls back to the base libm.so for other functions) that may not work in Cygwin (on Cygwin, cephes installs C99 libraries as $SAGE_LOCAL/libm{c,d,f,l}.a and any other SPKGs needing to reference those libraries will need patches to their link steps).
comment:8 Changed 10 years ago by
- Reviewers set to Karl-Dieter Crisman
- Status changed from new to needs_review
#6456 fixed this. Please close.
cvxopt builds, which is how I found this out :)
comment:9 Changed 10 years ago by
- Status changed from needs_review to positive_review
comment:10 Changed 10 years ago by
- Milestone changed from sage-4.7.1 to sage-duplicate/invalid/wontfix
comment:11 Changed 10 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
I put in some fake #defines to get past the complex.h import problem. Then linking fails due to no libcblas.
Changing the libraries= line in setup.py to
(like it is for OS X) gets past this problem.
I think it may be easy to implement complex.h, at least enough for cvxopt, just using what is in GSL... since cvxopt doesn't need much.
To get cvxopt to build, I replaced all references to atlas and cblas by "blas". This *did* work. I've attached my hacked setup.py (based on the one in cvxopt-1.1.2.p2) to this ticket just 'cause: