ddemidov / vexcl

VexCL is a C++ vector expression template library for OpenCL/CUDA/OpenMP
http://vexcl.readthedocs.org
MIT License
699 stars 81 forks source link

CUDA warnings #258

Closed henryiii closed 5 years ago

henryiii commented 5 years ago

When compiling CUDA kernels, the following warning is printed quite a few times:

cc1: warning: command line option ‘-std=c++98’ is valid for C++/ObjC++ but not for C [enabled by default]

If I remove the explicit setting of the host compiler c++ mode, it goes away:

diff --git a/vexcl/backend/cuda/compiler.hpp b/vexcl/backend/cuda/compiler.hpp
index 2bfab16..0c054a3 100644
--- a/vexcl/backend/cuda/compiler.hpp
+++ b/vexcl/backend/cuda/compiler.hpp
@@ -39,9 +39,9 @@ THE SOFTWARE.

 #ifndef VEXCL_NVCC_OPTIONS
 #  ifdef NDEBUG
-#    define VEXCL_NVCC_OPTIONS "-O3 -Xcompiler -std=c++03"
+#    define VEXCL_NVCC_OPTIONS "-O3"
 #  else
-#    define VEXCL_NVCC_OPTIONS "-g -Xcompiler -std=c++03"
+#    define VEXCL_NVCC_OPTIONS "-g"
 #  endif
 #endif
ddemidov commented 5 years ago

I wish I remembered why I did https://github.com/ddemidov/vexcl/commit/cfa8a7aee2f55f8547caef45df69d4b0fc08c136.

ddemidov commented 5 years ago

I think controlling nvcc options with a preprocessor definition was the more important part of that commit; and even if we drop -Xcompiler -std=c++03 from defaults, users can always re-enable it that way.

So if this bothers you, I would accept the PR.