scipy_distutils under cygwin using DF
Hello, I try to compile some python extension libraries under WinXP/cygwin. The fortran codes need DF, no chance for g77. But I get:
make test PYTHONPATH="w:\\hoel\\work\\GLPy\\lib;w:\\hoel\\work\\GLPy\\build\\lib.win32-2.3;" python setup.py config_fc --fcompiler=compaqv build_src build_clib build_ext ... customize CompaqVisualFCompiler customize CompaqVisualFCompiler using build_clib splitcmdline('DF /what')
scipy_distutils.compaqfcompiler.CompaqVisualFCompiler version_cmd = ['DF', '/what'] compiler_fix = ['DF', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/n ames:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fa st', '/threads'] ranlib = None archiver = ['C:\\Programme\\Microsoft Visual Studio\\VC98\\BIN\\lib.exe', '/OUT:'] compiler_f77 = ['DF', '/f77rtl', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len _arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math _library:fast', '/threads'] linker_so = ['DF'] compiler_f90 = ['DF', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lower case', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/thr eads'] version = None libraries = [] library_dirs = [] object_switch = '/object:' compile_switch = '/compile_only ' include_dirs = [] ******************************************************************************** building 'fortmisc' library compling Fortran sources DF(f77) options: '/f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase/assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads' DF(f90) options: '/nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads' DF(fix) options: '/fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads' compile options: '-Ilib\numfort -c' DF:f77: lib\numfort\NB.F DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c "/compile_only " lib\numfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o Microsoft: error: Unknown switch: '/compile_only ' error: Command "DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c "/compile_only " lib\numfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o" failed with exit status 1 make: *** [build] Error 1 changing "compile_switch" in fcompiler.py from '/compile_only ' to '/compile_only' solves this problem, but now I get: DF:f77: lib\numfort\NB.F DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:undersc ore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c /compile_only lib\n umfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o Visual lib\numfort\NB.F f90: Severe: No such file or directory ... file is 'Visual' error: Command "DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c /co mpile_only lib\numfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o" failed with exit status 1 make: *** [build] Error 1 I have no idea where the "Visual" is coming from. Is there anyone who can help me? Kind regards Berthold Höllmann -- Germanischer Lloyd AG CAE Development Vorsetzen 35 20459 Hamburg Phone: +49(0)40 36149-7374 Fax: +49(0)40 36149-7320 e-mail: hoel@gl-group.com Internet: http://www.gl-group.com This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail. GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.
On Wed, 24 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
Hello,
I try to compile some python extension libraries under WinXP/cygwin. The fortran codes need DF, no chance for g77. But I get:
changing "compile_switch" in fcompiler.py from '/compile_only ' to '/compile_only' solves this problem, but now I get:
Ok, thanks for this information. This is now also in CVS.
DF:f77: lib\numfort\NB.F DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:undersc ore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c /compile_only lib\n umfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o Visual lib\numfort\NB.F f90: Severe: No such file or directory ... file is 'Visual' error: Command "DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c /co mpile_only lib\numfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o" failed with exit status 1
make: *** [build] Error 1
I have no idea where the "Visual" is coming from. Is there anyone who can help me?
Yes, the current scipy_distutils.exec_command had issues on Windows when a the full path of an executable (like of DF) contains spaces. This is now fixed in CVS. Pearu
Pearu Peterson <pearu@scipy.org> writes:
On Wed, 24 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
Hello,
I try to compile some python extension libraries under WinXP/cygwin. The fortran codes need DF, no chance for g77. But I get:
changing "compile_switch" in fcompiler.py from '/compile_only ' to '/compile_only' solves this problem, but now I get:
Ok, thanks for this information. This is now also in CVS.
You are welcome.
DF:f77: lib\numfort\NB.F DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:undersc ore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c /compile_only lib\n umfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o Visual lib\numfort\NB.F f90: Severe: No such file or directory ... file is 'Visual' error: Command "DF /f77rtl /fixed /nologo /MD /WX /iface=(cref,nomixed_str_len_arg) /names:lowercase /assume:underscore /Ox /fast /optimize:5 /unroll:0 /math_library:fast /threads -Ilib\numfort -c /co mpile_only lib\numfort\NB.F /object:build\temp.win32-2.3\lib\numfort\NB.o" failed with exit status 1
make: *** [build] Error 1
I have no idea where the "Visual" is coming from. Is there anyone who can help me?
Yes, the current scipy_distutils.exec_command had issues on Windows when a the full path of an executable (like of DF) contains spaces. This is now fixed in CVS.
Thanks a lot, the fortran compilation works now, but! I can't compile C source files anymore: ******************************************************************************** scipy_distutils.compaqfcompiler.CompaqVisualFCompiler version_cmd = ['DF', '/what'] compiler_fix = ['DF', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] ranlib = None archiver = ['C:\\Programme\\Microsoft Visual Studio\\VC98\\BIN\\lib.exe', '/OUT:'] compiler_f77 = ['DF', '/f77rtl', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] linker_so = ['DF'] compiler_f90 = ['DF', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] version = LooseVersion ('6.1') libraries = [] library_dirs = ['c:\\Python23\\libs', 'c:\\Python23\\PCBuild', 'build\\temp.win32-2.3'] object_switch = '/object:' compile_switch = '/compile_only' include_dirs = ['c:\\Python23\\include', 'c:\\Python23\\PC'] ******************************************************************************** building 'SXFPyBase' extension compling C sources C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include-Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj Could not locate executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj" failed with exit status 1 Is this a related problem, than can be solved equally fast? Kind regards Berthold Höllmann -- Germanischer Lloyd AG CAE Development Vorsetzen 35 20459 Hamburg Phone: +49(0)40 36149-7374 Fax: +49(0)40 36149-7320 e-mail: hoel@gl-group.com Internet: http://www.gl-group.com This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail. GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.
On Thu, 25 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
Thanks a lot, the fortran compilation works now, but! I can't compile C source files anymore:
******************************************************************************** scipy_distutils.compaqfcompiler.CompaqVisualFCompiler version_cmd = ['DF', '/what'] compiler_fix = ['DF', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] ranlib = None archiver = ['C:\\Programme\\Microsoft Visual Studio\\VC98\\BIN\\lib.exe', '/OUT:'] compiler_f77 = ['DF', '/f77rtl', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] linker_so = ['DF'] compiler_f90 = ['DF', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] version = LooseVersion ('6.1') libraries = [] library_dirs = ['c:\\Python23\\libs', 'c:\\Python23\\PCBuild', 'build\\temp.win32-2.3'] object_switch = '/object:' compile_switch = '/compile_only' include_dirs = ['c:\\Python23\\include', 'c:\\Python23\\PC'] ******************************************************************************** building 'SXFPyBase' extension compling C sources C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include-Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj Could not locate executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj
error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj" failed with exit status 1
Is this a related problem, than can be solved equally fast?
Yes, it appears that path to a C compiler is double quoted. This is now fixed in CVS. Thanks, Pearu
Pearu Peterson <pearu@cens.ioc.ee> writes:
On Thu, 25 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
Thanks a lot, the fortran compilation works now, but! I can't compile C source files anymore: ... Is this a related problem, than can be solved equally fast?
Yes, it appears that path to a C compiler is double quoted. This is now fixed in CVS.
I did a "cvs update" in scipy and "python setup.py install" in scipy_core but still get ******************************************************************************** scipy_distutils.compaqfcompiler.CompaqVisualFCompiler version_cmd = ['DF', '/what'] compiler_fix = ['DF', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] ranlib = None archiver = ['C:\\Programme\\Microsoft Visual Studio\\VC98\\BIN\\lib.exe', '/OUT:'] compiler_f77 = ['DF', '/f77rtl', '/fixed', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] linker_so = ['DF'] compiler_f90 = ['DF', '/nologo', '/MD', '/WX', '/iface=(cref,nomixed_str_len_arg)', '/names:lowercase', '/assume:underscore', '/Ox', '/fast', '/optimize:5', '/unroll:0', '/math_library:fast', '/threads'] version = None libraries = [] library_dirs = ['c:\\Python23\\libs', 'c:\\Python23\\PCBuild', 'build\\temp.win32-2.3'] object_switch = '/object:' compile_switch = '/compile_only' include_dirs = ['c:\\Python23\\include', 'c:\\Python23\\PC'] ******************************************************************************** building 'SXFPyBase' extension compling C sources C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj Could not locate executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj" failed with exit status 1 make: *** [build] Error 1 My cygwin does find the DF executable: hoel@PC021358 ~/work/GLPy/test $ DF /what Compaq Visual Fortran Optimizing Compiler Version 6.1 (Update A) Copyright 2000 Compaq Computer Corp. All rights reserved. Compaq Visual Fortran 6.1-970-42A1L c:\Programme\Microsoft Visual Studio\DF98\bin\decfor90.exe hoel@PC021358 ~/work/GLPy/test $ which DF /cygdrive/c/Programme/Microsoft Visual Studio/DF98/bin/DF -- Mit freundlichen Grüßen Kind regards Berthold Höllmann -- Germanischer Lloyd AG CAE Development Vorsetzen 35 20459 Hamburg Phone: +49(0)40 36149-7374 Fax: +49(0)40 36149-7320 e-mail: hoel@gl-group.com Internet: http://www.gl-group.com This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail. GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.
On Fri, 26 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
I did a "cvs update" in scipy and "python setup.py install" in scipy_core but still get
<snip>
compling C sources C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj Could not locate executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj
error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\lib\SXFPyBase\SXFPyBasemodule.c /Fobuild\temp.win32-2.3\Release\build\src\lib\SXFPyBase\SXFPyBasemodule.obj" failed with exit status 1 make: *** [build] Error 1
Hmm, not sure what is going on here. Could you try running the exec_command.py tests? Just execute python exec_command.py in scipy_distutils/ directory. There is a function test_svn() that I used to test exec_command on commands having spaces in their paths (`svn` just happened to be such a one in my system). You can play with python -c "from exec_command import *;exec_command(['DF','/what'])" and the code starting at line #397 in exec_command.py to find out what is going on.
My cygwin does find the DF executable:
hoel@PC021358 ~/work/GLPy/test $ DF /what Compaq Visual Fortran Optimizing Compiler Version 6.1 (Update A) Copyright 2000 Compaq Computer Corp. All rights reserved.
Compaq Visual Fortran 6.1-970-42A1L c:\Programme\Microsoft Visual Studio\DF98\bin\decfor90.exe
hoel@PC021358 ~/work/GLPy/test $ which DF /cygdrive/c/Programme/Microsoft Visual Studio/DF98/bin/DF
That's interesting. Try to replace the following line return exe in find_executable() with return os.path.realpath(exe) HTH, Pearu
Pearu Peterson <pearu@scipy.org> writes:
On Fri, 26 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
I did a "cvs update" in scipy and "python setup.py install" in scipy_core but still get
<snip>
make: *** [build] Error 1
Hmm, not sure what is going on here. Could you try running the exec_command.py tests? Just execute
python exec_command.py
hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core/scipy_distutils $ python exec_command.py splitcmdline('a b cc') splitcmdline('a') splitcmdline('a " b cc"') splitcmdline('"a bcc" -h') splitcmdline('"\\"a \\" bcc" -h') splitcmdline(" 'a bcc' -h") splitcmdline("'\\'a \\' bcc' -h") Using cygwin echo in win32 environment is not supported splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('echo path=%path%') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "raise \'Ignore me.\'"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(\'0\');sys.stderr.write(\'1\');sys.stderr.write(\'2\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.exit(15)"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "print \'Heipa\'"') ok Using cygwin echo in win32 environment is not supported splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('echo path=%path%') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "raise \'Ignore me.\'"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(\'0\');sys.stderr.write(\'1\');sys.stderr.write(\'2\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.exit(15)"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "print \'Heipa\'"') ok splitcmdline('c:\\Python23\\PYTHON.EXE -c "print \'Ignore the following IOError:\',open(\'tmp0b66sb\',\'r\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "print open(\'tmp0b66sb\',\'r\').read()"') ok splitcmdline('c:\\Python23\\PYTHON.EXE -c "print \'Ignore the following IOError:\',open(\'tmp0zwgk-\',\'r\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "print open(\'tmp0zwgk-\',\'r\').read()"') ok Could not locate executable svn Executable svn does not exist
in scipy_distutils/ directory. There is a function test_svn() that I used to test exec_command on commands having spaces in their paths (`svn` just happened to be such a one in my system). You can play with
python -c "from exec_command import *;exec_command(['DF','/what'])"
hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core/scipy_distutils $ python -c "from exec_command import * ; exec_command(['DF','/what'])" hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core/scipy_distutils $ python -c "from exec_command import * ; print exec_command(['DF','/what'])" (999, '[Errno 22] Invalid argument: c:\\Programme\\Microsoft Visual Studio\\DF98\\bin\\DF.exe')
and the code starting at line #397 in exec_command.py to find out what is going on.
My cygwin does find the DF executable:
hoel@PC021358 ~/work/GLPy/test $ DF /what Compaq Visual Fortran Optimizing Compiler Version 6.1 (Update A) Copyright 2000 Compaq Computer Corp. All rights reserved.
Compaq Visual Fortran 6.1-970-42A1L c:\Programme\Microsoft Visual Studio\DF98\bin\decfor90.exe
hoel@PC021358 ~/work/GLPy/test $ which DF /cygdrive/c/Programme/Microsoft Visual Studio/DF98/bin/DF
That's interesting. Try to replace the following line
return exe
in find_executable() with
return os.path.realpath(exe)
after some fiddeling, the following does work for me under Win XP, cygwin, using the Enthought Python. cygwin python does return "posix" for "os.name" so the 'argv = [os.environ['COMSPEC'],'/C']+argv' part could be OK: Index: scipy_core/scipy_distutils/exec_command.py =================================================================== RCS file: /home/cvsroot/world/scipy_core/scipy_distutils/exec_command.py,v retrieving revision 1.17 diff -r1.17 exec_command.py 150c150 < return f_ext ---
return os.path.realpath(f_ext)
153c153 < return exe ---
return os.path.realpath(exe)
364c364 < argv[0] = find_executable(argv[0]) ---
argv[0] = quote_arg(find_executable(argv[0]))
367,370c367,370 < if os.name in ['nt','dos']: < # argv[0] might be internal command < argv = [os.environ['COMSPEC'],'/C']+argv < using_command = 1 ---
if os.name in ['nt','dos']: # argv[0] might be internal command argv = [os.environ['COMSPEC'],'/C']+argv using_command = 1
397,398d396 < argv0 = quote_arg(argv[0]) < 400c398 < status = spawn_command(os.P_WAIT,argv0,argv,os.environ) ---
status = spawn_command(os.P_WAIT,argv[0],argv,os.environ)
This version also works for me on Solaris and Linux with Python 2.2.1, and distutils from 2.3.3 replacing the original one. Kind regards Berthold Höllmann -- Germanischer Lloyd AG CAE Development Vorsetzen 35 20459 Hamburg Phone: +49(0)40 36149-7374 Fax: +49(0)40 36149-7320 e-mail: hoel@gl-group.com Internet: http://www.gl-group.com This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail. GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.
On Mon, 29 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
after some fiddeling, the following does work for me under Win XP, cygwin, using the Enthought Python. cygwin python does return "posix" for "os.name" so the 'argv = [os.environ['COMSPEC'],'/C']+argv' part could be OK:
Index: scipy_core/scipy_distutils/exec_command.py =================================================================== RCS file: /home/cvsroot/world/scipy_core/scipy_distutils/exec_command.py,v retrieving revision 1.17 diff -r1.17 exec_command.py
Thanks for the patch. I have applied it with few minor changes to CVS. Let me know if my changes did not work. Thanks! Pearu
Pearu Peterson <pearu@scipy.org> writes:
On Mon, 29 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
after some fiddeling, the following does work for me under Win XP, cygwin, using the Enthought Python. cygwin python does return "posix" for "os.name" so the 'argv = [os.environ['COMSPEC'],'/C']+argv' part could be OK:
Index: scipy_core/scipy_distutils/exec_command.py =================================================================== RCS file: /home/cvsroot/world/scipy_core/scipy_distutils/exec_command.py,v retrieving revision 1.17 diff -r1.17 exec_command.py
Thanks for the patch. I have applied it with few minor changes to CVS. Let me know if my changes did not work.
Dear Pearu, There are still problems (a problem) with the patches. I was already im mine, but I had'nt found the time to report them, sorry. The version is working for Linux and Solaris but trying to build scipy_core under WinXP I get: ---snip--- ... compling C sources creating build\temp.win32-2.3 creating build\temp.win32-2.3\Release creating build\temp.win32-2.3\Release\scipy_base C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DUSE_MCONF_LITE_LE -Ic:\Python23\include -Ic:\Python23\PC /Tcscipy_base\fastumathmodule.c /Fobuild\temp.win32-2.3\Release\scipy_base\fastumathmodule.obj Could not locate executable h:\work\CVS\scipy\scipy_core\"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable h:\work\CVS\scipy\scipy_core\"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DUSE_MCONF_LITE_LE -Ic:\Python23\include -Ic:\Python23\PC /Tcscipy_base\fastumathmodule.c /Fobuild\temp.win32-2.3\Release\scipy_base\fastumathmodule.obj" failed with exit status 1 ---snip--- "h:\work\CVS\scipy\scipy_core\" is where I checked out scipy from CVS. Further "python scipy_distutils/exec_command.py" fails. Line numbers are not exactely those from CVS because of additional debugging code. ---snip--- s,o=exec_command('echo path=%path%') log.debug((s,o)) assert s==0 and o!='',(s,o) s,o=exec_command('%s -c "import sys;sys.stderr.write(sys.platform)"' \ % pythonexe) log.debug((s,o)) assert s==0 and o=='win32',(s,o) ---snip--- With this I get: ---snip--- $ python scipy_distutils/exec_command.py ... Running spawnve(0,'C:\\WINDOWS\\system32\\cmd.exe',['C:\\WINDOWS\\system32\\cmd.exe', '/C', 'C:\\cygwin\\bin\\echo.exe', 'path=%path%'],os.environ) _update_environment(...) (0, 'path=c:\\Programme\\...<snipped>...\\bin') exec_command('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"',) Retaining cwd: h:\work\CVS\scipy\scipy_core _preserve_environment([]) _update_environment(...) _exec_command(...) splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"') splitcmdline -> ['c:\\Python23\\PYTHON.EXE', '-c', '"import sys;sys.stderr.write(sys.platform)"'] find_executable('c:\\Python23\\PYTHON.EXE') Found executable c:\Python23\PYTHON.EXE Running spawnve(0,'C:\\WINDOWS\\system32\\cmd.exe',['C:\\WINDOWS\\system32\\cmd.exe', '/C', 'c:\\Python23\\PYTHON.EXE', '-c', '"import sys;sys.stderr.write(sys.platform)"'],os.environ) _update_environment(...) (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32') Traceback (most recent call last): File "scipy_distutils/exec_command.py", line 599, in ? test(use_tee=0) File "scipy_distutils/exec_command.py", line 500, in test_nt assert s==0 and o=='win32',(s,o) AssertionError: (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32') ---snip--- The problem is, the test writes to stderr, but a result on stderr leads "_exec_command" to generate the "... FAILED ..." message which is not handled by the assert statement. Changing the assert to ---snip--- assert s==0 and o[-5:]=='win32',(s,o) ---snip--- fixes this problem and leads to the next one: ---snip--- exec_command('c:\\Python23\\PYTHON.EXE -c "raise \'Ignore me.\'"',) Retaining cwd: h:\work\CVS\scipy\scipy_core _preserve_environment([]) _update_environment(...) _exec_command(...) splitcmdline('c:\\Python23\\PYTHON.EXE -c "raise \'Ignore me.\'"') splitcmdline -> ['c:\\Python23\\PYTHON.EXE', '-c', '"raise \'Ignore me.\'"'] find_executable('c:\\Python23\\PYTHON.EXE') Found executable c:\Python23\PYTHON.EXE Running spawnve(0,'C:\\WINDOWS\\system32\\cmd.exe',['C:\\WINDOWS\\system32\\cmd.exe', '/C', 'c:\\Python23\\PYTHON.EXE', '-c', '"raise \'Ignore me.\'"'],os.environ) _update_environment(...) (1, '') Traceback (most recent call last): File "scipy_distutils/exec_command.py", line 600, in ? test(use_tee=0) File "scipy_distutils/exec_command.py", line 504, in test_nt assert s==1 and o,(s,o) AssertionError: (1, '') ---snip--- I have no idea what the problem is here, because: ---snip--- C:\WINDOWS\system32>C:\\WINDOWS\\system32\\cmd.exe /C c:\\Python23\\PYTHON.EXE -c "raise 'Ignore me.'" Traceback (most recent call last): File "<string>", line 1, in ? Ignore me. ---snip--- Testing works on Linux, but on Solaris I get: ---snip--- ... exec_command('echo $AAA',) Retaining cwd: /home/hoel/work/CVS/scipy/scipy_core _preserve_environment([]) _update_environment(...) _exec_command(...) splitcmdline('echo $AAA') splitcmdline -> ['echo', '$AAA'] Running spawnvpe(0,'echo',['echo', '$AAA'],os.environ) _update_environment(...) Traceback (most recent call last): File "scipy_distutils/exec_command.py", line 600, in ? test(use_tee=0) File "scipy_distutils/exec_command.py", line 523, in test_posix assert s==0 and o=='',(s,o) AssertionError: (0, '$AAA') ---snip--- which I also don't understand ---snip--- hoel@donau:scipy_core echo $AAA hoel@donau:scipy_core /bin/sh $ echo $AAA $ ---snip--- I'll try to find some fixes for these problems. Kind regards Berthold Höllmann -- Germanischer Lloyd AG CAE Development Vorsetzen 35 20459 Hamburg Phone: +49(0)40 36149-7374 Fax: +49(0)40 36149-7320 e-mail: hoel@gl-group.com Internet: http://www.gl-group.com This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail. GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.
On Tue, 30 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
There are still problems (a problem) with the patches. I was already im mine, but I had'nt found the time to report them, sorry. The version is working for Linux and Solaris but trying to build scipy_core under WinXP I get:
---snip--- ... compling C sources creating build\temp.win32-2.3 creating build\temp.win32-2.3\Release creating build\temp.win32-2.3\Release\scipy_base C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DUSE_MCONF_LITE_LE -Ic:\Python23\include -Ic:\Python23\PC /Tcscipy_base\fastumathmodule.c /Fobuild\temp.win32-2.3\Release\scipy_base\fastumathmodule.obj Could not locate executable h:\work\CVS\scipy\scipy_core\"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable h:\work\CVS\scipy\scipy_core\"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist
error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DUSE_MCONF_LITE_LE -Ic:\Python23\include -Ic:\Python23\PC /Tcscipy_base\fastumathmodule.c /Fobuild\temp.win32-2.3\Release\scipy_base\fastumathmodule.obj" failed with exit status 1 ---snip---
"h:\work\CVS\scipy\scipy_core\" is where I checked out scipy from CVS. Further "python scipy_distutils/exec_command.py" fails. Line numbers are not exactely those from CVS because of additional debugging code.
It seems that os.path.realpath is messing up things. For example, In [4]: os.path.realpath('c:/adad/adsa') Out[4]: '/home/pearu/c:/adad/adsa' In [5]: os.path.realpath('/adad/adsa') Out[5]: '/adad/adsa' Could you test on WinXP what is the result of the following expression os.path.realpath(r'C:\Programme') when python was fired up from the H: disk? Hmm, Python docs say that os.path.realpath is available only for Unix. This could provide a fix.
---snip--- s,o=exec_command('echo path=%path%') log.debug((s,o)) assert s==0 and o!='',(s,o)
s,o=exec_command('%s -c "import sys;sys.stderr.write(sys.platform)"' \ % pythonexe) log.debug((s,o)) assert s==0 and o=='win32',(s,o) ---snip---
With this I get:
---snip--- $ python scipy_distutils/exec_command.py ... AssertionError: (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32') ---snip---
The problem is, the test writes to stderr, but a result on stderr leads "_exec_command" to generate the "... FAILED ..."
I think I have fixed that yesterday.
AssertionError: (0, '$AAA') ---snip---
which I also don't understand
Ok, I could reproduce this on Sun and this is now fixed in CVS. Thanks, Pearu
Pearu Peterson <pearu@scipy.org> writes: Hallo Pearu, Thank you foru your prompt replay.
On Tue, 30 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
...
Could you test on WinXP what is the result of the following expression
os.path.realpath(r'C:\Programme')
I just checke out the latest CVS, and now get: ---snip--- hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ pwd /home/hoel/unix/work/CVS/scipy/scipy_core hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ ls -l /home/hoel/unix lrwxrwxrwx 1 hoel Kein 94 Oct 27 14:52 /home/hoel/unix -> /cygdrive/h hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ python Enthought Edition build 1028 Python 2.3 (#46, Aug 11 2003, 09:34:05) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import os.path os.path.realpath(r'C:\Programme') 'C:\\Programme' os.path.realpath(r"C:\Programme\Microsoft Visual Studio") 'C:\\Programme\\Microsoft Visual Studio' os.path.realpath(r"C:\Programme\Microsoft Visual Studio\\") 'C:\\Programme\\Microsoft Visual Studio' os.path.realpath(r'"C:\Programme\Microsoft Visual Studio\\"') 'h:\\work\\CVS\\scipy\\scipy_core\\"C:\\Programme\\Microsoft Visual Studio\\"' ^Z $ ---snip---
when python was fired up from the H: disk?
So the problem seems to be, the executable name got quoted to early (I think this was my fault, I moved "quote_arg" to an too early position, but on I think now it is called again at a wrong position. What I get now under WinXP is ---snip--- customize MSVCCompiler customize MSVCCompiler using build_clib 0 customize CompaqVisualFCompiler customize CompaqVisualFCompiler using build_clib splitcmdline('DF /what') running build_ext No module named msvccompiler customize MSVCCompiler customize MSVCCompiler using build_ext customize CompaqVisualFCompiler customize CompaqVisualFCompiler using build_ext splitcmdline('DF /what') building 'SXFPyBase' extension compling C sources C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include-Ic:\Python23\PC /Tcbuild\src\fortranobject.c /Fobuild\temp.win32-2.3\Release\build\src\fortranobject.obj Could not locate executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\fortranobject.c /Fobuild\temp.win32-2.3\Release\build\src\fortranobject.obj" failed with exit status 1 make: *** [build] Error 1 ---snip--- The line after "compling C sources" looks wrong (should'nt the word "compling" in command/build_clib.py be replaced by "compiling" at 4 instances?) but it comes from CCompiler_spawn and the cl.exe part goes properly quoted to exec_command. Maybe the "_nt_quote_args" and the part leading to "log.info" should be exchanged for clarity in CCompiler_spawn. ---snip--- # Using customized CCompiler.spawn. def CCompiler_spawn(self, cmd, display=None): if type(cmd) is type([]) and os.name == 'nt': cmd = _nt_quote_args(cmd) if display is None: display = cmd if type(display) is type([]): display = ' '.join(display) log.info(display) s,o = exec_command(cmd) if s: if type(cmd) is type([]): cmd = ' '.join(cmd) print o raise DistutilsExecError,\ 'Command "%s" failed with exit status %d' % (cmd, s) CCompiler.spawn = new.instancemethod(CCompiler_spawn,None,CCompiler) ---snip--- Back to my problem: It came out to the definition of the include directory '-I"f:\DATA\FBE\ESC\Devel\include"'. The execution via "cmd.exe" does not like the quotes (") around the include path, so I removed them, just to stumble over the next problem: "-If:\DATA\FBE\ESC\Devel\include" as an option to DF is interpreted as "/iface=\DATA\FBE\ESC\Devel\include" and leads to an syntax error in DF. Luckily for me, "f:" is a network directory so I can write "\\Glf\Vol1\...", but I guess a general solution should be found.
Hmm, Python docs say that os.path.realpath is available only for Unix. This could provide a fix.
---snip--- s,o=exec_command('echo path=%path%') log.debug((s,o)) assert s==0 and o!='',(s,o)
s,o=exec_command('%s -c "import sys;sys.stderr.write(sys.platform)"' \ % pythonexe) log.debug((s,o)) assert s==0 and o=='win32',(s,o) ---snip---
With this I get:
---snip--- $ python scipy_distutils/exec_command.py ... AssertionError: (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32') ---snip---
The problem is, the test writes to stderr, but a result on stderr leads "_exec_command" to generate the "... FAILED ..."
I think I have fixed that yesterday.
AssertionError: (0, '$AAA') ---snip---
which I also don't understand
Ok, I could reproduce this on Sun and this is now fixed in CVS.
python scipy_distutils/exec_command.py OK on Linux and Solaris (except for the failing svn test, but I have no svn installed, so this is expected ;-). But on WinXP I still get ---snip--- hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ python scipy_distutils/exec_command.py splitcmdline('a b cc') splitcmdline('a') splitcmdline('a " b cc"') splitcmdline('"a bcc" -h') splitcmdline('"\\"a \\" bcc" -h') splitcmdline(" 'a bcc' -h") splitcmdline("'\\'a \\' bcc' -h") Using cygwin echo in win32 environment is not supported splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('echo path=%path%') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"') Traceback (most recent call last): File "scipy_distutils/exec_command.py", line 601, in ? test(use_tee=0) File "scipy_distutils/exec_command.py", line 502, in test_nt assert s==0 and o=='win32',(s,o) AssertionError: (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32') ---snip--- maybe line 502 in exec_command.py could be changed to ---snip--- assert s==0 and o[-5:]=='win32',(s,o) ---snip--- Thanks Berthold -- Germanischer Lloyd AG CAE Development Vorsetzen 35 20459 Hamburg Phone: +49(0)40 36149-7374 Fax: +49(0)40 36149-7320 e-mail: hoel@gl-group.com Internet: http://www.gl-group.com This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail. GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.
On Wed, 31 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
I just checke out the latest CVS, and now get:
---snip--- hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ pwd /home/hoel/unix/work/CVS/scipy/scipy_core
hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ ls -l /home/hoel/unix lrwxrwxrwx 1 hoel Kein 94 Oct 27 14:52 /home/hoel/unix -> /cygdrive/h
hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ python Enthought Edition build 1028 Python 2.3 (#46, Aug 11 2003, 09:34:05) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import os.path os.path.realpath(r'C:\Programme') 'C:\\Programme' os.path.realpath(r"C:\Programme\Microsoft Visual Studio") 'C:\\Programme\\Microsoft Visual Studio' os.path.realpath(r"C:\Programme\Microsoft Visual Studio\\") 'C:\\Programme\\Microsoft Visual Studio' os.path.realpath(r'"C:\Programme\Microsoft Visual Studio\\"') 'h:\\work\\CVS\\scipy\\scipy_core\\"C:\\Programme\\Microsoft Visual Studio\\"' ^Z $ ---snip---
when python was fired up from the H: disk?
So the problem seems to be, the executable name got quoted to early (I think this was my fault, I moved "quote_arg" to an too early position, but on I think now it is called again at a wrong position. What I get now under WinXP is
---snip--- customize MSVCCompiler customize MSVCCompiler using build_clib 0 customize CompaqVisualFCompiler customize CompaqVisualFCompiler using build_clib splitcmdline('DF /what') running build_ext No module named msvccompiler customize MSVCCompiler customize MSVCCompiler using build_ext customize CompaqVisualFCompiler customize CompaqVisualFCompiler using build_ext splitcmdline('DF /what') building 'SXFPyBase' extension compling C sources C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include-Ic:\Python23\PC /Tcbuild\src\fortranobject.c /Fobuild\temp.win32-2.3\Release\build\src\fortranobject.obj Could not locate executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" Executable "C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist
error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDEBUG -DVISUAL_CPLUSPLUS -Ilib\SXFPyBase -I"f:\DATA\FBE\ESC\Devel\include" -Ibuild\src -Ic:\Python23\include -Ic:\Python23\PC /Tcbuild\src\fortranobject.c /Fobuild\temp.win32-2.3\Release\build\src\fortranobject.obj" failed with exit status 1 make: *** [build] Error 1 ---snip---
The line after "compling C sources" looks wrong (should'nt the word "compling" in command/build_clib.py be replaced by "compiling" at 4 instances?) but it comes from CCompiler_spawn and the cl.exe part goes properly quoted to exec_command. Maybe the "_nt_quote_args" and the part leading to "log.info" should be exchanged for clarity in CCompiler_spawn.
---snip--- # Using customized CCompiler.spawn. def CCompiler_spawn(self, cmd, display=None): if type(cmd) is type([]) and os.name == 'nt': cmd = _nt_quote_args(cmd) if display is None: display = cmd if type(display) is type([]): display = ' '.join(display) log.info(display) s,o = exec_command(cmd) if s: if type(cmd) is type([]): cmd = ' '.join(cmd) print o raise DistutilsExecError,\ 'Command "%s" failed with exit status %d' % (cmd, s) CCompiler.spawn = new.instancemethod(CCompiler_spawn,None,CCompiler) ---snip---
I fixed this issue by removing quotes in find_executable function. It is in CVS now and seems to work, I was able to build scipy_core with MSVC 6.0 compiler!
Back to my problem: It came out to the definition of the include directory '-I"f:\DATA\FBE\ESC\Devel\include"'. The execution via "cmd.exe" does not like the quotes (") around the include path, so I removed them, just to stumble over the next problem:
"-If:\DATA\FBE\ESC\Devel\include"
as an option to DF is interpreted as "/iface=\DATA\FBE\ESC\Devel\include" and leads to an syntax error in DF. Luckily for me, "f:" is a network directory so I can write "\\Glf\Vol1\...", but I guess a general solution should be found.
Hmm, Python docs say that os.path.realpath is available only for Unix. This could provide a fix.
---snip--- s,o=exec_command('echo path=%path%') log.debug((s,o)) assert s==0 and o!='',(s,o)
s,o=exec_command('%s -c "import sys;sys.stderr.write(sys.platform)"' \ % pythonexe) log.debug((s,o)) assert s==0 and o=='win32',(s,o) ---snip---
With this I get:
---snip--- $ python scipy_distutils/exec_command.py ... AssertionError: (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32') ---snip---
The problem is, the test writes to stderr, but a result on stderr leads "_exec_command" to generate the "... FAILED ..."
I think I have fixed that yesterday.
AssertionError: (0, '$AAA') ---snip---
which I also don't understand
Ok, I could reproduce this on Sun and this is now fixed in CVS.
python scipy_distutils/exec_command.py
OK on Linux and Solaris (except for the failing svn test, but I have no svn installed, so this is expected ;-).
But on WinXP I still get
---snip--- hoel@PC021358 ~/unix/work/CVS/scipy/scipy_core $ python scipy_distutils/exec_command.py splitcmdline('a b cc') splitcmdline('a') splitcmdline('a " b cc"') splitcmdline('"a bcc" -h') splitcmdline('"\\"a \\" bcc" -h') splitcmdline(" 'a bcc' -h") splitcmdline("'\\'a \\' bcc' -h") Using cygwin echo in win32 environment is not supported splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'AAA\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import os;print os.environ.get(\'BBB\',\'\')"') splitcmdline('echo path=%path%') splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"') Traceback (most recent call last): File "scipy_distutils/exec_command.py", line 601, in ? test(use_tee=0) File "scipy_distutils/exec_command.py", line 502, in test_nt assert s==0 and o=='win32',(s,o) AssertionError: (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32') ---snip---
maybe line 502 in exec_command.py could be changed to
---snip--- assert s==0 and o[-5:]=='win32',(s,o) ---snip---
No, that would be cheating;-) Recent CVS seems to fix this issue as well. Regards, Pearu
participants (3)
-
Berthold Höllmann -
Pearu Peterson -
Pearu Peterson