Hello,
Sorry for the long message, hopefully google is going to index it for me
at least. After an evening of messing around I managed to have the
pycuda test cases passing using the boost subset that comes inside of
pycuda. Before submitting anything to the wiki I thought to run things
by the list. There seem to be a couple of minor patches needed in the
pycuda tree for my bizarre machine setup:
In a git bash shell:
$ git clone http://git.tiker.net/trees/pycuda.git
$ cd pycuda
$ git submodule init
$ git submodule update
Edit siteconf.py to give:
BOOST_INC_DIR = []
BOOST_LIB_DIR = []
BOOST_COMPILER = ''
USE_SHIPPED_BOOST = True
BOOST_PYTHON_LIBNAME = ['boost_python']
BOOST_THREAD_LIBNAME = ['boost_thread']
CUDA_TRACE = False
CUDA_ROOT = 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v3.2'
CUDA_ENABLE_GL = False
CUDA_ENABLE_CURAND = True
# note the /x64
CUDADRV_LIB_DIR = ['${CUDA_ROOT}/lib/x64']
CUDADRV_LIBNAME = ['cuda']
CUDART_LIB_DIR = ['${CUDA_ROOT}/lib/x64']
CUDART_LIBNAME = ['cudart']
CURAND_LIB_DIR = [ '${CUDA_ROOT}/lib/x64']
CURAND_LIBNAME = ['curand']
CXXFLAGS = ['/EHsc']
LDFLAGS = ['']
Fire up a command prompt and set up the compiler using:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat
Compiler notes are on this page, you can get the amd64 compiler from the
SDK:
http://blog.victorjabur.com/2011/06/05/compiling-python-2-7-modules-on-windows-32-and-64-using-msvc-2008-express/
Edit aksetup_helper.py. The first diff makes windows and unix slashes go
the same way so the next line works. Second diff (BOOST_ALL_NO_LIB=1)
stops the linker from getting libboost as one of the /DEFAULTLIB args.
index 3e8cbed..053540f 100644
--- a/aksetup_helper.py
+++ b/aksetup_helper.py
@@ -567,7 +567,7 @@ def set_up_shipped_boost_if_requested(project_name,
conf):
source_files = (glob("bpl-subset/bpl_subset/libs/*/*/*/*.cpp")
+ glob("bpl-subset/bpl_subset/libs/*/*/*.cpp")
+ glob("bpl-subset/bpl_subset/libs/*/*.cpp"))
-
+ source_files = [f.replace("\\","/") for f in source_files]
source_files = [f for f in source_files
if not
f.startswith("bpl-subset/bpl_subset/libs/thread/src")]
@@ -593,7 +593,7 @@ def set_up_shipped_boost_if_requested(project_name,
conf):
symlink("boost", bpl_project_boost_inc)
return (source_files,
- {
+ { "BOOST_ALL_NO_LIB":1,
"BOOST_MULTI_INDEX_DISABLE_SERIALIZATION": 1,
"BOOST_PYTHON_SOURCE": 1,
"boost": '%sboost' % project_name
Then there is only a problem for something about tss_cleanup_implemented
within boost. No idea what it is about, apparently only intended to
generate linker errors, so commenting it out lets things link:
--- a/bpl_subset/libs/thread/src/win32/thread.cpp
+++ b/bpl_subset/libs/thread/src/win32/thread.cpp
@@ -30,7 +30,7 @@ namespace boost
void create_current_thread_tls_key()
{
- tss_cleanup_implemented(); // if anyone uses TSS, we need
the cleanup linked in
+ // tss_cleanup_implemented(); // sorry if anyone uses TSS,
we needed the cleanup linked in, but instead it will be left dirty.
current_thread_tls_key=TlsAlloc();
#if defined(UNDER_CE)
// Windows CE does not define the
TLS_OUT_OF_INDEXES constant.
Obviously, if pycuda is using tss and I haven't cleaned up then my pc is
going to have dirty tss all over the inside. Yuck!
Finally I got past an nvcc error via a forum post here, which boiled
down to copying that bat file above as vcvarsamd64.bat in C:\Program
Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64 from the directory
above. Go figure.
http://forums.nvidia.com/index.php?showtopic=98319
Quite possibly there is more to it all, but at least the test cases
pass. Perhaps I should be on a later cuda version, but then I'd never
have discovered all this out as the binaries would have worked
(depends.exe shows I am a little out of date on my cuda installation).
Hope this helps someone.
Best
Jon
_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda