![](https://secure.gravatar.com/avatar/d7170424cd96b9f2ac01a8a26acac51e.jpg?s=120&d=mm&r=g)
On 29 Sep 2003 17:05:09 -0400 Todd Miller wrote:
_ufunc.dll needs to be linked against /usr/lib/libmingwex.a. Doing that manually seems to work fine.
Todd> In the file generate.py, a clause for sys.platform == "cygwin?" Todd> probably needs to be added. Then, define EXTRA_LINK_ARGS for Todd> cygwin. Ok, did that. ,----[cvs diff -u generate.py] | Warning: No xauth data; using fake authentication data for X11 forwarding. | Index: generate.py | =================================================================== | RCS file: /cvsroot/numpy/numarray/generate.py,v | retrieving revision 1.14 | diff -u -u -r1.14 generate.py | --- generate.py 16 Sep 2003 20:02:41 -0000 1.14 | +++ generate.py 30 Sep 2003 08:33:38 -0000 | @@ -51,6 +51,9 @@ | LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 | elif sys.platform == "win32": | LP64, HAS_UINT64, HAS_FLOAT128 = 0, 0, 0 | +elif sys.platform == "cygwin": | + LP64, HAS_UINT64, HAS_FLOAT128 = 0, 0, 0 | + EXTRA_LINK_ARGS += ["-L/lib/mingw -lmingwex"] | elif sys.platform == "darwin": | LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 | EXTRA_COMPILE_ARGS.extend(["-Ddarwin"]) `---- Should work, but I get the following strange behavior: ,---- | > python setup.py build | Using EXTRA_COMPILE_ARGS = [] | running build | running build_py | copying Lib/numinclude.py -> build/lib.cygwin-1.5.5-i686-2.3/numarray | running build_ext | building 'numarray._ufunc' extension | gcc -shared -Wl,--enable-auto-image-base -march=pentium3 -mcpu=pentium4 -O2 -Wall -pipe build/temp.cygwin-1.5.5-i686-2.3/Src/_ufuncmodule.o -L/usr/lib/python2.3/config -lpython2.3 -o build/lib.cygwin-1.5.5-i686-2.3/numarray/_ufunc.dll -L/lib/mingw -lmingwex | build/temp.cygwin-1.5.5-i686-2.3/Src/_ufuncmodule.o(.text+0x14f): In function `_CheckFPErrors': | /home/software/programming/numeric/numarray/Src/_ufuncmodule.c:136: undefined reference to `_fetestexcept' | build/temp.cygwin-1.5.5-i686-2.3/Src/_ufuncmodule.o(.text+0x17b):/home/software/programming/numeric/numarray/Src/_ufuncmodule.c:142: undefined reference to `_feclearexcept' | collect2: ld returned 1 exit status | error: command 'gcc' failed with exit status 1 | | > gcc -shared -Wl,--enable-auto-image-base -march=pentium3 -mcpu=pentium4 -O2 -Wall -pipe build/temp.cygwin-1.5.5-i686-2.3/Src/_ufuncmodule.o -L/usr/lib/python2.3/config -lpython2.3 -o build/lib.cygwin-1.5.5-i686-2.3/numarray/_ufunc.dll -L/lib/mingw -lmingwex `---- That is, it does not work when called from setup.py. When I just copy 'n' paste the link statement to the command-line, it just works.(#$%) Any ideas??
Is it save to use this mingw library in "normal" Cygwin programs?
Todd> I don't know. I didn't get any farther than this, perhaps not as Todd> far. I got the impression that mingw was a minimal library Todd> intended for porting gcc (but it has IEEE stuff), while the Todd> cygwin libc is intended for real programs (but has no IEEE stuff Todd> because it is a lightweight knock off of glibc used to bypass Todd> the GPL). Well, as I see it Cygwin is a Unix emulation layer for Windows, whereas MINGW is a port of gcc and some other GNU tools to Windows (not using Cygwin at all). But looking around using it this way should be ok. Maybe someone who knows cygwin better can speak up here? I would carbon-copy this email to the cygwin list, but that is subscribers only nowadays:(
Todd> One of our guys found a bug in the complex log10 function; both Todd> the expected result and the implementation were changed. Seems to be resolved. Greetings, Jochen -- Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D (Part 3 you find in my messages before fall 2003.)
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Tue, 2003-09-30 at 04:44, Jochen Küpper wrote:
You could try replacing gcc in order to dump the environment or perhaps add a switch to run gcc in a more verbose mode and see if any differences pop up. distutils-sig? Have you checked the #ifdef clause in _CheckFPErrors in _ufuncmodule.c for cygwin/mingw? Apparently I added it, and I wasn't sure if it was valid to compile for cygwin and link against mingw. One other thing: HAS_UINT64 should work. Regards, Todd -- Todd Miller jmiller@stsci.edu STSCI / ESS / SSB
![](https://secure.gravatar.com/avatar/d7170424cd96b9f2ac01a8a26acac51e.jpg?s=120&d=mm&r=g)
With the current patch agianst cvs HEAD numarray compiles and passes all tests on current Cygwin: cvs diff -u generate.py ChangeLog Warning: No xauth data; using fake authentication data for X11 forwarding. Index: generate.py =================================================================== RCS file: /cvsroot/numpy/numarray/generate.py,v retrieving revision 1.14 diff -u -u -r1.14 generate.py --- generate.py 16 Sep 2003 20:02:41 -0000 1.14 +++ generate.py 30 Sep 2003 13:56:25 -0000 @@ -51,6 +51,9 @@ LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 elif sys.platform == "win32": LP64, HAS_UINT64, HAS_FLOAT128 = 0, 0, 0 +elif sys.platform == "cygwin": + LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 + EXTRA_LINK_ARGS += ["-L/lib", "-lm", "-lc", "-lgcc", "-L/lib/mingw", "-lmingwex"] elif sys.platform == "darwin": LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 EXTRA_COMPILE_ARGS.extend(["-Ddarwin"]) Index: ChangeLog =================================================================== RCS file: /cvsroot/numpy/numarray/ChangeLog,v retrieving revision 1.1 diff -u -u -r1.1 ChangeLog --- ChangeLog 20 Apr 2002 16:13:38 -0000 1.1 +++ ChangeLog 30 Sep 2003 13:56:25 -0000 @@ -1,3 +1,13 @@ +2003-09-30 Jochen Küpper <jochen@jochen-kuepper.de> + + * generate.py (codeargs): Add cygwin case to link against libmingwex. + This is a little tricky as _ufinc.dll needs to be linked against + libmingwex, but libnumarray.dll normally picks up wrong symbols from + this library. Therefore we explicitely add libm, libc, and libgcc before + the mingw libraries to avoid the latter and still have them available to + resolve the FE symbols. We also explicitely have to add -L/lib before + -L/lib/mingw to check for normal cygwin libraries first. + 2002-04-20 Jochen Küpper <jochen@jochen-kuepper.de> * MANIFEST.in: Updated. @@ -9,5 +19,5 @@ * Local Variables: * mode: auto-fill - * fill-column: 79 + * fill-column: 80 * End: Greetings, Jochen -- Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D (Part 3 you find in my messages before fall 2003.)
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Tue, 2003-09-30 at 04:44, Jochen Küpper wrote:
You could try replacing gcc in order to dump the environment or perhaps add a switch to run gcc in a more verbose mode and see if any differences pop up. distutils-sig? Have you checked the #ifdef clause in _CheckFPErrors in _ufuncmodule.c for cygwin/mingw? Apparently I added it, and I wasn't sure if it was valid to compile for cygwin and link against mingw. One other thing: HAS_UINT64 should work. Regards, Todd -- Todd Miller jmiller@stsci.edu STSCI / ESS / SSB
![](https://secure.gravatar.com/avatar/d7170424cd96b9f2ac01a8a26acac51e.jpg?s=120&d=mm&r=g)
With the current patch agianst cvs HEAD numarray compiles and passes all tests on current Cygwin: cvs diff -u generate.py ChangeLog Warning: No xauth data; using fake authentication data for X11 forwarding. Index: generate.py =================================================================== RCS file: /cvsroot/numpy/numarray/generate.py,v retrieving revision 1.14 diff -u -u -r1.14 generate.py --- generate.py 16 Sep 2003 20:02:41 -0000 1.14 +++ generate.py 30 Sep 2003 13:56:25 -0000 @@ -51,6 +51,9 @@ LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 elif sys.platform == "win32": LP64, HAS_UINT64, HAS_FLOAT128 = 0, 0, 0 +elif sys.platform == "cygwin": + LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 + EXTRA_LINK_ARGS += ["-L/lib", "-lm", "-lc", "-lgcc", "-L/lib/mingw", "-lmingwex"] elif sys.platform == "darwin": LP64, HAS_UINT64, HAS_FLOAT128 = 0, 1, 0 EXTRA_COMPILE_ARGS.extend(["-Ddarwin"]) Index: ChangeLog =================================================================== RCS file: /cvsroot/numpy/numarray/ChangeLog,v retrieving revision 1.1 diff -u -u -r1.1 ChangeLog --- ChangeLog 20 Apr 2002 16:13:38 -0000 1.1 +++ ChangeLog 30 Sep 2003 13:56:25 -0000 @@ -1,3 +1,13 @@ +2003-09-30 Jochen Küpper <jochen@jochen-kuepper.de> + + * generate.py (codeargs): Add cygwin case to link against libmingwex. + This is a little tricky as _ufinc.dll needs to be linked against + libmingwex, but libnumarray.dll normally picks up wrong symbols from + this library. Therefore we explicitely add libm, libc, and libgcc before + the mingw libraries to avoid the latter and still have them available to + resolve the FE symbols. We also explicitely have to add -L/lib before + -L/lib/mingw to check for normal cygwin libraries first. + 2002-04-20 Jochen Küpper <jochen@jochen-kuepper.de> * MANIFEST.in: Updated. @@ -9,5 +19,5 @@ * Local Variables: * mode: auto-fill - * fill-column: 79 + * fill-column: 80 * End: Greetings, Jochen -- Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D (Part 3 you find in my messages before fall 2003.)
participants (2)
-
Jochen Küpper
-
Todd Miller