Looking at the nvcc documentation (nvcc.pdf) I find:

Although a variety of POSIX style shells is supported on Windows, nvcc will 
still
assume the Microsoft Visual Studio compiler for host compilation. Use of gcc is 
not
supported on Windows.

So I guess it is safe to assume MSVC on windows and a simple 'win32' in 
sys.platform should be enough. Patch attached.



-----Original Message-----
From: Bergtholdt, Martin
Sent: 30 August 2011 15:29
To: 'Andreas Kloeckner'; '[email protected]'
Subject: RE: [PyCUDA] Current Windows VS 2008 builds

I think I start getting a clue where the errors in test_driver come from:

Preprocess_source evidently should return the preprocessed source code, which 
it doesn't on my machine:

nvcc --preprocess -arch sm_20 -m32 
-IC:\\Python26\\lib\\site-packages\\pycuda-2011.1.3-py2.6-win32.egg\\pycuda\\..\\include\\pycuda
 c:\\users\\dep14422\\appdata\\local\\temp\\tmptzcgj9.cu --compiler-options -P
tmptzcgj9.cu

it just outputs the tmptzcgj9.cu filename.

Since the output is then used as hash, I don't think that this is the intended 
behavior it rather seems that gcc outputs with the -E option the result of 
preprocessing to stdout.

I also got the culprit:

"To send the preprocessed output to a file instead of to stdout, use the /P 
(Preprocess to a File) option instead."

So cl outputs to a file *.i (tmptzcgj9.i) in the current directory (I now have 
a bunch of them in my test/ directory), because of the -P. It should be -EP:

"To suppress #line directives, use the /EP (Preprocess to stdout Without #line 
Directives) option instead."

Edited -P to -EP: works!

d:/Programming/Python/site-packages/pycuda/test $ python test_driver.py
============================= test session starts ==============================
platform win32 -- Python 2.6.6 -- pytest-2.1.0
collecting ... collected 21 items

test_driver.py .....................

========================== 21 passed in 62.54 seconds ==========================


I don't know if you already have a way to check for the host compiler to set 
this parameter depending on the chosen compiler.

Regards,
  Martin



-----Original Message-----
From: Bergtholdt, Martin
Sent: 30 August 2011 13:50
To: 'Andreas Kloeckner'; [email protected]
Subject: RE: [PyCUDA] Current Windows VS 2008 builds

Hi Andreas,

> -----Original Message-----
> From: Andreas Kloeckner [mailto:[email protected]]
> Sent: 29 August 2011 22:28

> > However, I still geht errors when running testdriver.py that I
> > cannot resolve, see test.txt.
>
> Have you tried emptying your (PyCUDA) compiler cache? If the Nv driver 
> doesn't reject broken binaries, then what you see might happen. Otherwise 
> it's pretty mysterious.

I just did and recompiled pycuda and rerun test_driver.py. Same result :-(

Any other hint on how I can debug this?

> > I still get these three warnings during compilation. I don't know if any of 
> > these could cause the tests to fail later:
> >
> > D:/Programming/CC/install/vs09x64_shared_release/include\boost/pytho
> > n/
> > detail/caller.hpp(55) : warning C4244: 'return' : conversion from
> > 'Py_ssize_t' to 'unsigned int', possible loss of data
>
> Is there instantiated-from info available for this one? Otherwise it's hard 
> to track down.

Indeed. I cannot find any compiler option for the Microsoft compiler to output 
also included-from / instantiated-from as with gcc. If anybody has a hint on 
that I'd appreciate it. I attached the full build-log in case you want to look 
at it.

> > src/wrapper/_pycuda_struct.cpp(606) : warning C4800: 'int' : forcing
> > value to bool 'true' or 'false' (performance warning)
>
> I think I fixed this one.

Yes, I no longer see it.

> Andreas
Martin

The information contained in this message may be confidential and legally 
protected under applicable law. The message is intended solely for the 
addressee(s). If you are not the intended recipient, you are hereby notified 
that any use, forwarding, dissemination, or reproduction of this message is 
strictly prohibited and may be unlawful. If you are not the intended recipient, 
please contact the sender by return e-mail and destroy all copies of the 
original message.

Attachment: 0001-Fix-compilation-warning-Win64.patch
Description: 0001-Fix-compilation-warning-Win64.patch

Attachment: 0002-Fix-Windows-preprocessing-source-for-checksum-calcul.patch
Description: 0002-Fix-Windows-preprocessing-source-for-checksum-calcul.patch

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to