Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Matthew Brett wrote: Hi, We are using numpy.distutils, and have run into this odd behavior in windows: Short answer: I am afraid it cannot work as you want. Basically, when you pass an option to build_ext, it does not affect other distutils commands, which are run before build_ext, and need the compiler (config in this case I think). So you need to pass the -c option to every command affected by the compiler (build_ext, build_clib and config IIRC). cheers, David I'm having the same problems! Running windows XP, Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]. In my distutils.cfg I've got: [build] compiler=mingw32 [config] compiler = mingw32 and previously a python setup.py bdist_wininst would create an .exe installer, now I get the following error message: error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing -c mingw32 to setup.py. python setup.py build build_ext --compiler=mingw32 appeared to work (barring a warning: numpy\core\setup_common.py:81: MismatchCAPIWarning) but then how do I create a .exe installer afterwards? python setup.py bdist_wininst fails with the same error message as before and python setup.py bdist_wininst --compiler=mingw32 fails with the message: error: option --compiler not recognized Is it still possible to create a .exe installer on Windows and if so what are the commands we need to make it work? Thanks in advance for any help/workarounds it would be much appreciated! Regards, Dave ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
Dave wrote: David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Matthew Brett wrote: Hi, We are using numpy.distutils, and have run into this odd behavior in windows: Short answer: I am afraid it cannot work as you want. Basically, when you pass an option to build_ext, it does not affect other distutils commands, which are run before build_ext, and need the compiler (config in this case I think). So you need to pass the -c option to every command affected by the compiler (build_ext, build_clib and config IIRC). cheers, David I'm having the same problems! Running windows XP, Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]. In my distutils.cfg I've got: [build] compiler=mingw32 [config] compiler = mingw32 Yes, config files are an alternative I did not mention. I never use them because I prefer controlling the build on a per package basis, and the interaction between command line and config files is not always clear. python setup.py build build_ext --compiler=mingw32 appeared to work (barring a warning: numpy\core\setup_common.py:81: MismatchCAPIWarning) The warning is harmless: it is just a reminder that before releasing numpy 1.4.0, we will need to raise the C API version (to avoid problems we had in the past with mismatched numpy version). There is no point updating it during dev time I think. but then how do I create a .exe installer afterwards? python setup.py bdist_wininst fails with the same error message as before and python setup.py bdist_wininst --compiler=mingw32 fails with the message: error: option --compiler not recognized You need to do as follows, if you want to control from the command line: python setup.py build -c mingw32 bdist_wininst That's how I build the official binaries . cheers, David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
David Cournapeau david at ar.media.kyoto-u.ac.jp writes: You need to do as follows, if you want to control from the command line: python setup.py build -c mingw32 bdist_wininst That's how I build the official binaries . cheers, David Running the command: C:\dev\src\numpypython setup.py build -c mingw32 bdist_wininst build.txt still gives me the error: error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing -c mingw32 to setup.py. I tried without a distutils.cfg file and deleted the build directory both times. In case it helps the bulid log should be available from http://pastebin.com/m607992ba Am I doing something wrong? -Dave ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
Dave wrote: David Cournapeau david at ar.media.kyoto-u.ac.jp writes: You need to do as follows, if you want to control from the command line: python setup.py build -c mingw32 bdist_wininst That's how I build the official binaries . cheers, David Running the command: C:\dev\src\numpypython setup.py build -c mingw32 bdist_wininst build.txt still gives me the error: error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing -c mingw32 to setup.py. I tried without a distutils.cfg file and deleted the build directory both times. In case it helps the bulid log should be available from http://pastebin.com/m607992ba Am I doing something wrong? No, I think you and Matthew actually found a bug in recent changes I have done in distutils. I will fix it right away, cheers, David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
On Tue, Aug 4, 2009 at 5:28 PM, David Cournapeauda...@ar.media.kyoto-u.ac.jp wrote: No, I think you and Matthew actually found a bug in recent changes I have done in distutils. I will fix it right away, Ok, not right away, but could you check that r7280 fixed it for you ? cheers, David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
David Cournapeau cournape at gmail.com writes: On Tue, Aug 4, 2009 at 5:28 PM, David Cournapeaudavid at ar.media.kyoto-u.ac.jp wrote: No, I think you and Matthew actually found a bug in recent changes I have done in distutils. I will fix it right away, Ok, not right away, but could you check that r7280 fixed it for you ? cheers, David Work's for me. snip adding 'SCRIPTS\f2py.py' creating dist removing 'build\bdist.win32\wininst' (and everything under it) Thanks for the quick fix! -Dave ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
Dave dave.hirschfeld at gmail.com writes: Work's for me. -Dave Except now when trying to compile the latest scipy I get the following error: C:\dev\src\scipysvn up Fetching external item into 'doc\sphinxext' External at revision 7280. At revision 5890. C:\dev\src\scipypython setup.py bdist_wininst Traceback (most recent call last): File setup.py, line 160, in module setup_package() File setup.py, line 152, in setup_package configuration=configuration ) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\core.py, line 152, in setup config = configuration() File setup.py, line 118, in configuration config.add_subpackage('scipy') File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 890, in add_subpackage caller_level = 2) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 859, in get_subpackage caller_level = caller_level + 1) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 796, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File scipy\setup.py, line 20, in configuration config.add_subpackage('special') File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 890, in add_subpackage caller_level = 2) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 859, in get_subpackage caller_level = caller_level + 1) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 796, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File scipy\special\setup.py, line 45, in configuration extra_info=get_info(npymath) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 1954, in get_info pkg_info = get_pkg_info(pkgname, dirs) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils\misc_util.py, line 1921, in get_pkg_info return read_config(pkgname, dirs) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils \npy_pkg_config.py, line 235, in read_config v = _read_config_imp(pkg_to_filename(pkgname), dirs) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils \npy_pkg_config.py, line 221, in _read_config_imp meta, vars, sections, reqs = _read_config(filenames) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils \npy_pkg_config.py, line 205, in _read_config meta, vars, sections, reqs = parse_config(f, dirs) File C:\dev\bin\Python25\Lib\site-packages\numpy\distutils \npy_pkg_config.py, line 177, in parse_config raise PkgNotFound(Could not find file(s) %s % str(filenames)) numpy.distutils.npy_pkg_config.PkgNotFound: Could not find file(s) ['C:\\dev\\bin\\Python25\\lib\\site-packages\\numpy\\core\\lib \\npy-pkg-config\\npymath.ini'] In the numpy\core\lib directory there is no npy-pkg-config sub-directory, only a single file - libnpymath.a Is this expected - has scipy not yet caught up with the numpy changes or is this a numpy issue? -Dave ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
Dave wrote: Dave dave.hirschfeld at gmail.com writes: Work's for me. -Dave Except now when trying to compile the latest scipy I get the following error: Was numpy installed from a bdist_wininst installer, or did you use the install method directly ? David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Dave wrote: Dave dave.hirschfeld at gmail.com writes: Work's for me. -Dave Except now when trying to compile the latest scipy I get the following error: Was numpy installed from a bdist_wininst installer, or did you use the install method directly ? David Numpy was installed with the bdist_wininst installer. In case it's relevant the installer seemed to create 2 egg-info files: numpy-1.4.0.dev7277-py2.5.egg-info numpy-1.4.0.dev7280-py2.5.egg-info Deleting the numpy directory and the egg-info files and re-installing from the bdist_wininst installer gave the same result (with the above 2 egg-info files) Installing numpy with python setup.py install seemed to work (at least the npymath.ini file was now in the numpy\core\lib\npy-pkg-config folder) Compiling scipy got much further now, but still failed with the below error message: C:\dev\src\scipypython setup.py bdist_wininst build.txt Warning: No configuration returned, assuming unavailable. C:\dev\bin\Python25\lib\site-packages\numpy\distutils\command\config.py:394: DeprecationWarning: + Usage of get_output is deprecated: please do not use it anymore, and avoid configuration checks involving running executable on the target machine. + DeprecationWarning) C:\dev\bin\Python25\lib\site-packages\numpy\distutils\system_info.py:452: UserWarning: UMFPACK sparse solver (http://www.cise.ufl.edu/research/sparse/umfpack/) not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [umfpack]) or by setting the UMFPACK environment variable. warnings.warn(self.notfounderror.__doc__) error: Command C:\dev\bin\mingw\bin\g77.exe -g -Wall -mno-cygwin -g -Wall -mno-cygwin -shared build\temp.win32-2.5\Release\scipy\special\_cephesmodule.o build\temp.win32-2.5\Release\scipy\special\amos_wrappers.o build\temp.win32-2.5\Release\scipy\special\specfun_wrappers.o build\temp.win32-2.5\Release\scipy\special\toms_wrappers.o build\temp.win32-2.5\Release\scipy\special\cdf_wrappers.o build\temp.win32-2.5\Release\scipy\special\ufunc_extras.o -LC:\dein\Python25\Lib\site-packages -LC:\dev\bin\mingw\lib -LC:\dev\bin\mingw\lib\gcc\mingw32\3.4.5 -LC:\dev\bin\Python25\libs -LC:\dev\bin\Python25\PCBuild -Lbuild\temp.win32-2.5 -lsc_amos -lsc_toms -lsc_c_misc -lsc_cephes -lsc_mach -lsc_cdf -lsc_specfun -lnpymath -lpython25 -lg2c -o build\lib.win32-2.5\scipy\special\_cephes.pyd failed with exit status 1 The output of the build is available from http://pastebin.com/d3efe5650 Note the strange character on line 4600. In my terminal window this is displayed as: compile options: '-D_USE_MATH_DEFINES -D_USE_MATH_DEFINES -IC:\dein\Python25\Lib\site-packages -IC:\dev\bin\Python25\lib\site-packages\numpy\core\include -IC:\dev\bin\Python25\include -IC:\dev\bin\Python25\PC -c' HTH, Dave ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
Dave wrote: David Cournapeau david at ar.media.kyoto-u.ac.jp writes: Dave wrote: Dave dave.hirschfeld at gmail.com writes: Work's for me. -Dave Except now when trying to compile the latest scipy I get the following error: Was numpy installed from a bdist_wininst installer, or did you use the install method directly ? David Numpy was installed with the bdist_wininst installer. In case it's relevant the installer seemed to create 2 egg-info files: numpy-1.4.0.dev7277-py2.5.egg-info numpy-1.4.0.dev7280-py2.5.egg-info Deleting the numpy directory and the egg-info files and re-installing from the bdist_wininst installer gave the same result (with the above 2 egg-info files) Installing numpy with python setup.py install seemed to work (at least the npymath.ini file was now in the numpy\core\lib\npy-pkg-config folder) I think I understand the problem. Unfortunately, that's looks tricky to solve... I hate distutils. David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
On Tue, Aug 4, 2009 at 8:13 PM, David Cournapeauda...@ar.media.kyoto-u.ac.jp wrote: I think I understand the problem. Unfortunately, that's looks tricky to solve... I hate distutils. Ok - should be fixed in r7281. David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
David Cournapeau cournape at gmail.com writes: On Tue, Aug 4, 2009 at 8:13 PM, David Cournapeaudavid at ar.media.kyoto-u.ac.jp wrote: I think I understand the problem. Unfortunately, that's looks tricky to solve... I hate distutils. Ok - should be fixed in r7281. David Well, that seemed to fix the bdist_wininst issue. The problem compiling scipy remains, but I assume that's probably something I should take up on the scipy list? FWIW running the full numpy test suite (verbose=10) I get 7 failures. The results are available from http://pastebin.com/m5505d4b5 The errors seem to be be related to the NaN handling. Thanks for the help today! -Dave ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
On Tue, Aug 4, 2009 at 10:51 AM, Dave dave.hirschf...@gmail.com wrote: David Cournapeau cournape at gmail.com writes: On Tue, Aug 4, 2009 at 8:13 PM, David Cournapeaudavid at ar.media.kyoto-u.ac.jp wrote: I think I understand the problem. Unfortunately, that's looks tricky to solve... I hate distutils. Ok - should be fixed in r7281. David Well, that seemed to fix the bdist_wininst issue. The problem compiling scipy remains, but I assume that's probably something I should take up on the scipy list? FWIW running the full numpy test suite (verbose=10) I get 7 failures. The results are available from http://pastebin.com/m5505d4b5 The errors seem to be be related to the NaN handling. The nan problems come from these tests: # atan2(+-infinity, -infinity) returns +-3*pi/4. yield assert_almost_equal, ncu.arctan2( np.inf, -np.inf), 0.75 * np.pi yield assert_almost_equal, ncu.arctan2(-np.inf, -np.inf), -0.75 * np.pi # atan2(+-infinity, +infinity) returns +-pi/4. yield assert_almost_equal, ncu.arctan2( np.inf, np.inf), 0.25 * np.pi yield assert_almost_equal, ncu.arctan2(-np.inf, np.inf), -0.25 * np.pi So the problem seems to be with the inf handling. Windows arctan2 is known to be wtf-buggy and I suspect that is what is being tested. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
Hi, On Tue, Aug 4, 2009 at 9:31 AM, David Cournapeaucourn...@gmail.com wrote: On Tue, Aug 4, 2009 at 8:13 PM, David Cournapeauda...@ar.media.kyoto-u.ac.jp wrote: I think I understand the problem. Unfortunately, that's looks tricky to solve... I hate distutils. Ok - should be fixed in r7281. Just to clarify - it's still true I guess that this: python setup.py build_ext --compiler=mingw32 --inplace just can't work - because the --compiler flag does not get passed to the build step? I noticed, when I was trying to be fancy: python setup.py build build_ext --inplace this error: File /home/mb312/usr/local/lib/python2.5/site-packages/numpy/distutils/command/build_ext.py, line 74, in run self.library_dirs.append(build_clib.build_clib) UnboundLocalError: local variable 'build_clib' referenced before assignment because of the check for inplace builds above that, leaving build_clib undefined. I'm afraid I wasn't quite sure what the right thing to do was. Thanks a lot, Matthew ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
On Tue, Aug 4, 2009 at 15:09, Matthew Brettmatthew.br...@gmail.com wrote: File /home/mb312/usr/local/lib/python2.5/site-packages/numpy/distutils/command/build_ext.py, line 74, in run self.library_dirs.append(build_clib.build_clib) UnboundLocalError: local variable 'build_clib' referenced before assignment because of the check for inplace builds above that, leaving build_clib undefined. I'm afraid I wasn't quite sure what the right thing to do was. Probably just build_clib = self.distribution.get_command_obj('build_clib') after the log.warn(). -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Is this a bug in numpy.distutils ?
Hi, We are using numpy.distutils, and have run into this odd behavior in windows: I have XP, Mingw, latest numpy SVN, python.org python 2.6. All the commands below I am running from within the 'numpy' root directory (where 'numpy' is a subdirectory). If I run python setup.py build I get the following expected error: ''' No module named msccompiler in numpy.distutils; trying from distutils error: Unable to find vccarsall.bat ''' because, I don't have MSVC. If I run: python setup.py build -c mingw32 - that works. But. running python setup.py build_ext -c mingw32 generates the same error as above. Similarly: python setup.py build_ext -c completely_unknown Ignores the attempt to set the 'completely_unknown' compiler, whereas python setup.py build -c completely_unknown raises a sensible error. I conclude that the numpy.distutils build_ext command is ignoring at least the compiler options. Is that correct? Thanks a lot, Matthew ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Is this a bug in numpy.distutils ?
Matthew Brett wrote: Hi, We are using numpy.distutils, and have run into this odd behavior in windows: I have XP, Mingw, latest numpy SVN, python.org python 2.6. All the commands below I am running from within the 'numpy' root directory (where 'numpy' is a subdirectory). If I run python setup.py build I get the following expected error: ''' No module named msccompiler in numpy.distutils; trying from distutils error: Unable to find vccarsall.bat ''' because, I don't have MSVC. If I run: python setup.py build -c mingw32 - that works. But. running python setup.py build_ext -c mingw32 generates the same error as above. Similarly: python setup.py build_ext -c completely_unknown Ignores the attempt to set the 'completely_unknown' compiler, whereas python setup.py build -c completely_unknown raises a sensible error. I conclude that the numpy.distutils build_ext command is ignoring at least the compiler options. Is that correct? Short answer: I am afraid it cannot work as you want. Basically, when you pass an option to build_ext, it does not affect other distutils commands, which are run before build_ext, and need the compiler (config in this case I think). So you need to pass the -c option to every command affected by the compiler (build_ext, build_clib and config IIRC). Long answer: The reason is linked to the single most annoying feature of distutils: distutils fundamentally works by running some commands, one after the other. Commands have subcommands. For Numpy, as far as compiled code is concerned, it goes like this: config - build - build_clib - build_ext (the build command calls all the subcommands build_* and config). Now, each command options set is independent on the other (build_ext vs. config in this case), but if you pass an option to a command it affects all its subcommands I believe. cheers, David ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion