{"action":"created","issue":{"url":"https://api.github.com/repos/pyopencl/pyopencl/issues/103","labels_url":"https://api.github.com/repos/pyopencl/pyopencl/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/pyopencl/pyopencl/issues/103/comments","events_url":"https://api.github.com/repos/pyopencl/pyopencl/issues/103/events","html_url":"https://github.com/pyopencl/pyopencl/issues/103","id":121583230,"number":103,"title":"Visual Studio 2015","user":{"login":"cgohlke","id":483428,"avatar_url":"https://avatars.githubusercontent.com/u/483428?v=3","gravatar_id":"","url":"https://api.github.com/users/cgohlke","html_url":"https://github.com/cgohlke","followers_url":"https://api.github.com/users/cgohlke/followers","following_url":"https://api.github.com/users/cgohlke/following{/other_user}","gists_url":"https://api.github.com/users/cgohlke/gists{/gist_id}","starred_url":"https://api.github.com/users/cgohlke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgohlke/subscriptions","organizations_url":"https://api.github.com/users/cgohlke/orgs","repos_url":"https://api.github.com/users/cgohlke/repos","events_url":"https://api.github.com/users/cgohlke/events{/privacy}","received_events_url":"https://api.github.com/users/cgohlke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-12-10T21:39:42Z","updated_at":"2015-12-13T07:11:51Z","closed_at":null,"body":"Currently PyOpenCL >= 2015.2 can not be built for CPython 3.5 on Windows because mingwpy does not support Python 3.5.\r\n\r\nAccording to @yuyichao, Visual Studio 2015 support for C++11 should be complete enough to compile PyOpenCL. See https://github.com/pyopencl/pyopencl/commit/d19d94cfb09803059fbd6665283e10617d9e4229#commitcomment-14903890\r\n\r\nI am using the following patch to fix many compile errors due to unsupported variadic macro syntax. Does this look reasonable/portable?\r\n\r\n```diff\r\ndiff --git a/src/c_wrapper/clhelper.h b/src/c_wrapper/clhelper.h\r\nindex 0d8f630..2fb6cfd 100644\r\n--- a/src/c_wrapper/clhelper.h\r\n+++ b/src/c_wrapper/clhelper.h\r\n@@ -67,8 +67,8 @@ make_cloutarg(clobj_t *ret, cl_int (CL_API_CALL *release)(typename CLObj::cl_typ\r\n {\r\n     return _CLObjOutArg<CLObj, T...>(ret, release, name, t1...);\r\n }\r\n-#define pyopencl_outarg(type, ret, func, args...)               \\\r\n-    make_cloutarg<type>(ret, func, #func, ##args)\r\n+#define pyopencl_outarg(type, ret, func, ...)               \\\r\n+    make_cloutarg<type>(ret, func, #func, ##__VA_ARGS__)\r\n \r\n // {{{ GetInfo helpers\r\n \r\n@@ -83,8 +83,8 @@ get_vec_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,\r\n     call_guarded(func, name, args..., size_arg(buf), buf_arg(size));\r\n     return buf;\r\n }\r\n-#define pyopencl_get_vec_info(type, what, args...)                      \\\r\n-    get_vec_info<type>(clGet##what##Info, \"clGet\" #what \"Info\", args)\r\n+#define pyopencl_get_vec_info(type, what, ...)                      \\\r\n+    get_vec_info<type>(clGet##what##Info, \"clGet\" #what \"Info\", __VA_ARGS__)\r\n \r\n template<typename T>\r\n PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info\r\n@@ -109,8 +109,8 @@ convert_array_info(const char *tname, pyopencl_buf<T> &&_buf)\r\n \r\n #define pyopencl_convert_array_info(type, buf)          \\\r\n     convert_array_info<type>(#type, buf)\r\n-#define pyopencl_get_array_info(type, what, args...)                    \\\r\n-    pyopencl_convert_array_info(type, pyopencl_get_vec_info(type, what, args))\r\n+#define pyopencl_get_array_info(type, what, ...)                    \\\r\n+    pyopencl_convert_array_info(type, pyopencl_get_vec_info(type, what, __VA_ARGS__))\r\n \r\n template<typename CLObj, typename T>\r\n PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info\r\n@@ -123,9 +123,9 @@ convert_opaque_array_info(T &&buf)\r\n     info.value = buf_to_base<CLObj>(std::forward<T>(buf)).release();\r\n     return info;\r\n }\r\n-#define pyopencl_get_opaque_array_info(cls, what, args...)  \\\r\n+#define pyopencl_get_opaque_array_info(cls, what, ...)  \\\r\n     convert_opaque_array_info<cls>(               \\\r\n-        pyopencl_get_vec_info(cls::cl_type, what, args))\r\n+        pyopencl_get_vec_info(cls::cl_type, what, __VA_ARGS__))\r\n \r\n template<typename CLObj, typename... ArgTypes, typename... ArgTypes2>\r\n PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info\r\n@@ -145,9 +145,9 @@ get_opaque_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,\r\n     }\r\n     return info;\r\n }\r\n-#define pyopencl_get_opaque_info(clobj, what, args...)              \\\r\n+#define pyopencl_get_opaque_info(clobj, what, ...)              \\\r\n     get_opaque_info<clobj>(clGet##what##Info,             \\\r\n-                                     \"clGet\" #what \"Info\", args)\r\n+                                     \"clGet\" #what \"Info\", __VA_ARGS__)\r\n \r\n template<typename... ArgTypes, typename... ArgTypes2>\r\n PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info\r\n@@ -165,8 +165,8 @@ get_str_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,\r\n     info.value = (void*)param_value.release();\r\n     return info;\r\n }\r\n-#define pyopencl_get_str_info(what, args...)                            \\\r\n-    get_str_info(clGet##what##Info, \"clGet\" #what \"Info\", args)\r\n+#define pyopencl_get_str_info(what, ...)                            \\\r\n+    get_str_info(clGet##what##Info, \"clGet\" #what \"Info\", __VA_ARGS__)\r\n \r\n template<typename T, typename... ArgTypes, typename... ArgTypes2>\r\n PYOPENCL_USE_RESULT static PYOPENCL_INLINE generic_info\r\n@@ -182,9 +182,9 @@ get_int_info(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,\r\n     info.value = cl_memdup(&value);\r\n     return info;\r\n }\r\n-#define pyopencl_get_int_info(type, what, args...)                      \\\r\n+#define pyopencl_get_int_info(type, what, ...)                      \\\r\n     get_int_info<type>(clGet##what##Info, \"clGet\" #what \"Info\", \\\r\n-                                 #type \"*\", args)\r\n+                                 #type \"*\", __VA_ARGS__)\r\n \r\n // }}}\r\n \r\n@@ -200,8 +200,8 @@ convert_obj(cl_int (CL_API_CALL *clRelease)(CLType), const char *name, CLType cl\r\n         throw;\r\n     }\r\n }\r\n-#define pyopencl_convert_obj(type, func, args...)       \\\r\n-    convert_obj<type>(func, #func, args)\r\n+#define pyopencl_convert_obj(type, func, ...)       \\\r\n+    convert_obj<type>(func, #func, __VA_ARGS__)\r\n \r\n // {{{ extension function pointers\r\n \r\ndiff --git a/src/c_wrapper/error.h b/src/c_wrapper/error.h\r\nindex bae569b..3009018 100644\r\n--- a/src/c_wrapper/error.h\r\n+++ b/src/c_wrapper/error.h\r\n@@ -251,8 +251,8 @@ call_guarded(T (CL_API_CALL *func)(ArgTypes...), const char *name, ArgTypes2&&..\r\n     argpack.finish();\r\n     return res;\r\n }\r\n-#define pyopencl_call_guarded(func, args...)    \\\r\n-    call_guarded(func, #func, args)\r\n+#define pyopencl_call_guarded(func, ...)    \\\r\n+    call_guarded(func, #func, __VA_ARGS__)\r\n \r\n static PYOPENCL_INLINE void\r\n cleanup_print_error(cl_int status_code, const char *name) noexcept\r\n@@ -275,8 +275,8 @@ call_guarded_cleanup(cl_int (CL_API_CALL *func)(ArgTypes...), const char *name,\r\n         argpack.finish();\r\n     }\r\n }\r\n-#define pyopencl_call_guarded_cleanup(func, args...)    \\\r\n-    call_guarded_cleanup(func, #func, args)\r\n+#define pyopencl_call_guarded_cleanup(func, ...)    \\\r\n+    call_guarded_cleanup(func, #func, __VA_ARGS__)\r\n \r\n template<typename Func>\r\n PYOPENCL_USE_RESULT static PYOPENCL_INLINE error*\r\ndiff --git a/src/c_wrapper/wrap_constants.cpp b/src/c_wrapper/wrap_constants.cpp\r\nindex ae2980e..1a02455 100644\r\n--- a/src/c_wrapper/wrap_constants.cpp\r\n+++ b/src/c_wrapper/wrap_constants.cpp\r\n@@ -10,8 +10,8 @@ void populate_constants(void(*add)(const char*, const char*, int64_t value))\r\n {\r\n #define _ADD_ATTR(TYPE, PREFIX, NAME, SUFFIX, ...)      \\\r\n       add(TYPE, #NAME, CL_##PREFIX##NAME##SUFFIX)\r\n-#define ADD_ATTR(TYPE, PREFIX, NAME, EXTRA...)  \\\r\n-      _ADD_ATTR(TYPE, PREFIX, NAME, EXTRA)\r\n+#define ADD_ATTR(TYPE, PREFIX, NAME, ...)  \\\r\n+      _ADD_ATTR(TYPE, PREFIX, NAME, __VA_ARGS__)\r\n \r\n     // program_kind\r\n     add(\"program_kind\", \"UNKNOWN\", KND_UNKNOWN);\r\n```\r\nOne compile error at [function.h(53)](https://github.com/pyopencl/pyopencl/blob/master/src/c_wrapper/function.h#L53) remains:\r\n```\r\nwrap_cl.cpp\r\nsrc\\c_wrapper\\function.h(53): error C2210: 'T' : pack expansions cannot be used as arguments to non-packed parameters in alias templates\r\nsrc\\c_wrapper\\function.h(110): note: see reference to class template instantiation 'ArgPack<Convert,Types...>' being compiled\r\nsrc\\c_wrapper\\utils.h(226): warning C4800: 'cl_bool': forcing value to bool 'true' or 'false' (performance warning)\r\n```\r\n[This error report](https://connect.microsoft.com/VisualStudio/feedback/details/1341946) could be related, but it should be fixed in the Visual Studio 2015 version I am using.\r\n\r\nAny idea how to fix this?"},"comment":{"url":"https://api.github.com/repos/pyopencl/pyopencl/issues/comments/164233771","html_url":"https://github.com/pyopencl/pyopencl/issues/103#issuecomment-164233771","issue_url":"https://api.github.com/repos/pyopencl/pyopencl/issues/103","id":164233771,"user":{"login":"cgohlke","id":483428,"avatar_url":"https://avatars.githubusercontent.com/u/483428?v=3","gravatar_id":"","url":"https://api.github.com/users/cgohlke","html_url":"https://github.com/cgohlke","followers_url":"https://api.github.com/users/cgohlke/followers","following_url":"https://api.github.com/users/cgohlke/following{/other_user}","gists_url":"https://api.github.com/users/cgohlke/gists{/gist_id}","starred_url":"https://api.github.com/users/cgohlke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgohlke/subscriptions","organizations_url":"https://api.github.com/users/cgohlke/orgs","repos_url":"https://api.github.com/users/cgohlke/repos","events_url":"https://api.github.com/users/cgohlke/events{/privacy}","received_events_url":"https://api.github.com/users/cgohlke/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T07:11:51Z","updated_at":"2015-12-13T07:11:51Z","body":"This patch works with Visual Studio 2015 and CUDA 7.5 when `CL_ENABLE_GL=False`\r\n```diff\r\ndiff --git a/src/c_wrapper/buffer.cpp b/src/c_wrapper/buffer.cpp\r\nindex 22d7ec1..70e1ff3 100644\r\n--- a/src/c_wrapper/buffer.cpp\r\n+++ b/src/c_wrapper/buffer.cpp\r\n@@ -1,3 +1,4 @@\r\n+#include <algorithm>\r\n #include \"buffer.h\"\r\n #include \"context.h\"\r\n #include \"command_queue.h\"\r\ndiff --git a/src/c_wrapper/function.h b/src/c_wrapper/function.h\r\nindex 8986991..40525a1 100644\r\n--- a/src/c_wrapper/function.h\r\n+++ b/src/c_wrapper/function.h\r\n@@ -50,7 +50,7 @@ call_tuple(Function &&func, T &&args)\r\n }\r\n\r\n template<template<typename...> class Convert, typename... Types>\r\n-using _ArgPackBase = std::tuple<Convert<rm_ref_t<Types> >...>;\r\n+using _ArgPackBase = std::tuple<Convert<typename std::remove_reference<Types>::type>...>;\r\n\r\n template<template<typename...> class Convert, typename... Types>\r\n class ArgPack : public _ArgPackBase<Convert, Types...> {\r\ndiff --git a/src/c_wrapper/gl_obj.cpp b/src/c_wrapper/gl_obj.cpp\r\nindex 27525ce..ad5cf5b 100644\r\n--- a/src/c_wrapper/gl_obj.cpp\r\n+++ b/src/c_wrapper/gl_obj.cpp\r\n@@ -60,9 +60,9 @@ enqueue_gl_objects(clEnqueueGLObjectFunc func, const char *name,\r\n         mem_objects, num_mem_objects);\r\n     call_guarded(func, name, cq, _mem_objs, _wait_for, event_out(evt));\r\n }\r\n-#define enqueue_gl_objects(what, args...)                       \\\r\n+#define enqueue_gl_objects(what, ...)                       \\\r\n     enqueue_gl_objects(clEnqueue##what##GLObjects,              \\\r\n-                       \"clEnqueue\" #what \"GLObjects\", args)\r\n+                       \"clEnqueue\" #what \"GLObjects\", __VA_ARGS__)\r\n\r\n // c wrapper\r\n\r\ndiff --git a/src/c_wrapper/wrap_cl.h b/src/c_wrapper/wrap_cl.h\r\nindex c1feb22..cb8b421 100644\r\n--- a/src/c_wrapper/wrap_cl.h\r\n+++ b/src/c_wrapper/wrap_cl.h\r\n@@ -34,6 +34,7 @@\r\n #define NOMINMAX\r\n #include <windows.h>\r\n #define strdup _strdup\r\n+#define strcasecmp _stricmp\r\n #else\r\n #include <unistd.h>\r\n #define PYOPENCL_HAVE_EVENT_SET_CALLBACK\r\n\r\n```\r\nIf `CL_ENABLE_GL=True` or using Intel's OpenCL 5.3, compilation still fails:\r\n```\r\ngl_obj.cpp\r\nsrc\\c_wrapper\\utils.h(226): warning C4800: 'cl_bool': forcing value to bool 'true' or 'false' (performance warning)\r\nsrc/c_wrapper/gl_obj.cpp(157): warning C4297: 'get_apple_cgl_share_group': function assumed not to throw an exception but does\r\nsrc/c_wrapper/gl_obj.cpp(157): note: __declspec(nothrow), throw(), noexcept(true), or noexcept was specified on the function\r\nsrc\\c_wrapper\\error.h(233): error C2672: 'CLArgPack<const gl_texture *const ,unsigned int,ArgBuffer<unsigned int,ArgType::SizeOf>,nullptr>::clcall': no matching overloaded function found\r\nsrc\\c_wrapper\\clhelper.h(177): note: see reference to function template instantiation 'void call_guarded<const gl_texture*const &,cl_gl_texture_info&,ArgBuffer<unsigned int,ArgType::SizeOf>,nullptr,cl_mem,cl_gl_texture_info,size_t,void*,size_t*>(cl_int (__stdcall *)(cl_mem,cl_gl_texture_info,size_t,void *,size_t *),const char *,const gl_texture *const &,cl_gl_texture_info &,ArgBuffer<unsigned int,ArgType::SizeOf> &&,nullptr &&)' being compiled\r\nsrc/c_wrapper/gl_obj.cpp(18): note: see reference to function template instantiation 'generic_info get_int_info<GLenum,cl_mem,cl_gl_texture_info,size_t,void*,size_t*,const gl_texture*const ,cl_gl_texture_info&>(cl_int (__stdcall *)(cl_mem,cl_gl_texture_info,size_t,void *,size_t *),const char *,const char *,const gl_texture *const &&,cl_gl_texture_info &)' being compiled\r\nsrc\\c_wrapper\\error.h(233): error C2893: Failed to specialize function template 'unknown-type CLArgPack<const gl_texture *const ,unsigned int,ArgBuffer<unsigned int,ArgType::SizeOf>,nullptr>::clcall(Func,const char *)'\r\nsrc\\c_wrapper\\error.h(233): note: With the following template arguments:\r\nsrc\\c_wrapper\\error.h(233): note: 'Func=cl_int (__stdcall *)(cl_mem,cl_gl_texture_info,size_t,void *,size_t *)'\r\nsrc\\c_wrapper\\error.h(233): error C2672: 'CLArgPack<const gl_texture *const ,unsigned int,ArgBuffer<int,ArgType::SizeOf>,nullptr>::clcall': no matching overloaded function found\r\nsrc\\c_wrapper\\clhelper.h(177): note: see reference to function template instantiation 'void call_guarded<const gl_texture*const &,cl_gl_texture_info&,ArgBuffer<int,ArgType::SizeOf>,nullptr,cl_mem,cl_gl_texture_info,size_t,void*,size_t*>(cl_int (__stdcall *)(cl_mem,cl_gl_texture_info,size_t,void *,size_t *),const char *,const gl_texture *const &,cl_gl_texture_info &,ArgBuffer<int,ArgType::SizeOf> &&,nullptr &&)' being compiled\r\nsrc/c_wrapper/gl_obj.cpp(20): note: see reference to function template instantiation 'generic_info get_int_info<GLint,cl_mem,cl_gl_texture_info,size_t,void*,size_t*,const gl_texture*const ,cl_gl_texture_info&>(cl_int (__stdcall *)(cl_mem,cl_gl_texture_info,size_t,void *,size_t *),const char *,const char *,const gl_texture *const &&,cl_gl_texture_info &)' being compiled\r\nsrc\\c_wrapper\\error.h(233): error C2893: Failed to specialize function template 'unknown-type CLArgPack<const gl_texture *const ,unsigned int,ArgBuffer<int,ArgType::SizeOf>,nullptr>::clcall(Func,const char *)'\r\nsrc\\c_wrapper\\error.h(233): note: With the following template arguments:\r\nsrc\\c_wrapper\\error.h(233): note: 'Func=cl_int (__stdcall *)(cl_mem,cl_gl_texture_info,size_t,void *,size_t *)'\r\n```\r\n```\r\nmemory_object.cpp\r\nsrc\\c_wrapper\\utils.h(226): warning C4800: 'cl_bool': forcing value to bool 'true' or 'false' (performance warning)\r\nsrc\\c_wrapper\\clobj.h(108): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data\r\nsrc/c_wrapper/memory_object.cpp(106): note: see reference to function template instantiation 'pyopencl_buf<CLType> buf_from_class<event,const clobj_t>(T2 *,size_t)' being compiled\r\n        with\r\n        [\r\n            CLType=cl_event,\r\n            T2=const clobj_t\r\n        ]\r\nsrc\\c_wrapper\\error.h(233): error C2672: 'CLArgPack<const memory_object *const ,unsigned int,ArgBuffer<unsigned int,ArgType::SizeOf>,nullptr>::clcall': no matching overloaded function found\r\nsrc\\c_wrapper\\clhelper.h(177): note: see reference to function template instantiation 'void call_guarded<const memory_object*const &,cl_uint&,ArgBuffer<unsigned int,ArgType::SizeOf>,nullptr,cl_mem,cl_mem_info,size_t,void*,size_t*>(cl_int (__cdecl *)(cl_mem,cl_mem_info,size_t,void *,size_t *),const char *,const memory_object *const &,cl_uint &,ArgBuffer<unsigned int,ArgType::SizeOf> &&,nullptr &&)' being compiled\r\nsrc/c_wrapper/memory_object.cpp(54): note: see reference to function template instantiation 'generic_info get_int_info<cl_bool,cl_mem,cl_mem_info,size_t,void*,size_t*,const memory_object*const ,cl_uint&>(cl_int (__cdecl *)(cl_mem,cl_mem_info,size_t,void *,size_t *),const char *,const char *,const memory_object *const &&,cl_uint &)' being compiled\r\nsrc\\c_wrapper\\error.h(233): error C2893: Failed to specialize function template 'unknown-type CLArgPack<const memory_object *const ,unsigned int,ArgBuffer<unsigned int,ArgType::SizeOf>,nullptr>::clcall(Func,const char *)'\r\nsrc\\c_wrapper\\error.h(233): note: With the following template arguments:\r\nsrc\\c_wrapper\\error.h(233): note: 'Func=cl_int (__cdecl *)(cl_mem,cl_mem_info,size_t,void *,size_t *)'\r\n```"}}